Remove Target and TargetType
[policy/models.git] / models-interactions / model-actors / actorServiceProvider / src / main / java / org / onap / policy / controlloop / actorserviceprovider / parameters / ControlLoopOperationParams.java
index d0b7c26..0e4f09b 100644 (file)
@@ -37,9 +37,9 @@ import org.onap.policy.controlloop.VirtualControlLoopEvent;
 import org.onap.policy.controlloop.actorserviceprovider.ActorService;
 import org.onap.policy.controlloop.actorserviceprovider.Operation;
 import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
+import org.onap.policy.controlloop.actorserviceprovider.TargetType;
 import org.onap.policy.controlloop.actorserviceprovider.Util;
 import org.onap.policy.controlloop.actorserviceprovider.controlloop.ControlLoopEventContext;
-import org.onap.policy.controlloop.policy.Target;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -54,6 +54,13 @@ import org.slf4j.LoggerFactory;
 public class ControlLoopOperationParams {
     private static final Logger logger = LoggerFactory.getLogger(ControlLoopOperationParams.class);
 
+    public static final String PARAMS_ENTITY_RESOURCEID = "resourceID";
+    public static final String PARAMS_ENTITY_MODEL_INVARIANT_ID = "modelInvariantId";
+    public static final String PARAMS_ENTITY_MODEL_VERSION_ID = "modelVersionId";
+    public static final String PARAMS_ENTITY_MODEL_NAME = "modelName";
+    public static final String PARAMS_ENTITY_MODEL_VERSION = "modelVersion";
+    public static final String PARAMS_ENTITY_MODEL_CUSTOMIZATION_ID = "modelCustomizationId";
+
     /**
      * Actor name.
      */
@@ -69,6 +76,7 @@ public class ControlLoopOperationParams {
     /**
      * Event for which the operation applies.
      */
+    // TODO to be removed
     private ControlLoopEventContext context;
 
     /**
@@ -106,15 +114,21 @@ public class ControlLoopOperationParams {
     private Integer retry;
 
     /**
-     * The entity's target information. May be {@code null}, depending on the requirement
-     * of the operation to be invoked.
+     * The Target Type information, extracted from the Policy. May be {@code null}, depending
+     * on the requirement of the operation to be invoked.
+     */
+    private TargetType targetType;
+
+    /**
+     * Target entitiy ids, extracted from the Policy. May be (@code null}, depending on
+     * the requirement of the operation to be invoked.
      */
-    private Target target;
+    private Map<String, String> targetEntityIds;
 
     /**
      * Target entity.
      */
-    @NotNull
+    // TODO to be removed
     private String targetEntity;
 
     /**
@@ -193,7 +207,19 @@ public class ControlLoopOperationParams {
      *
      * @return a new operation outcome
      */
+    // TODO to be removed
     public OperationOutcome makeOutcome() {
+        return makeOutcome(getTargetEntity());
+    }
+
+    /**
+     * Makes an operation outcome, populating it from the parameters.
+     *
+     * @param targetEntity the target entity
+     *
+     * @return a new operation outcome
+     */
+    public OperationOutcome makeOutcome(String targetEntity) {
         OperationOutcome outcome = new OperationOutcome();
         outcome.setActor(getActor());
         outcome.setOperation(getOperation());