Use actor constants instead of literals 33/108633/2
authorJim Hahn <jrh3@att.com>
Mon, 1 Jun 2020 16:32:10 +0000 (12:32 -0400)
committerJim Hahn <jrh3@att.com>
Mon, 1 Jun 2020 16:36:56 +0000 (12:36 -0400)
Modified drools-apps to use constants from the actor classes instead
of hard-coded literals.  Only made this change in code that uses the
new actor model, as the old code will be deleted during this release.

Issue-ID: POLICY-1242
Change-Id: Iac718159fd7cf571a48ac620585bf2b8f94c1e5d
Signed-off-by: Jim Hahn <jrh3@att.com>
controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager2.java

index 2d5ff39..5141b71 100644 (file)
@@ -43,6 +43,8 @@ import org.onap.policy.aai.AaiCqResponse;
 import org.onap.policy.controlloop.ControlLoopOperation;
 import org.onap.policy.controlloop.ControlLoopResponse;
 import org.onap.policy.controlloop.VirtualControlLoopEvent;
+import org.onap.policy.controlloop.actor.guard.GuardActorServiceProvider;
+import org.onap.policy.controlloop.actor.sdnr.SdnrActorServiceProvider;
 import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
 import org.onap.policy.controlloop.actorserviceprovider.controlloop.ControlLoopEventContext;
 import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
@@ -65,7 +67,7 @@ public class ControlLoopOperationManager2 implements Serializable {
     private static final String CL_TIMEOUT_ACTOR = "-CL-TIMEOUT-";
     public static final String LOCK_ACTOR = "LOCK";
     public static final String LOCK_OPERATION = "Lock";
-    private static final String GUARD_ACTOR = "GUARD";
+    private static final String GUARD_ACTOR = GuardActorServiceProvider.NAME;
     public static final String VSERVER_VSERVER_NAME = "vserver.vserver-name";
     public static final String GENERIC_VNF_VNF_NAME = "generic-vnf.vnf-name";
     public static final String GENERIC_VNF_VNF_ID = "generic-vnf.vnf-id";
@@ -572,7 +574,7 @@ public class ControlLoopOperationManager2 implements Serializable {
     protected ControlLoopResponse makeControlLoopResponse(OperationOutcome outcome) {
 
         // only generate response for certain actors.
-        if (outcome == null || !actor.equals("SDNR")) {
+        if (outcome == null || !actor.equals(SdnrActorServiceProvider.NAME)) {
             return null;
         }