X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FCreateDcaeMicroServiceController.java;h=5dee2e61f5b967951f028e91867d7af80e8ae109;hp=1cc41f97b1584a4cdfc5eac11b9a521e18f4cd64;hb=779125e31adbcc59a9864843b523bd6ed2751cbb;hpb=c2ca6ea5cb44103903e1409e8dd6db80167e61e8 diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java index 1cc41f97b..5dee2e61f 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java @@ -94,9 +94,9 @@ import org.onap.policy.rest.jpa.GroupPolicyScopeList; import org.onap.policy.rest.jpa.MicroServiceModels; import org.onap.policy.rest.jpa.MicroserviceHeaderdeFaults; import org.onap.policy.rest.jpa.PolicyEntity; -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; import org.onap.policy.utils.PolicyUtils; import org.onap.portalsdk.core.controller.RestrictedBaseController; import org.onap.portalsdk.core.web.support.JsonMessage; @@ -126,7 +126,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { private String directory; private List modelList = new ArrayList<>(); private List dirDependencyList = new ArrayList<>(); - private LinkedHashMap classMap = new LinkedHashMap<>(); + private LinkedHashMap classMap = new LinkedHashMap<>(); String referenceAttributes; String attributeString; Set allManyTrueKeys = null; @@ -903,8 +903,8 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { // Get all keys with "MANY-true" defined in their value from subAttribute Set allkeys = null; - if (returnModel.getSub_attributes() != null && !returnModel.getSub_attributes().isEmpty()) { - JSONObject json = new JSONObject(returnModel.getSub_attributes()); + if (returnModel.getSubAttributes() != null && !returnModel.getSubAttributes().isEmpty()) { + JSONObject json = new JSONObject(returnModel.getSubAttributes()); getAllKeys(json); allkeys = allManyTrueKeys; allManyTrueKeys = new TreeSet<>(); @@ -942,8 +942,8 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { jsonModel = finalJsonObject.toString(); } - // get all properties with "MANY-true" defined in Ref_attributes - Set manyTrueProperties = getManyTrueProperties(returnModel.getRef_attributes()); + // get all properties with "MANY-true" defined in RefAttributes + Set manyTrueProperties = getManyTrueProperties(returnModel.getRefAttributes()); if (manyTrueProperties != null) { JSONObject jsonObj = new JSONObject(jsonModel); for (String s : manyTrueProperties) { @@ -988,7 +988,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { if (attribute != null) { attribute = attribute.trim(); } - String refAttribute = returnModel.getRef_attributes(); + String refAttribute = returnModel.getRefAttributes(); if (refAttribute != null) { refAttribute = refAttribute.trim(); } @@ -1005,7 +1005,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { Gson gson = new Gson(); - String subAttributes = returnModel.getSub_attributes(); + String subAttributes = returnModel.getSubAttributes(); if (subAttributes != null) { subAttributes = subAttributes.trim(); } else { @@ -1539,7 +1539,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { } List fileList = new ArrayList<>(); - MSModelUtils msModelUtils = new MSModelUtils(commonClassDao); + MsModelUtils msModelUtils = new MsModelUtils(commonClassDao); this.directory = "model"; if (zip) { extractFolder(this.newFile); @@ -1579,7 +1579,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { modelType = "yml"; modelList.add(this.newModel.getModelName()); String className = this.newModel.getModelName(); - MSAttributeObject msAttributes = new MSAttributeObject(); + MsAttributeObject msAttributes = new MsAttributeObject(); msAttributes.setClassName(className); LinkedHashMap returnAttributeList = new LinkedHashMap<>(); @@ -1681,10 +1681,10 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { private void retrieveDependency(String workingFile) { - MSModelUtils utils = new MSModelUtils(PolicyController.getMsOnapName(), PolicyController.getMsPolicyName()); - Map tempMap; + MsModelUtils utils = new MsModelUtils(PolicyController.getMsOnapName(), PolicyController.getMsPolicyName()); + Map tempMap; - tempMap = utils.processEpackage(workingFile, MODEL_TYPE.XMI); + tempMap = utils.processEpackage(workingFile, ModelType.XMI); classMap.putAll(tempMap); LOGGER.info(tempMap); @@ -1734,7 +1734,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { private List createList() { List list = new ArrayList<>(); - for (Entry entrySet : classMap.entrySet()) { + for (Entry entrySet : classMap.entrySet()) { if (entrySet.getValue().isPolicyTempalate()) { list.add(entrySet.getKey()); }