diff options
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src')
2 files changed, 5 insertions, 5 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src/main/java/org/onap/policy/apex/plugins/event/carrier/grpc/ApexGrpcProducer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src/main/java/org/onap/policy/apex/plugins/event/carrier/grpc/ApexGrpcProducer.java index ce00210e8..fcb743df8 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src/main/java/org/onap/policy/apex/plugins/event/carrier/grpc/ApexGrpcProducer.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src/main/java/org/onap/policy/apex/plugins/event/carrier/grpc/ApexGrpcProducer.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2020 Nordix Foundation. * Modifications Copyright (C) 2020-2021 Bell Canada. All rights reserved. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,13 +25,11 @@ package org.onap.policy.apex.plugins.event.carrier.grpc; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.util.JsonFormat; import java.util.Properties; -import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType; import org.onap.ccsdk.cds.controllerblueprints.common.api.Status; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput; -import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput.Builder; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput; import org.onap.policy.apex.service.engine.event.ApexEventConsumer; import org.onap.policy.apex.service.engine.event.ApexEventException; @@ -100,7 +99,7 @@ public class ApexGrpcProducer extends ApexPluginsEventProducer implements CdsPro final Object event) { ExecutionServiceInput executionServiceInput; - Builder builder = ExecutionServiceInput.newBuilder(); + var builder = ExecutionServiceInput.newBuilder(); try { JsonFormat.parser().ignoringUnknownFields().merge((String) event, builder); executionServiceInput = builder.build(); @@ -109,7 +108,7 @@ public class ApexGrpcProducer extends ApexPluginsEventProducer implements CdsPro "Incoming Event cannot be converted to ExecutionServiceInput type for gRPC request." + e.getMessage()); } try { - CountDownLatch countDownLatch = client.sendRequest(executionServiceInput); + var countDownLatch = client.sendRequest(executionServiceInput); if (!countDownLatch.await(props.getTimeout(), TimeUnit.SECONDS)) { cdsResponse.set(ExecutionServiceOutput.newBuilder().setStatus(Status.newBuilder() .setErrorMessage(CdsActorConstants.TIMED_OUT).setEventType(EventType.EVENT_COMPONENT_FAILURE)) diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src/main/java/org/onap/policy/apex/plugins/event/carrier/grpc/GrpcCarrierTechnologyParameters.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src/main/java/org/onap/policy/apex/plugins/event/carrier/grpc/GrpcCarrierTechnologyParameters.java index f13248ec5..79a28c6cf 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src/main/java/org/onap/policy/apex/plugins/event/carrier/grpc/GrpcCarrierTechnologyParameters.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src/main/java/org/onap/policy/apex/plugins/event/carrier/grpc/GrpcCarrierTechnologyParameters.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,7 +85,7 @@ public class GrpcCarrierTechnologyParameters extends CarrierTechnologyParameters * @throws ApexEventException exception thrown when invalid parameters are provided */ public void validateGrpcParameters(boolean isProducer) throws ApexEventException { - StringBuilder errorMessage = new StringBuilder(); + var errorMessage = new StringBuilder(); if (isProducer) { if (timeout < 1) { errorMessage.append("timeout should have a positive value.\n"); |