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%2Fcontroller%2FMicroServiceDictionaryController.java;h=566ac1447741f11356dc9c41aaf79e8a3b0e55a1;hb=HEAD;hp=dfd7af48d78dfa5ee9aee2ede9419354cf44da04;hpb=ad162645e845baae599383a227122bcfffb8d326;p=policy%2Fengine.git diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java index dfd7af48d..566ac1447 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java @@ -54,8 +54,8 @@ import org.onap.policy.rest.jpa.MicroServiceModels; import org.onap.policy.rest.jpa.MicroserviceHeaderdeFaults; import org.onap.policy.rest.jpa.PrefixList; import org.onap.policy.rest.jpa.UserInfo; -import org.onap.policy.rest.util.MSAttributeObject; -import org.onap.policy.rest.util.MSModelUtils; +import org.onap.policy.rest.util.MsAttributeObject; +import org.onap.policy.rest.util.MsModelUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; @@ -75,7 +75,7 @@ public class MicroServiceDictionaryController { private static String getDictionary = "getDictionary"; private static String errorMsg = "error"; private static String dictionaryDBQuery = "dictionaryDBQuery"; - private LinkedHashMap classMap; + private LinkedHashMap classMap; private List modelList = new ArrayList<>(); private static String dictionaryFields = "dictionaryFields"; private static String duplicateResponseString = "Duplicate"; @@ -109,7 +109,7 @@ public class MicroServiceDictionaryController { MicroServiceDictionaryController.commonClassDao = commonClassDao; } - MSModelUtils utils = new MSModelUtils(XACMLPapServlet.getMsOnapName(), XACMLPapServlet.getMsPolicyName()); + MsModelUtils utils = new MsModelUtils(XACMLPapServlet.getMsOnapName(), XACMLPapServlet.getMsPolicyName()); private MicroServiceModels newModel; @@ -650,15 +650,15 @@ public class MicroServiceDictionaryController { Set keys = jsonObject.keySet(); for (String key : keys) { String value = jsonObject.get(key).toString(); - MSAttributeObject msAttributeObject = mapper1.readValue(value, MSAttributeObject.class); + MsAttributeObject msAttributeObject = mapper1.readValue(value, MsAttributeObject.class); classMap.put(key, msAttributeObject); } userId = root.get("userid").textValue(); - MSAttributeObject mainClass = classMap.get(this.newModel.getModelName()); + MsAttributeObject mainClass = classMap.get(this.newModel.getModelName()); this.newModel.setDependency("[]"); String value = new Gson().toJson(mainClass.getSubClass()); - this.newModel.setSub_attributes(value); + this.newModel.setSubAttributes(value); String attributes = mainClass.getAttribute().toString().replace("{", "").replace("}", ""); int equalsIndexForAttributes = attributes.indexOf('='); String atttributesAfterFirstEquals = attributes.substring(equalsIndexForAttributes + 1); @@ -666,7 +666,7 @@ public class MicroServiceDictionaryController { String refAttributes = mainClass.getRefAttribute().toString().replace("{", "").replace("}", ""); int equalsIndex = refAttributes.indexOf("="); String refAttributesAfterFirstEquals = refAttributes.substring(equalsIndex + 1); - this.newModel.setRef_attributes(refAttributesAfterFirstEquals); + this.newModel.setRefAttributes(refAttributesAfterFirstEquals); this.newModel.setEnumValues(mainClass.getEnumType().toString().replace("{", "").replace("}", "")); this.newModel .setAnnotation(mainClass.getMatchingSet().toString().replace("{", "").replace("}", "")); @@ -703,7 +703,7 @@ public class MicroServiceDictionaryController { Set keys = jsonObject.keySet(); for (String key : keys) { String value = jsonObject.get(key).toString(); - MSAttributeObject msAttributeObject = mapper1.readValue(value, MSAttributeObject.class); + MsAttributeObject msAttributeObject = mapper1.readValue(value, MsAttributeObject.class); classMap.put(key, msAttributeObject); } } @@ -713,10 +713,10 @@ public class MicroServiceDictionaryController { } } microServiceModels.setAttributes(this.newModel.getAttributes()); - microServiceModels.setRef_attributes(this.newModel.getRef_attributes()); + microServiceModels.setRefAttributes(this.newModel.getRefAttributes()); microServiceModels.setDependency(this.newModel.getDependency()); microServiceModels.setModelName(this.newModel.getModelName()); - microServiceModels.setSub_attributes(this.newModel.getSub_attributes()); + microServiceModels.setSubAttributes(this.newModel.getSubAttributes()); microServiceModels.setVersion(this.newModel.getVersion()); microServiceModels.setEnumValues(this.newModel.getEnumValues()); microServiceModels.setAnnotation(this.newModel.getAnnotation()); @@ -769,11 +769,11 @@ public class MicroServiceDictionaryController { utils.removeData(request, response, microServiceModelsDictionaryDatas, MicroServiceModels.class); } - private void addValuesToNewModel(HashMap classMap) { + private void addValuesToNewModel(HashMap classMap) { // Loop through the classmap and pull out the required info for the new file. String subAttribute = null; - MSAttributeObject mainClass = classMap.get(this.newModel.getModelName()); + MsAttributeObject mainClass = classMap.get(this.newModel.getModelName()); if (mainClass != null) { String dependTemp = StringUtils.replaceEach(mainClass.getDependency(), new String[] {"[", "]", " "}, @@ -781,7 +781,7 @@ public class MicroServiceDictionaryController { ArrayList dependency = new ArrayList<>(Arrays.asList(dependTemp.split(","))); dependency = getFullDependencyList(dependency); for (String element : dependency) { - MSAttributeObject temp = classMap.get(element); + MsAttributeObject temp = classMap.get(element); if (temp != null) { mainClass.addAllRefAttribute(temp.getRefAttribute()); mainClass.addAllAttribute(temp.getAttribute()); @@ -798,9 +798,9 @@ public class MicroServiceDictionaryController { } if (mainClass != null) { this.newModel.setDependency(mainClass.getDependency()); - this.newModel.setSub_attributes(subAttribute); + this.newModel.setSubAttributes(subAttribute); this.newModel.setAttributes(mainClass.getAttribute().toString().replace("{", "").replace("}", "")); - this.newModel.setRef_attributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", "")); + this.newModel.setRefAttributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", "")); this.newModel.setEnumValues(mainClass.getEnumType().toString().replace("{", "").replace("}", "")); this.newModel.setAnnotation(mainClass.getMatchingSet().toString().replace("{", "").replace("}", "")); } @@ -812,7 +812,7 @@ public class MicroServiceDictionaryController { returnList.addAll(dependency); for (String element : dependency) { if (classMap.containsKey(element)) { - MSAttributeObject value = classMap.get(element); + MsAttributeObject value = classMap.get(element); String rawValue = StringUtils.replaceEach(value.getDependency(), new String[] {"[", "]"}, new String[] {"", ""}); workingList = new ArrayList<>(Arrays.asList(rawValue.split(",")));