X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fpolicy%2Fcontroller%2FPolicyController.java;h=42e4483cab4a897bd01a74f70c0795db61c233a8;hp=a9eb40b4f7f597e35712016183e1651b7fc4dbc8;hb=87c95be02a8a4d77e165dede90777e811b59dcae;hpb=7e547eaa55920dfbc9691eab33bb728395b50cf2 diff --git a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyController.java b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyController.java index a9eb40b4f..42e4483ca 100644 --- a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyController.java +++ b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyController.java @@ -85,7 +85,7 @@ public class PolicyController extends RestrictedBaseController { public static String logTableLimit; public static String systemAlertTableLimit; - protected static Map dropDownMap = new HashMap(); + protected static Map dropDownMap = new HashMap<>(); public static Map getDropDownMap() { return dropDownMap; } @@ -134,6 +134,10 @@ public class PolicyController extends RestrictedBaseController { //MicroService Model Properties public static String msEcompName; public static String msPolicyName; + + //WebApp directories + public static String configHome; + public static String actionHome; @Autowired private PolicyController(CommonClassDao commonClassDao){ @@ -179,6 +183,9 @@ public class PolicyController extends RestrictedBaseController { //Micro Service Properties msEcompName=prop.getProperty("xacml.policy.msEcompName"); msPolicyName=prop.getProperty("xacml.policy.msPolicyName"); + //WebApp directories + configHome = prop.getProperty("xacml.rest.config.webapps") + "Config"; + actionHome = prop.getProperty("xacml.rest.config.webapps") + "Action"; //Get the Property Values for Dashboard tab Limit try{ logTableLimit = prop.getProperty("xacml.ecomp.dashboard.logTableLimit"); @@ -231,8 +238,8 @@ public class PolicyController extends RestrictedBaseController { } private static void buildFunctionMaps() { - mapDatatype2Function = new HashMap>(); - mapID2Function = new HashMap(); + mapDatatype2Function = new HashMap<>(); + mapID2Function = new HashMap<>(); List functiondefinitions = commonClassDao.getData(FunctionDefinition.class); for (int i = 0; i < functiondefinitions.size(); i ++) { FunctionDefinition value = (FunctionDefinition) functiondefinitions.get(i); @@ -247,7 +254,7 @@ public class PolicyController extends RestrictedBaseController { @RequestMapping(value={"/get_FunctionDefinitionDataByName"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE) public void getFunctionDefinitionData(HttpServletRequest request, HttpServletResponse response){ try{ - Map model = new HashMap(); + Map model = new HashMap<>(); ObjectMapper mapper = new ObjectMapper(); model.put("functionDefinitionDatas", mapper.writeValueAsString(commonClassDao.getDataByColumn(FunctionDefinition.class, "shortname"))); JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); @@ -267,7 +274,7 @@ public class PolicyController extends RestrictedBaseController { } public static Map getUserRoles(String userId) { - Map scopes = new HashMap(); + Map scopes = new HashMap<>(); List roles = commonClassDao.getDataById(Roles.class, "loginId", userId); if (roles != null && roles.size() > 0) { for (Object role : roles) { @@ -295,7 +302,7 @@ public class PolicyController extends RestrictedBaseController { public void getUserRolesEntityData(HttpServletRequest request, HttpServletResponse response){ try{ String userId = UserUtils.getUserSession(request).getOrgUserId(); - Map model = new HashMap(); + Map model = new HashMap<>(); ObjectMapper mapper = new ObjectMapper(); model.put("userRolesDatas", mapper.writeValueAsString(getRolesOfUser(userId))); JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model)); @@ -320,7 +327,7 @@ public class PolicyController extends RestrictedBaseController { } catch (Exception e) { LOGGER.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR+"Exception Occured while loading PAP"+e); } - Map model = new HashMap(); + Map model = new HashMap<>(); return new ModelAndView("policy_Editor","model", model); } @@ -404,7 +411,7 @@ public class PolicyController extends RestrictedBaseController { String[] splitDBCheckName = dbCheckName.split(":"); String query = "FROM PolicyEntity where policyName like'"+splitDBCheckName[1]+"%' and scope ='"+splitDBCheckName[0]+"'"; List policyEntity = commonClassDao.getDataByQuery(query); - List av = new ArrayList(); + List av = new ArrayList<>(); for(Object entity : policyEntity){ PolicyEntity pEntity = (PolicyEntity) entity; String removeExtension = pEntity.getPolicyName().replace(".xml", "");