}
private GroupPolicyScopeList getPolicyObject(String policyScope) {
- GroupPolicyScopeList groupList= (GroupPolicyScopeList) commonClassDao.getEntityItem(GroupPolicyScopeList.class, "name", policyScope);
- return groupList;
+ return (GroupPolicyScopeList) commonClassDao.getEntityItem(GroupPolicyScopeList.class, "name", policyScope);
}
private PolicyRestAdapter constructJson(PolicyRestAdapter policyAdapter, String jsonContent, String dummyValue) {
Map gsonObject = (Map) gson.fromJson(subAttributes, Object.class);
JSONObject object = new JSONObject();
- JSONArray array = new JSONArray();
+ JSONArray array;
for (Entry<String, String> keySet : attributeMap.entrySet()){
array = new JSONArray();
@SuppressWarnings("unchecked")
private JSONObject recursiveReference(String name, Map<String,String> subAttributeMap, String enumAttribute) {
JSONObject object = new JSONObject();
- Map<String, String> map = new HashMap<>();
+ Map<String, String> map;
Object returnClass = subAttributeMap.get(name);
map = (Map<String, String>) returnClass;
- JSONArray array = new JSONArray();
+ JSONArray array;
for( Entry<String, String> m:map.entrySet()){
String[] splitValue = m.getValue().split(":");
JsonNode root = mapper.readTree(request.getReader());
String value = root.get("policyData").toString().replaceAll("^\"|\"$", "");
- String servicename = value.toString().split("-v")[0];
+ String servicename = value.split("-v")[0];
Set<String> returnList = getVersionList(servicename);
response.setCharacterEncoding("UTF-8");
}
private Set<String> getVersionList(String name) {
- MicroServiceModels workingModel = new MicroServiceModels();
+ MicroServiceModels workingModel;
Set<String> list = new HashSet<>();
List<Object> microServiceModelsData = commonClassDao.getDataById(MicroServiceModels.class, "modelName", name);
for (int i = 0; i < microServiceModelsData.size(); i++) {
String policyScopeName = null;
ObjectMapper mapper = new ObjectMapper();
try {
- DCAEMicroServiceObject msBody = (DCAEMicroServiceObject) mapper.readValue(entity.getConfigurationData().getConfigBody(), DCAEMicroServiceObject.class);
+ DCAEMicroServiceObject msBody = mapper.readValue(entity.getConfigurationData().getConfigBody(), DCAEMicroServiceObject.class);
policyScopeName = getPolicyScope(msBody.getPolicyScope());
policyAdapter.setPolicyScope(policyScopeName);
//Convert the map values and set into JSON body
public Map<String, String> convertMap(Map<String, String> attributesMap, Map<String, String> attributesRefMap) {
Map<String, String> attribute = new HashMap<>();
- String temp = null;
+ StringBuilder temp = null;
String key;
String value;
for (Entry<String, String> entry : attributesMap.entrySet()) {
temp = null;
for (Object textList : arrayList.getValue()){
if (temp == null){
- temp = "[" + textList;
+ temp = new StringBuilder();
+ temp.append("[" + textList);
}else{
- temp = temp + "," + textList;
+ temp.append("," + textList);
}
}
attribute.put(key, temp+ "]");
private void retreiveDependency(String workingFile, Boolean modelClass) {
MSModelUtils utils = new MSModelUtils(PolicyController.getMsOnapName(), PolicyController.getMsPolicyName());
- HashMap<String, MSAttributeObject> tempMap = new HashMap<>();
+ HashMap<String, MSAttributeObject> tempMap;
tempMap = utils.processEpackage(workingFile, MODEL_TYPE.XMI);