From 140980d872f84e854d636a21ca872b251b15891b Mon Sep 17 00:00:00 2001 From: Charles Cole Date: Fri, 20 Oct 2017 08:52:59 -0500 Subject: 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 --- .../policy/controlloop/eventmanager/ControlLoopEventManager.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'controlloop/common/eventmanager/src/main/java') 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"); } -- cgit 1.2.3-korg