aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src/main/java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-08-27 15:24:06 -0400
committerJim Hahn <jrh3@att.com>2021-08-27 16:08:00 -0400
commitf4580fa8a931c84b36d59e2ef853d1fba3d5917e (patch)
tree0c6a047fadfa26898af614460ac8699f2aa4a4ab /plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src/main/java
parent9d8894092ced589c0bdc5b9e85ee1bf1c85d3e36 (diff)
Fix sonars in apex-pdp #2
plugins-events thru plugins-persistence-jpa-eclipselink Fixed: - use "var" - disambiguate method parameter types - rename parameter Issue-ID: POLICY-3093 Change-Id: Ife5897015be495403e731754d5862b803a217c87 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src/main/java')
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src/main/java/org/onap/policy/apex/plugins/event/carrier/grpc/ApexGrpcProducer.java7
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-grpc/src/main/java/org/onap/policy/apex/plugins/event/carrier/grpc/GrpcCarrierTechnologyParameters.java3
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");