summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dt5972@att.com>2018-03-28 15:03:52 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-28 15:03:52 +0000
commitaa4a295680e3fef78ae695ff41bcf5015efffa16 (patch)
tree70157455e53730adafc655211e168904e460850d
parenta0ab49e6c1ea41af18656d6e9efb3377051f2528 (diff)
parent8550176e6fd49c28cf9d9a5c79cc363eb91e6335 (diff)
Merge "Simplify enumeration handling"
-rw-r--r--sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java
index 76101514..b652c433 100644
--- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java
+++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java
@@ -56,6 +56,7 @@ public class MdsalHelper {
setYangMappingProperties(input);
}
+ @Deprecated
public static void setYangMappingProperties(Properties properties) {
for (Object propNameObj : properties.keySet()) {
String propName = (String) propNameObj;
@@ -63,6 +64,7 @@ public class MdsalHelper {
}
}
+ @Deprecated
public static void loadProperties(String propertiesFile) {
File file = new File(propertiesFile);
Properties properties = new Properties();
@@ -186,8 +188,9 @@ public class MdsalHelper {
}
if (retValue != null) {
String propName = propNamePfx + "." + fieldName;
- propVal = retValue.toString();
- props.setProperty(propName, mapEnumeratedValue(fieldName, propVal));
+ Method method = retValue.getClass().getMethod("getName");
+ String yangValue = (String) method.invoke(retValue);
+ props.setProperty(propName, yangValue);
}
} catch (Exception e) {
LOG.error(
@@ -1333,11 +1336,13 @@ public class MdsalHelper {
return (false);
}
+ @Deprecated
public static String getFullPropertiesPath(String propertiesFileName) {
return "/opt/bvc/controller/configuration/" + propertiesFileName;
}
// This is called when mapping a valid java enumeration back to the yang model value
+ @Deprecated
public static String mapEnumeratedValue(String propertyName, String propertyValue) {
LOG.info("mapEnumeratedValue called with propertyName=" + propertyName + " and value=" + propertyValue);
String mappingKey = "yang." + propertyName + "." + propertyValue;