From 2e7e531a8d80178410a1c4e78e62443c9d9a7684 Mon Sep 17 00:00:00 2001 From: "lalena.aria" Date: Tue, 8 Oct 2019 20:57:16 +0000 Subject: UEB Listener SdncBaseModel add extractValue for CapabilityAssignment Changes made: Add UEB Listener SdncBaseModel add extractValue for extracting properties on CapabilityAssignment objects. Issue-ID: CCSDK-1820 Change-Id: I10bbced5e9279bc8ef2bf48a87b2e2de0cb74942 Signed-off-by: lalena.aria --- ueb-listener/pom.xml | 2 +- .../ccsdk/sli/northbound/uebclient/SdncBaseModel.java | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'ueb-listener') diff --git a/ueb-listener/pom.xml b/ueb-listener/pom.xml index 00d7ead93..9e7e41691 100755 --- a/ueb-listener/pom.xml +++ b/ueb-listener/pom.xml @@ -22,7 +22,7 @@ yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} - 0.6.1-SNAPSHOT + 0.7.0-SNAPSHOT ${project.version} diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java index d3fef173f..7ab431dac 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java @@ -794,6 +794,23 @@ public class SdncBaseModel { } } + protected String extractValue (CapabilityAssignment capability, String path, String name) { + String value = ""; + + if (capability.getProperties().containsKey(path)) { + Property property = capability.getProperties().get(path); + if (property != null && !property.getLeafPropertyValue(name).isEmpty()) { + value = property.getLeafPropertyValue(name).get(0); + } + } + + if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) { + return value; + } else { + return ""; + } + } + protected String extractBooleanValue (NodeTemplate nodeTemplate, String name) { String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); if (value != null && !value.isEmpty()) { -- cgit 1.2.3-korg