diff options
author | daniel <dc443y@att.com> | 2017-10-24 22:00:08 -0500 |
---|---|---|
committer | daniel <dc443y@att.com> | 2017-10-25 09:29:41 -0500 |
commit | 85b1ada7cc0883aa8b86ea6e11bf86719e1cc10e (patch) | |
tree | 86f4712aa717e1fa5e510c345f887b3e0c11f6c8 /controlloop/common/actors/actor.appc/src/main | |
parent | 7e3ace91847ec5aaccfeeff638a8d2d9b17e45fc (diff) |
Fix Source/Target Lock
The locking of the target is now taken care of when
the operation manager is initialized. This allows us
to keep the template flow the same and to ensure that
for vFW we will not lock the source if it is not intended
to be the target. NOTE: This will have to be revised in
the future if policy chaining will support having
different targets specified for each policy in the chain.
Additional work was done for hardening the APPC model code
to make sure exceptions are caught and we gracefully end
processing the event with memory clean up and a final failure
notification sent.
Issue-Id: POLICY-367
Change-Id: Ic796d95eb5400067744492f810dd8069ba6241b3
Signed-off-by: Daniel Cruz <dc443y@att.com>
Signed-off-by: daniel <dc443y@att.com>
Diffstat (limited to 'controlloop/common/actors/actor.appc/src/main')
-rw-r--r-- | controlloop/common/actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/APPCActorServiceProvider.java | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/controlloop/common/actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/APPCActorServiceProvider.java b/controlloop/common/actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/APPCActorServiceProvider.java index 44411ca72..d525c4c85 100644 --- a/controlloop/common/actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/APPCActorServiceProvider.java +++ b/controlloop/common/actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/APPCActorServiceProvider.java @@ -24,9 +24,6 @@ import java.util.Collections; import java.util.List; import org.onap.policy.controlloop.VirtualControlLoopEvent; -import org.onap.policy.controlloop.actor.appclcm.AppcLcmActorServiceProvider; -import org.onap.policy.aai.AAIGETVnfResponse; -import org.onap.policy.aai.util.AAIException; import org.onap.policy.appc.CommonHeader; import org.onap.policy.appc.Request; import org.onap.policy.controlloop.ControlLoopOperation; @@ -91,7 +88,7 @@ public class APPCActorServiceProvider implements Actor { * @throws AAIException */ public static Request constructRequest(VirtualControlLoopEvent onset, ControlLoopOperation operation, - Policy policy, AAIGETVnfResponse vnfResponse) throws AAIException { + Policy policy, String targetVnf) { /* * Construct an APPC request */ @@ -101,24 +98,6 @@ public class APPCActorServiceProvider implements Actor { request.CommonHeader.SubRequestID = operation.subRequestId; request.Action = policy.getRecipe().substring(0, 1).toUpperCase() + policy.getRecipe().substring(1); - - /* - * The target vnf-id may not be the same as the source vnf-id - * specified in the yaml, the target vnf-id is retrieved by - * a named query to A&AI. - */ - String sourceVnf = onset.AAI.get("generic-vnf.vnf-id"); - if (sourceVnf == null) { - /* - * Lets see if the vnf-name is provided - */ - sourceVnf = vnfResponse.vnfID; - if (sourceVnf == null) { - throw new AAIException("No vnf-id found"); - } - } - String targetVnf = AppcLcmActorServiceProvider.vnfNamedQuery( - policy.getTarget().getResourceID(), sourceVnf); /* * For now Policy generates the PG Streams as a demo, in the |