diff options
author | 2018-08-15 15:20:09 +0000 | |
---|---|---|
committer | 2018-08-15 15:20:09 +0000 | |
commit | bfb9c07ce52db84ada4f851a5b8f0efdda0828b8 (patch) | |
tree | bee6b78bc88660c82e4227514a2ed92ac824ed58 /controlloop/common/eventmanager/src/main/java/org/onap | |
parent | 6f9976df27dccb2dcaedeb9106166f62a435b050 (diff) | |
parent | 71aacf6cf96b35020937aefc799122ab695f2a31 (diff) |
Merge "update AAI response classes per API"
Diffstat (limited to 'controlloop/common/eventmanager/src/main/java/org/onap')
-rw-r--r-- | controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java | 26 |
1 files changed, 13 insertions, 13 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 fa608ca08..2c1b6f628 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 @@ -26,11 +26,13 @@ import java.net.URLDecoder; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; +import java.util.List; import java.util.UUID; import org.onap.policy.aai.AaiGetVnfResponse; import org.onap.policy.aai.AaiGetVserverResponse; import org.onap.policy.aai.AaiManager; +import org.onap.policy.aai.AaiNqVServer; import org.onap.policy.aai.util.AaiException; import org.onap.policy.controlloop.ControlLoopEventStatus; import org.onap.policy.controlloop.ControlLoopException; @@ -708,12 +710,8 @@ public class ControlLoopEventManager implements LockCallback, Serializable { throw new AaiException("AAI Responded with a request error (query by " + queryTypeString + ")"); } - if (aaiResponse.getIsClosedLoopDisabled() != null) { - String value = aaiResponse.getIsClosedLoopDisabled(); - if ("true".equalsIgnoreCase(value) || "T".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value) - || "Y".equalsIgnoreCase(value)) { - throw new AaiException("is-closed-loop-disabled is set to true (query by " + queryTypeString + ")"); - } + if (aaiResponse.getIsClosedLoopDisabled()) { + throw new AaiException("is-closed-loop-disabled is set to true (query by " + queryTypeString + ")"); } } @@ -724,13 +722,15 @@ public class ControlLoopEventManager implements LockCallback, Serializable { if (aaiResponse.getRequestError() != null) { throw new AaiException("AAI responded with a request error (query by vserver-name)"); } - - if (aaiResponse.getIsClosedLoopDisabled() != null) { - String value = aaiResponse.getIsClosedLoopDisabled(); - if ("true".equalsIgnoreCase(value) || "T".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value) - || "Y".equalsIgnoreCase(value)) { - throw new AaiException("is-closed-loop-disabled is set to true (query by vserver-name)"); - } + + List<AaiNqVServer> lst = aaiResponse.getVserver(); + if(lst.isEmpty()) { + return; + } + + AaiNqVServer svr = lst.get(0); + if (svr.getIsClosedLoopDisabled()) { + throw new AaiException("is-closed-loop-disabled is set to true (query by vserver-name)"); } } |