diff options
Diffstat (limited to 'models-interactions/model-impl/cds/src')
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()); |