diff options
Diffstat (limited to 'ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java')
-rw-r--r-- | ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncBaseModel.java | 75 |
1 files changed, 75 insertions, 0 deletions
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 a5de97fc..24591125 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 @@ -706,6 +706,65 @@ public class SdncBaseModel { } } + protected String extractValue (IEntityDetails entityDetails, String path, String name) { + String value = null; + + if (entityDetails.getProperties().containsKey(path)) { + Property property = entityDetails.getProperties().get(path); + if (property != null && property.getLeafPropertyValue(name) != null) { + value = property.getLeafPropertyValue(name).get(0); + } + } + + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractValue (Property property, String name) { + String value = null; + + if (!property.getLeafPropertyValue(name).isEmpty()) { + value = property.getLeafPropertyValue(name).get(0); + } + + if (value != null) { + return value; + } else { + return ""; + } + } + + protected String extractBooleanValue (Property property, String name) { + String value = null; + + if (!property.getLeafPropertyValue(name).isEmpty()) { + value = property.getLeafPropertyValue(name).get(0); + } + + if (value != null) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + + protected String extractIntegerValue (Property property, String name) { + String value = null; + + if (!property.getLeafPropertyValue(name).isEmpty()) { + value = property.getLeafPropertyValue(name).get(0); + } + + if (value != null && !value.isEmpty() && !value.contains("null")) { + return value; + } else { + return ""; + } + } + protected String extractGetInputValue (Group group, NodeTemplate nodeTemplate, String name) { String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, extractGetInputName (group, name)); @@ -821,6 +880,22 @@ public class SdncBaseModel { } } + protected String extractBooleanValue (IEntityDetails entityDetails, String path, String name) { + String value = null; + if (entityDetails.getProperties().containsKey(path)) { + Property property = entityDetails.getProperties().get(path); + if (property != null && property.getLeafPropertyValue(name) != null) { + value = property.getLeafPropertyValue(name).get(0); + } + } + + if (value != null && !value.isEmpty()) { + return value.contains("true") ? "Y" : "N"; + } else { + return ""; + } + } + public static String extractBooleanValue (ISdcCsarHelper sdcCsarHelper, NodeTemplate nodeTemplate, String name) { String value = sdcCsarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, name); if (value != null && !value.isEmpty()) { |