From 83ad920bb05c4f02d1ae2ee5b2196785d2eb61a3 Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Tue, 1 Sep 2020 16:38:15 -0400 Subject: 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 Signed-off-by: Jim Hahn Signed-off-by: Pamela Dragosh --- .../main/java/org/onap/policy/aai/AaiCqResponse.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'models-interactions/model-impl') 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 @@ -382,6 +382,24 @@ public class AaiCqResponse implements Serializable { return null; } + /** + * Returns the VNF given the vnf-id. + * + * @param vnfId The vnf-id + * @return generic Vnf + */ + public GenericVnf getGenericVnfByVnfId(String vnfId) { + List 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. * -- cgit 1.2.3-korg