diff options
author | daniel <dc443y@att.com> | 2017-11-03 10:39:23 -0500 |
---|---|---|
committer | daniel <dc443y@att.com> | 2017-11-03 10:45:07 -0500 |
commit | 1772b3793ef4e46f30290480d5b911c2f04e8c3d (patch) | |
tree | 6df5518bef78aea74d70801fd253061628346dad /controlloop/common | |
parent | ada3bb2cc99f741504476c7f43cc20f8dacf23e3 (diff) |
Fix Generic VNF isClosedLoopDisabled
No A&AI queries will be done for enriched events.
The event manager now understands prepended "generic-vnf."
in front of is-closed-loop-disabled from DCAE onsets.
A test case was revised to include sample data from an
enriched onset with vnf data based on the VES documentation.
Issue-Id: POLICY-350
Change-Id: Id7f59f8b860b9f147087067a2a9a7766f167f7e4
Signed-off-by: Daniel Cruz <dc443y@att.com>
Diffstat (limited to 'controlloop/common')
2 files changed, 17 insertions, 2 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 b1674206b..4adcff048 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 @@ -560,7 +560,8 @@ public class ControlLoopEventManager implements LockCallback, Serializable { } public void queryAai(VirtualControlLoopEvent event) throws AAIException { - if (event.AAI.get("vserver.is-closed-loop-disabled") == null) { + if (event.AAI.get("vserver.is-closed-loop-disabled") == null && + event.AAI.get("generic-vnf.is-closed-loop-disabled") == null) { try { if (event.AAI.get("generic-vnf.vnf-id") != null) { vnfResponse = getAAIVnfInfo(event); @@ -635,7 +636,13 @@ public class ControlLoopEventManager implements LockCallback, Serializable { "yes".equalsIgnoreCase(event.AAI.get("vserver.is-closed-loop-disabled")) || "Y".equalsIgnoreCase(event.AAI.get("vserver.is-closed-loop-disabled"))) { return true; - } + } + else if ("true".equalsIgnoreCase(event.AAI.get("generic-vnf.is-closed-loop-disabled")) || + "T".equalsIgnoreCase(event.AAI.get("generic-vnf.is-closed-loop-disabled")) || + "yes".equalsIgnoreCase(event.AAI.get("generic-vnf.is-closed-loop-disabled")) || + "Y".equalsIgnoreCase(event.AAI.get("generic-vnf.is-closed-loop-disabled"))) { + return true; + } return false; } diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java index cebdc1e9a..26a82fe57 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java @@ -145,6 +145,14 @@ public class ControlLoopOperationManager implements Serializable { } else if (this.onset.target.equalsIgnoreCase("generic-vnf.vnf-name")) { /* + * If the onset is enriched with the vnf-id, + * we don't need an A&AI response + */ + if (virtualOnset.AAI.containsKey("generic-vnf.vnf-id")) { + return virtualOnset.AAI.get("generic-vnf.vnf-id"); + } + + /* * If the vnf-name was retrieved from the onset then the vnf-id * must be obtained from the event manager's A&AI GET query */ |