summaryrefslogtreecommitdiffstats
path: root/blueprints-processor/plugin/assignment-provider
diff options
context:
space:
mode:
Diffstat (limited to 'blueprints-processor/plugin/assignment-provider')
-rw-r--r--blueprints-processor/plugin/assignment-provider/src/main/java/org/onap/ccsdk/features/assignment/service/ConfigAssignmentUtils.java16
-rw-r--r--blueprints-processor/plugin/assignment-provider/src/main/java/org/onap/ccsdk/features/assignment/service/ResourceDictionaryService.java8
2 files changed, 9 insertions, 15 deletions
diff --git a/blueprints-processor/plugin/assignment-provider/src/main/java/org/onap/ccsdk/features/assignment/service/ConfigAssignmentUtils.java b/blueprints-processor/plugin/assignment-provider/src/main/java/org/onap/ccsdk/features/assignment/service/ConfigAssignmentUtils.java
index 1d7df6b58..15221ae64 100644
--- a/blueprints-processor/plugin/assignment-provider/src/main/java/org/onap/ccsdk/features/assignment/service/ConfigAssignmentUtils.java
+++ b/blueprints-processor/plugin/assignment-provider/src/main/java/org/onap/ccsdk/features/assignment/service/ConfigAssignmentUtils.java
@@ -56,14 +56,10 @@ public class ConfigAssignmentUtils {
public static synchronized Object getContextKeyValue(SvcLogicContext context, String key) {
Object value = null;
- if (context != null && key != null) {
- if (context.getAttributeKeySet().contains(key)) {
- String strValue = context.getAttribute(key);
- if (StringUtils.isNotBlank(strValue)) {
- value = strValue;
- }
- } else {
- // Do Nothing
+ if (context != null && key != null && context.getAttributeKeySet().contains(key)) {
+ String strValue = context.getAttribute(key);
+ if (StringUtils.isNotBlank(strValue)) {
+ value = strValue;
}
}
return value;
@@ -135,9 +131,9 @@ public class ConfigAssignmentUtils {
ResourceDefinition resourceDefinition = null;
if (dictionaries != null && StringUtils.isNotBlank(dictionaryName)) {
ResourceDictionary resourceDictionary = dictionaries.get(dictionaryName);
- if (resourceDictionary != null && StringUtils.isNotBlank(resourceDictionary.getDefinition())) {
+ if (resourceDictionary != null && resourceDictionary.getDefinition() != null) {
resourceDefinition =
- TransformationUtils.readValue(resourceDictionary.getDefinition(), ResourceDefinition.class);
+ TransformationUtils.treeToValue(resourceDictionary.getDefinition(), ResourceDefinition.class);
}
}
return resourceDefinition;
diff --git a/blueprints-processor/plugin/assignment-provider/src/main/java/org/onap/ccsdk/features/assignment/service/ResourceDictionaryService.java b/blueprints-processor/plugin/assignment-provider/src/main/java/org/onap/ccsdk/features/assignment/service/ResourceDictionaryService.java
index ec586f493..d8692c4c7 100644
--- a/blueprints-processor/plugin/assignment-provider/src/main/java/org/onap/ccsdk/features/assignment/service/ResourceDictionaryService.java
+++ b/blueprints-processor/plugin/assignment-provider/src/main/java/org/onap/ccsdk/features/assignment/service/ResourceDictionaryService.java
@@ -51,11 +51,9 @@ public class ResourceDictionaryService {
List<String> names = new ArrayList<>();
for (ResourceAssignment resourceAssignment : resourceAssignments) {
if (resourceAssignment != null && StringUtils.isNotBlank(resourceAssignment.getDictionaryName())) {
-
if (!names.contains(resourceAssignment.getDictionaryName())) {
names.add(resourceAssignment.getDictionaryName());
}
-
if (resourceAssignment.getDependencies() != null
&& !resourceAssignment.getDependencies().isEmpty()) {
List<String> dependencieNames = resourceAssignment.getDependencies();
@@ -83,7 +81,7 @@ public class ResourceDictionaryService {
if (!names.isEmpty()) {
String dictionaryContents = configRestAdaptorService.postResource(
- ConfigRestAdaptorConstants.SELECTOR_MODEL_SERVICE, "dictionarybynames", names, String.class);
+ ConfigRestAdaptorConstants.SELECTOR_MODEL_SERVICE, "dictionary/by-names", names, String.class);
if (StringUtils.isNotBlank(dictionaryContents)) {
List<ResourceDictionary> dataDictionaries =
@@ -91,9 +89,9 @@ public class ResourceDictionaryService {
if (dataDictionaries != null) {
for (ResourceDictionary dataDictionary : dataDictionaries) {
if (dataDictionary != null && StringUtils.isNotBlank(dataDictionary.getName())
- && StringUtils.isNotBlank(dataDictionary.getDefinition())) {
+ && dataDictionary.getDefinition() != null) {
ResourceDefinition resourceDefinition = TransformationUtils
- .readValue(dataDictionary.getDefinition(), ResourceDefinition.class);
+ .treeToValue(dataDictionary.getDefinition(), ResourceDefinition.class);
if (resourceDefinition != null && StringUtils.isNotBlank(resourceDefinition.getName())) {
dictionaries.put(resourceDefinition.getName(), resourceDefinition);
} else {