summaryrefslogtreecommitdiffstats
path: root/controlloop/common/actors/actor.appc/src/main/java
diff options
context:
space:
mode:
authordaniel <dc443y@att.com>2017-09-12 09:44:59 -0500
committerdaniel <dc443y@att.com>2017-09-12 19:01:34 -0500
commitc226d61d3c1266f592fc3d785164aedb34a25ef6 (patch)
tree89516010b0d4dacfc5ae5d9a92352c670fad6771 /controlloop/common/actors/actor.appc/src/main/java
parente126a975d8c6f3970dbf87ead79fa69afe510301 (diff)
Fix A&AI Named Query for vFW
The vFW named query has now been verified with the A&AI simulator. Null checks were added to make the namedQuery method work properly. In addition, a recursive A&AI response parser was added to traverse the response to find the correct generic-vnf object with the target vnf-id. For now the simulator URL is hard coded and the UUID of the named query is hard coded. These should be configurable in future releases. Issue-ID: POLICY-104 Change-Id: I05a1a992ff68ca2c17fb6a578983e6b21626bf44 Signed-off-by: Daniel Cruz <dc443y@att.com>
Diffstat (limited to 'controlloop/common/actors/actor.appc/src/main/java')
-rw-r--r--controlloop/common/actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/APPCActorServiceProvider.java10
1 files changed, 9 insertions, 1 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 2d2992106..9e63e467b 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,6 +24,7 @@ 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.appc.CommonHeader;
import org.onap.policy.appc.Request;
import org.onap.policy.controlloop.ControlLoopOperation;
@@ -100,7 +101,14 @@ public class APPCActorServiceProvider implements Actor {
* specified in the yaml, the target vnf-id is retrieved by
* a named query to A&AI.
*/
- String vnfId = "test";
+ String vnfId;
+ if (onset.AAI.get("generic-vnf.vnf-id").equalsIgnoreCase(policy.getTarget().getResourceID())) {
+ vnfId = onset.AAI.get("generic-vnf.vnf-id");
+ }
+ else {
+ vnfId = AppcLcmActorServiceProvider.vnfNamedQuery(
+ policy.getTarget().getResourceID(), onset.AAI.get("generic-vnf.vnf-id"));
+ }
/*
* For now Policy generates the PG Streams as a demo, in the