X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcomponents%2FCreateNewMicroServiceModel.java;h=e18628dff5fd07009fcb579cb36676123fe49c68;hb=779125e31adbcc59a9864843b523bd6ed2751cbb;hp=573f274f2b68727dfc7a1714a2fa1d3f262498c6;hpb=5a5842e77e4e0f0b6207192b374d99753db26c7e;p=policy%2Fengine.git diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java index 573f274f2..e18628dff 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java @@ -49,16 +49,16 @@ import org.onap.policy.pap.xacml.rest.XACMLPapServlet; import org.onap.policy.pap.xacml.rest.daoimpl.CommonClassDaoImpl; import org.onap.policy.rest.jpa.MicroServiceModels; 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.MSModelUtils.MODEL_TYPE; +import org.onap.policy.rest.util.MsAttributeObject; +import org.onap.policy.rest.util.MsModelUtils; +import org.onap.policy.rest.util.MsModelUtils.ModelType; public class CreateNewMicroServiceModel { private static final Logger logger = FlexLogger.getLogger(CreateNewMicroServiceModel.class); private MicroServiceModels newModel = null; - private HashMap classMap = new HashMap<>(); + private HashMap classMap = new HashMap<>(); - private MSModelUtils utils = new MSModelUtils(XACMLPapServlet.getMsOnapName(), XACMLPapServlet.getMsPolicyName()); + private MsModelUtils utils = new MsModelUtils(XACMLPapServlet.getMsOnapName(), XACMLPapServlet.getMsPolicyName()); public CreateNewMicroServiceModel(String fileName, String serviceName, String string, String version) { super(); @@ -84,7 +84,7 @@ public class CreateNewMicroServiceModel { this.newModel.setUserCreatedBy(userInfo); String cleanUpFile = null; - Map tempMap = new HashMap<>(); + Map tempMap = new HashMap<>(); // Need to delete the file if (importFile.contains(".zip")) { extractFolder(randomID + ".zip"); @@ -100,7 +100,7 @@ public class CreateNewMicroServiceModel { cleanUpFile = "ExtractDir" + File.separator + randomID + ".yml"; } else { - tempMap = utils.processEpackage("ExtractDir" + File.separator + randomID + ".xmi", MODEL_TYPE.XMI); + tempMap = utils.processEpackage("ExtractDir" + File.separator + randomID + ".xmi", ModelType.XMI); classMap.putAll(tempMap); cleanUpFile = "ExtractDir" + File.separator + randomID + ".xmi"; } @@ -111,7 +111,7 @@ public class CreateNewMicroServiceModel { } private void processFiles(String modelName, List fileList) { - Map tempMap; + Map tempMap; for (File file : fileList) { if (file.isFile()) { int indx = file.getName().lastIndexOf('.'); @@ -123,7 +123,7 @@ public class CreateNewMicroServiceModel { } else { - tempMap = utils.processEpackage(file.getAbsolutePath(), MODEL_TYPE.XMI); + tempMap = utils.processEpackage(file.getAbsolutePath(), ModelType.XMI); classMap.putAll(tempMap); } } @@ -149,7 +149,7 @@ public class CreateNewMicroServiceModel { utils.parseTosca(fileName); - MSAttributeObject msAttributes = new MSAttributeObject(); + MsAttributeObject msAttributes = new MsAttributeObject(); msAttributes.setClassName(modelName); LinkedHashMap returnAttributeList = new LinkedHashMap<>(); @@ -256,7 +256,7 @@ public class CreateNewMicroServiceModel { public Map addValuesToNewModel(String type) { Map successMap = new HashMap<>(); - MSAttributeObject mainClass = null; + MsAttributeObject mainClass = null; List dependency = null; String subAttribute = null; @@ -275,7 +275,7 @@ public class CreateNewMicroServiceModel { newModel.setDependency("[]"); if (mainClass.getSubClass() != null) { String value = new Gson().toJson(mainClass.getSubClass()); - newModel.setSub_attributes(value); + newModel.setSubAttributes(value); } if (mainClass.getAttribute() != null) { @@ -289,7 +289,7 @@ public class CreateNewMicroServiceModel { 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); } if (mainClass.getEnumType() != null) { @@ -317,7 +317,7 @@ public class CreateNewMicroServiceModel { dependency = utils.getFullDependencyList(dependency, classMap); if (!dependency.isEmpty()) { for (String element : dependency) { - MSAttributeObject temp = new MSAttributeObject(); + MsAttributeObject temp = new MsAttributeObject(); if (classMap.containsKey(element)) { temp = classMap.get(element); mainClass.addAllRefAttribute(temp.getRefAttribute()); @@ -328,14 +328,14 @@ public class CreateNewMicroServiceModel { } subAttribute = utils.createSubAttributes(dependency, classMap, this.newModel.getModelName()); - this.newModel.setSub_attributes(subAttribute); + this.newModel.setSubAttributes(subAttribute); if (mainClass.getAttribute() != null && !mainClass.getAttribute().isEmpty()) { this.newModel.setAttributes(mainClass.getAttribute().toString().replace("{", "").replace("}", "")); } if (mainClass.getRefAttribute() != null && !mainClass.getRefAttribute().isEmpty()) { this.newModel - .setRef_attributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", "")); + .setRefAttributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", "")); } if (mainClass.getEnumType() != null && !mainClass.getEnumType().isEmpty()) { @@ -368,8 +368,8 @@ public class CreateNewMicroServiceModel { model.setDependency(this.newModel.getDependency()); model.setDescription(this.newModel.getDescription()); model.setEnumValues(this.newModel.getEnumValues()); - model.setRef_attributes(this.newModel.getRef_attributes()); - model.setSub_attributes(this.newModel.getSub_attributes()); + model.setRefAttributes(this.newModel.getRefAttributes()); + model.setSubAttributes(this.newModel.getSubAttributes()); model.setDataOrderInfo(this.newModel.getDataOrderInfo()); model.setDecisionModel(this.newModel.isDecisionModel()); model.setRuleFormation(this.newModel.getRuleFormation());