summaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager/src
diff options
context:
space:
mode:
authorCharles Cole <cc847m@att.com>2017-10-20 08:52:59 -0500
committerCharles Cole <cc847m@att.com>2017-10-23 11:16:59 -0500
commit140980d872f84e854d636a21ca872b251b15891b (patch)
tree160fa25a01657b2fd32c984dbe4ae4b0f106a12b /controlloop/common/eventmanager/src
parent2f1ee658482437e0c5b45451d20468411e2e2b6a (diff)
Fix handling of aai 'get' errors
Now reject an event if the AAI get query for the event fails. Added test cases for this behavior. Fixed some issues from my previous pull request. Issue-Id: POLICY-314 Change-Id: I674e95302a271423c307a88d061064e12e491a7a Signed-off-by: Charles Cole <cc847m@att.com>
Diffstat (limited to 'controlloop/common/eventmanager/src')
-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 2fc43a01c..9b2960e42 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,6 +545,9 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
if (vnfResponse == null) {
throw new ControlLoopException("AAI Response is null (query by vnf-id)");
}
+ if (vnfResponse.requestError != null) {
+ throw new ControlLoopException("AAI Responded with a request error (query by vnf-id)");
+ }
if (isClosedLoopDisabled(vnfResponse) == true) {
throw new ControlLoopException("is-closed-loop-disabled is set to true");
}
@@ -553,6 +556,9 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
if (vnfResponse == null) {
throw new ControlLoopException("AAI Response is null (query by vnf-name)");
}
+ if (vnfResponse.requestError != null) {
+ throw new ControlLoopException("AAI Responded with a request error (query by vnf-name)");
+ }
if (isClosedLoopDisabled(vnfResponse) == true) {
throw new ControlLoopException("is-closed-loop-disabled is set to true");
}
@@ -561,6 +567,9 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
if (vserverResponse == null) {
throw new ControlLoopException("AAI Response is null (query by vserver-name)");
}
+ if (vserverResponse.requestError != null) {
+ throw new ControlLoopException("AAI responded with a request error (query by vserver-name)");
+ }
if (isClosedLoopDisabled(vserverResponse) == true) {
throw new ControlLoopException("is-closed-loop-disabled is set to true");
}