diff options
author | 2017-10-16 12:05:08 -0500 | |
---|---|---|
committer | 2017-10-18 11:03:38 -0500 | |
commit | 506267bf7e9d961f1a6b2a989ee8a23ca67b9d61 (patch) | |
tree | 7f9079c2a19bb5d01bf4f8a7ab84b7168d9a1cb9 /controlloop/common/actors/actor.appc/src/main/java | |
parent | b2d602aaedfcc9356e07dd94b6baec70c38815b8 (diff) |
Add support for AAI Named Query error handling
Errors from AAI after a Named query now throw an AAIEXception. This is
caught in the template to allow the resources to be removed from memory
and a final failure to be thrown.
Issue-ID: POLICY-314
Change-Id: I319d29ef537b2d01ca288622aac1d9dbbe05f5eb
Signed-off-by: Charles Cole <cc847m@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.java | 9 |
1 files changed, 8 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 75810c01e..6ae62bbcd 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 @@ -25,6 +25,7 @@ import java.util.List; import org.onap.policy.controlloop.VirtualControlLoopEvent; import org.onap.policy.controlloop.actor.appclcm.AppcLcmActorServiceProvider; +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; @@ -33,6 +34,7 @@ import org.onap.policy.vnf.trafficgenerator.PGRequest; import org.onap.policy.vnf.trafficgenerator.PGStream; import org.onap.policy.vnf.trafficgenerator.PGStreams; import org.onap.policy.controlloop.actorServiceProvider.spi.Actor; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -85,8 +87,9 @@ public class APPCActorServiceProvider implements Actor { * the policy the was specified from the yaml generated * by CLAMP or through the Policy GUI/API * @return an APPC request conforming to the legacy API + * @throws AAIException */ - public static Request constructRequest(VirtualControlLoopEvent onset, ControlLoopOperation operation, Policy policy) { + public static Request constructRequest(VirtualControlLoopEvent onset, ControlLoopOperation operation, Policy policy) throws AAIException { /* * Construct an APPC request */ @@ -111,6 +114,10 @@ public class APPCActorServiceProvider implements Actor { policy.getTarget().getResourceID(), onset.AAI.get("generic-vnf.vnf-id")); } + if (vnfId == null) { + throw new AAIException("No vnf id found"); + } + /* * For now Policy generates the PG Streams as a demo, in the * future the payload can be provided by CLAMP |