X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcomponents%2FMicroServiceConfigPolicy.java;fp=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcomponents%2FMicroServiceConfigPolicy.java;h=b45d2941a67d33d7d51ab0a908651e7da512733a;hb=7f93aa65ce1612d1a321e50adf8c24b4e6f84d20;hp=0297f30c068a86db188289ae8ed4cac05520e928;hpb=af7f65b6cdc759e4968604e7fa9ff45562bdd8e2;p=policy%2Fengine.git diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/MicroServiceConfigPolicy.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/MicroServiceConfigPolicy.java index 0297f30c0..b45d2941a 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/MicroServiceConfigPolicy.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/MicroServiceConfigPolicy.java @@ -66,7 +66,15 @@ public class MicroServiceConfigPolicy extends Policy { private static final Logger LOGGER = FlexLogger.getLogger(MicroServiceConfigPolicy.class); private static Map mapAttribute = new HashMap<>(); - private static Map matchMap = new HashMap<>(); + private static Map mapMatch = new HashMap<>(); + + private static synchronized Map getMatchMap () { + return mapMatch; + } + + private static synchronized void setMatchMap(Map mm) { + mapMatch = mm; + } public MicroServiceConfigPolicy() { super(); @@ -176,9 +184,11 @@ public class MicroServiceConfigPolicy extends Policy { String jsonVersion = StringUtils.replaceEach(rootNode.get("version").toString(), new String[]{"\""}, new String[]{""}); matching = getValueFromDictionary(policyAdapter.getServiceType() + "-v" + jsonVersion); } - + + Map matchMap = null; if (matching != null && !matching.isEmpty()){ matchMap = Splitter.on(",").withKeyValueSeparator("=").split(matching); + setMatchMap(matchMap); if(policyAdapter.getJsonBody() != null){ pullMatchValue(rootNode); } @@ -422,7 +432,8 @@ public class MicroServiceConfigPolicy extends Policy { assignment7.setExpression(new ObjectFactory().createAttributeValue(configNameAttributeValue7)); advice.getAttributeAssignmentExpression().add(assignment7); - + + Map matchMap = getMatchMap(); if (matchMap==null || matchMap.isEmpty()){ AttributeAssignmentExpressionType assignment6 = new AttributeAssignmentExpressionType(); assignment6.setAttributeId("matching:" + CONFIGID);