summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-impl/cds/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-05-10 09:53:23 -0400
committerJim Hahn <jrh3@att.com>2021-05-10 11:07:36 -0400
commit6372b62fcd8813d7d49fb279b933ffe2e4637048 (patch)
tree5d221f640ece91ce331f56d7bb6537a4393def3a /models-interactions/model-impl/cds/src/main
parentda708d64dc27f36ed5da733fca14ebfb4cc2832b (diff)
Fix sonars in policy-models impls & simulators
Fixed: - use "var" Issue-ID: POLICY-3094 Change-Id: I65da54cae5a58966f21f981c6cea1259bfdf4239 Signed-off-by: Jim Hahn <jrh3@att.com> simulators Change-Id: I1144568485e62e0c72194caaf21ebf1ba88a6fef Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-impl/cds/src/main')
-rw-r--r--models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorGrpcClient.java8
-rw-r--r--models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorHandler.java9
2 files changed, 5 insertions, 12 deletions
diff --git a/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorGrpcClient.java b/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorGrpcClient.java
index 29fa687c0..ce0918d5e 100644
--- a/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorGrpcClient.java
+++ b/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorGrpcClient.java
@@ -54,13 +54,7 @@ public class CdsProcessorGrpcClient implements AutoCloseable {
Preconditions.checkState(validationResult.getStatus().isValid(), "Error validating CDS server "
+ "properties: " + validationResult.getResult());
- StringBuilder bldr = new StringBuilder("gRPC://");
- bldr.append(props.getHost());
- bldr.append(":");
- bldr.append(props.getPort());
- bldr.append('/');
-
- String url = bldr.toString();
+ String url = "gRPC://" + props.getHost() + ":" + props.getPort() + "/";
this.channel = NettyChannelBuilder.forAddress(props.getHost(), props.getPort())
.intercept(new BasicAuthClientHeaderInterceptor(props)).usePlaintext().build();
diff --git a/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorHandler.java b/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorHandler.java
index 660908bfa..bb7a038db 100644
--- a/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorHandler.java
+++ b/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorHandler.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Bell Canada.
- * Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2020-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.
@@ -22,7 +22,6 @@ package org.onap.policy.cds.client;
import io.grpc.ManagedChannel;
import io.grpc.stub.StreamObserver;
import java.util.concurrent.CountDownLatch;
-import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceStub;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
@@ -47,13 +46,13 @@ public class CdsProcessorHandler {
}
CountDownLatch process(ExecutionServiceInput request, ManagedChannel channel) {
- final ActionIdentifiers header = request.getActionIdentifiers();
+ final var header = request.getActionIdentifiers();
LOGGER.info("Processing blueprint({}:{}) for action({})", header.getBlueprintVersion(),
header.getBlueprintName(), header.getBlueprintVersion());
- final CountDownLatch finishLatch = new CountDownLatch(1);
+ final var finishLatch = new CountDownLatch(1);
final BluePrintProcessingServiceStub asyncStub = BluePrintProcessingServiceGrpc.newStub(channel);
- final StreamObserver<ExecutionServiceOutput> responseObserver = new StreamObserver<ExecutionServiceOutput>() {
+ final StreamObserver<ExecutionServiceOutput> responseObserver = new StreamObserver<>() {
@Override
public void onNext(ExecutionServiceOutput output) {
NetLoggerUtil.log(EventType.IN, CommInfrastructure.REST, url, output.toString());