summaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager
diff options
context:
space:
mode:
authorJoseph Chou <jc2555@att.com>2017-09-13 17:15:49 -0400
committerJoseph Chou <jc2555@att.com>2017-09-15 14:33:03 -0400
commitc30cfc0ffdf14e0ebc034817cadf7924531b618f (patch)
tree7afe3fd0c40c5a90904b9889e9dbe930e20609b8 /controlloop/common/eventmanager
parentbc4267d043427c080b1cc1fe42ea0860bed9fa97 (diff)
ONAP AAI GET Query code
Update ControlLoopEventManager to raise exception on null AAI response Issue-ID: POLICY-103 Change-Id: Iebe8b03269a1801c4293600920aa267490cea1af Signed-off-by: Joseph Chou <jc2555@att.com>
Diffstat (limited to 'controlloop/common/eventmanager')
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java
index 2248fcd48..c2846f86d 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java
@@ -545,16 +545,25 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
try {
if (event.AAI.get("generic-vnf.vnf-id") != null) {
vnfResponse = getAAIVnfInfo(event);
+ if (vnfResponse == null) {
+ throw new ControlLoopException("AAI Response is null (query by vnf-id)");
+ }
if (vnfResponse != null && isClosedLoopDisabled(vnfResponse) == true) {
throw new ControlLoopException("is-closed-loop-disabled is set to true");
}
} else if (event.AAI.get("generic-vnf.vnf-name") != null) {
vnfResponse = getAAIVnfInfo(event);
+ if (vnfResponse == null) {
+ throw new ControlLoopException("AAI Response is null (query by vnf-name)");
+ }
if (vnfResponse != null && isClosedLoopDisabled(vnfResponse) == true) {
throw new ControlLoopException("is-closed-loop-disabled is set to true");
}
} else if (event.AAI.get("vserver.vserver-name") != null) {
vserverResponse = getAAIVserverInfo(event);
+ if (vserverResponse == null) {
+ throw new ControlLoopException("AAI Response is null (query by vserver-name)");
+ }
if (vserverResponse != null && isClosedLoopDisabled(vserverResponse) == true) {
throw new ControlLoopException("is-closed-loop-disabled is set to true");
}