diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/onap/clamp/clds/client/PolicyEngineServices.java | 13 | ||||
-rw-r--r-- | src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java | 4 |
2 files changed, 6 insertions, 11 deletions
diff --git a/src/main/java/org/onap/clamp/clds/client/PolicyEngineServices.java b/src/main/java/org/onap/clamp/clds/client/PolicyEngineServices.java index 44abc9dde..23586712a 100644 --- a/src/main/java/org/onap/clamp/clds/client/PolicyEngineServices.java +++ b/src/main/java/org/onap/clamp/clds/client/PolicyEngineServices.java @@ -27,12 +27,10 @@ import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.builder.ExchangeBuilder; @@ -118,15 +116,12 @@ public class PolicyEngineServices { return; } - List<LinkedHashMap<String, Object>> policyTypesList = (List<LinkedHashMap<String, Object>>) loadedYaml + LinkedHashMap<String, Object> policyTypesMap = (LinkedHashMap<String, Object>) loadedYaml .get("policy_types"); - policyTypesList.parallelStream().forEach(policyType -> { - Map.Entry<String, Object> policyTypeEntry = - (Map.Entry<String, Object>) new ArrayList(policyType.entrySet()).get(0); - + policyTypesMap.entrySet().parallelStream().forEach(entryPolicyType -> { policyModelsService.createPolicyInDbIfNeeded( - createPolicyModelFromPolicyEngine(policyTypeEntry.getKey(), - ((String) ((LinkedHashMap<String, Object>) policyTypeEntry.getValue()).get("version")))); + createPolicyModelFromPolicyEngine(entryPolicyType.getKey(), + ((String) ((LinkedHashMap<String, Object>) entryPolicyType.getValue()).get("version")))); }); } diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java index 47b3a4ff2..b3bd7e88a 100644 --- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java +++ b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java @@ -152,8 +152,8 @@ public class MicroServicePolicy extends Policy implements Serializable { @Override public void updateJsonRepresentation(ToscaConverterWithDictionarySupport toscaConverter) { - toscaConverter.convertToscaToJsonSchemaObject(this.getPolicyModel().getPolicyModelTosca(), - this.getPolicyModel().getPolicyModelType()); + this.setJsonRepresentation(toscaConverter.convertToscaToJsonSchemaObject(this.getPolicyModel().getPolicyModelTosca(), + this.getPolicyModel().getPolicyModelType())); } public Boolean getShared() { |