summaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager/src/main/java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2018-08-10 18:16:21 -0400
committerJim Hahn <jrh3@att.com>2018-08-14 12:07:09 -0400
commit71aacf6cf96b35020937aefc799122ab695f2a31 (patch)
treef999168e8f5dd1dc7685bad0761529180de05930 /controlloop/common/eventmanager/src/main/java
parentb88421e9bc12e96894bd59950efc1312a3f15b7b (diff)
update AAI response classes per API
Several of the AAI response classes did not match the new AAI interface. Updated AaiGetVnfResponse and AaiGetVserverResponse and the classes they use to reflect the new API; other top-level classes were left untouched. Fix checkstyle errors. Change-Id: Ife5830c45ba8aece8d676a10f0fd8a9c9fe6cb66 Issue-ID: POLICY-964 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/common/eventmanager/src/main/java')
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java26
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)");
}
}