X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-interactions%2Fmodel-actors%2FactorServiceProvider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontrolloop%2Factorserviceprovider%2Fimpl%2FBidirectionalTopicOperator.java;h=0745c3aba16ab19502287b5cf0feb4bd7492f009;hb=e9af3a2b3a430626c740b18ccf8592706db1dfb1;hp=43c8b8872b5efa4258fadb5a28948547358cf7c9;hpb=c34fdc19686d70af12e8873b0b01b96dd54c1aa3;p=policy%2Fmodels.git diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperator.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperator.java index 43c8b8872..0745c3aba 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperator.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperator.java @@ -23,14 +23,10 @@ package org.onap.policy.controlloop.actorserviceprovider.impl; import java.util.Arrays; import java.util.List; import java.util.Map; -import lombok.Getter; import org.onap.policy.common.parameters.ValidationResult; -import org.onap.policy.controlloop.actorserviceprovider.Operation; import org.onap.policy.controlloop.actorserviceprovider.Util; import org.onap.policy.controlloop.actorserviceprovider.parameters.BidirectionalTopicConfig; import org.onap.policy.controlloop.actorserviceprovider.parameters.BidirectionalTopicParams; -import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams; -import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams; import org.onap.policy.controlloop.actorserviceprovider.parameters.ParameterValidationRuntimeException; import org.onap.policy.controlloop.actorserviceprovider.topic.BidirectionalTopicHandler; import org.onap.policy.controlloop.actorserviceprovider.topic.BidirectionalTopicManager; @@ -40,13 +36,8 @@ import org.onap.policy.controlloop.actorserviceprovider.topic.SelectorKey; * Operator that uses a bidirectional topic. Topic operators may share a * {@link BidirectionalTopicHandler}. */ -public class BidirectionalTopicOperator extends OperatorPartial { - - /** - * Function to make an operation. - */ - @SuppressWarnings("rawtypes") - private final OperationMaker operationMaker; +public class BidirectionalTopicOperator + extends TypedOperator> { /** * Manager from which to get the topic handlers. @@ -58,12 +49,6 @@ public class BidirectionalTopicOperator extends OperatorPartial { */ private final List selectorKeys; - /** - * Current configuration. This is set by {@link #doConfigure(Map)}. - */ - @Getter - private BidirectionalTopicConfig currentConfig; - /** * Constructs the object. @@ -88,17 +73,13 @@ public class BidirectionalTopicOperator extends OperatorPartial { * @param selectorKeys keys used to extract the fields used to select responses for * this operator */ - // @formatter:off public BidirectionalTopicOperator(String actorName, String name, BidirectionalTopicManager topicManager, List selectorKeys, - @SuppressWarnings("rawtypes") OperationMaker - operationMaker) { - // @formatter:on + OperationMaker> operationMaker) { - super(actorName, name); + super(actorName, name, operationMaker); this.topicManager = topicManager; this.selectorKeys = selectorKeys; - this.operationMaker = operationMaker; } /** @@ -110,24 +91,12 @@ public class BidirectionalTopicOperator extends OperatorPartial { * @param selectorKeys keys used to extract the fields used to select responses for * this operator */ - // @formatter:off public BidirectionalTopicOperator(String actorName, String name, BidirectionalTopicManager topicManager, - @SuppressWarnings("rawtypes") OperationMaker - operationMaker, + OperationMaker> operationMaker, SelectorKey... selectorKeys) { - // @formatter:on this(actorName, name, topicManager, Arrays.asList(selectorKeys), operationMaker); } - /** - * Translates the parameters to an {@link HttpParams} and then extracts the relevant - * values. - */ - @Override - protected void doConfigure(Map parameters) { - currentConfig = makeConfiguration(parameters); - } - /** * Makes a new configuration using the specified parameters. * @@ -143,15 +112,4 @@ public class BidirectionalTopicOperator extends OperatorPartial { return new BidirectionalTopicConfig(getBlockingExecutor(), params, topicManager, selectorKeys); } - - @Override - public Operation buildOperation(ControlLoopOperationParams params) { - if (operationMaker == null) { - throw new UnsupportedOperationException("cannot make operation for " + getFullName()); - } - - verifyRunning(); - - return operationMaker.apply(params, currentConfig); - } }