summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-impl/aai
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2020-09-01 16:38:15 -0400
committerPamela Dragosh <pdragosh@research.att.com>2020-09-02 07:27:22 -0400
commit83ad920bb05c4f02d1ae2ee5b2196785d2eb61a3 (patch)
tree7fd34662bf8b74f37a20c8005423e2dc9d4c8fff /models-interactions/model-impl/aai
parent64591b51d4da3900f37f53701b2ffef4a38778e9 (diff)
Add new method to retrieve vnf-id
For guard filters, once the vnf-id is found. Then this convenience method helps to retrieve the correct vnf information. Issue-ID: POLICY-2590 Change-Id: I0b55b15582ddc58bbc5b2c0c2c2b130f3cdc88c3 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com> Signed-off-by: Jim Hahn <jrh3@att.com> Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'models-interactions/model-impl/aai')
-rw-r--r--models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java
index 1b18e439c..2648959bb 100644
--- a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java
+++ b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java
@@ -383,6 +383,24 @@ public class AaiCqResponse implements Serializable {
}
/**
+ * Returns the VNF given the vnf-id.
+ *
+ * @param vnfId The vnf-id
+ * @return generic Vnf
+ */
+ public GenericVnf getGenericVnfByVnfId(String vnfId) {
+ List<GenericVnf> genericVnfList = this.getGenericVnfs();
+
+ for (GenericVnf genVnf : genericVnfList) {
+ if (vnfId.equals(genVnf.getVnfId())) {
+ return genVnf;
+ }
+ }
+
+ return null;
+ }
+
+ /**
* Get the generic vnf associated with the vserver in the custom query.
*
* @return Generic VNF