diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2020-08-27 08:44:12 -0400 |
---|---|---|
committer | Pamela Dragosh <pdragosh@research.att.com> | 2020-08-27 14:29:09 -0400 |
commit | f456cc5c8e1efd15edb6da718e1428d8fd7c66c5 (patch) | |
tree | b7b4ba3fc6255b056e00f6e203d7ec8fd6a7c194 /models-interactions/model-actors/actor.cds/src/main | |
parent | 68a60a45f27287a4a523c82ef466cbeec655f641 (diff) |
Remove Target and TargetType
The dependency should have been removed in the last review to
remove SDC and policy-yaml legacy code.
It was revealed that usage of TargetType and Type were spread out over the
actor code. Those fields are represented differently in the new
TOSCA Operational Policy Type, so fields were created to capture
those values to be used by actor code.
Issue-ID: POLICY-2428
Change-Id: Ib783526a518ca7942ae9e38019bd343639f4dd98
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.cds/src/main')
2 files changed, 8 insertions, 7 deletions
diff --git a/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/CdsActorServiceManager.java b/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/CdsActorServiceManager.java index d0f5bd2b4..4da23f1a8 100644 --- a/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/CdsActorServiceManager.java +++ b/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/CdsActorServiceManager.java @@ -23,7 +23,7 @@ import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput; import org.onap.policy.cds.api.CdsProcessorListener; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; -import org.onap.policy.controlloop.policy.PolicyResult; +import org.onap.policy.controlloop.actorserviceprovider.OperationResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -61,12 +61,12 @@ public class CdsActorServiceManager implements CdsProcessorListener { LOGGER.info("CDS is processing the message: {}", message); break; case EVENT_COMPONENT_EXECUTED: - outcome.setResult(PolicyResult.SUCCESS); + outcome.setResult(OperationResult.SUCCESS); outcome.setResponse(message); future.complete(outcome); break; default: - outcome.setResult(PolicyResult.FAILURE); + outcome.setResult(OperationResult.FAILURE); outcome.setResponse(message); future.complete(outcome); break; diff --git a/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/GrpcOperation.java b/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/GrpcOperation.java index d3842441d..c04453b7c 100644 --- a/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/GrpcOperation.java +++ b/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/GrpcOperation.java @@ -50,11 +50,11 @@ import org.onap.policy.controlloop.actor.cds.constants.CdsActorConstants; import org.onap.policy.controlloop.actor.cds.request.CdsActionRequest; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; import org.onap.policy.controlloop.actorserviceprovider.OperationProperties; +import org.onap.policy.controlloop.actorserviceprovider.TargetType; import org.onap.policy.controlloop.actorserviceprovider.Util; import org.onap.policy.controlloop.actorserviceprovider.impl.OperationPartial; import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams; import org.onap.policy.controlloop.actorserviceprovider.pipeline.PipelineControllerFuture; -import org.onap.policy.controlloop.policy.TargetType; /** * Operation that uses gRPC to send request to CDS. @@ -111,7 +111,7 @@ public class GrpcOperation extends OperationPartial { super(params, config, Collections.emptyList()); this.config = config; - if (TargetType.PNF.equals(params.getTarget().getType())) { + if (TargetType.PNF.equals(params.getTargetType())) { aaiRequestor = this::getPnf; aaiConverter = this::convertPnfToAaiProperties; } else { @@ -122,7 +122,7 @@ public class GrpcOperation extends OperationPartial { @Override public List<String> getPropertyNames() { - return (TargetType.PNF.equals(params.getTarget().getType()) ? PNF_PROPERTY_NAMES : VNF_PROPERTY_NAMES); + return (TargetType.PNF.equals(params.getTargetType()) ? PNF_PROPERTY_NAMES : VNF_PROPERTY_NAMES); } /** @@ -259,7 +259,8 @@ public class GrpcOperation extends OperationPartial { AaiCqResponse aaicq = params.getContext().getProperty(AaiCqResponse.CONTEXT_KEY); - genericVnf = aaicq.getGenericVnfByModelInvariantId(params.getTarget().getResourceID()); + genericVnf = aaicq.getGenericVnfByModelInvariantId(params.getTargetEntityIds() + .get(ControlLoopOperationParams.PARAMS_ENTITY_RESOURCEID)); if (genericVnf == null) { throw new IllegalArgumentException("Target generic vnf could not be found"); } |