From cbbc4a71ce71f22439b083107c65c22cc63bc9cc Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Tue, 18 Feb 2020 12:25:37 -0500 Subject: Add SO actor Issue-ID: POLICY-2371 Signed-off-by: Jim Hahn Change-Id: I3faf0276e8039dc43a976d18ff8e704fdbec3d49 --- .../controlloop/ControlLoopEventContext.java | 2 +- .../controlloop/actorserviceprovider/impl/HttpOperator.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'models-interactions/model-actors/actorServiceProvider') diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/controlloop/ControlLoopEventContext.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/controlloop/ControlLoopEventContext.java index 3e02da611..8099ea7c2 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/controlloop/ControlLoopEventContext.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/controlloop/ControlLoopEventContext.java @@ -137,7 +137,7 @@ public class ControlLoopEventContext implements Serializable { // @formatter:off CompletableFuture oldFuture = - retrievers.compute(name, (key, future) -> (future == null || future.isCancelled() ? null : future)); + retrievers.computeIfPresent(name, (key, future) -> future.isCancelled() ? null : future); // @formatter:on if (oldFuture != null) { diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperator.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperator.java index add74aa42..b4a3318e7 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperator.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperator.java @@ -95,6 +95,15 @@ public abstract class HttpOperator extends OperatorPartial { throw new ParameterValidationRuntimeException("invalid parameters", result); } + doConfigure(params); + } + + /** + * Configures the operator using the specified parameters. + * + * @param params operator parameters + */ + protected void doConfigure(HttpParams params) { client = getClientFactory().get(params.getClientName()); path = params.getPath(); timeoutMs = TimeUnit.MILLISECONDS.convert(params.getTimeoutSec(), TimeUnit.SECONDS); -- cgit 1.2.3-korg