- private static final Logger LOGGER = FlexLogger.getLogger(ClosedLoopDictionaryController.class);
-
- private static CommonClassDao commonClassDao;
- private static String vsclaction = "vsclaction";
- private static String successMapKey = "successMapKey";
- private static String successMessage = "success";
- private static String operation = "operation";
- private static String getDictionary = "getDictionary";
- private static String dictionaryDBQuery = "dictionaryDBQuery";
- private static String errorMsg = "error";
- private static String vnftype = "vnftype";
- private static String pepName = "pepName";
- private static String varbindName = "varbindName";
- private static String serviceName = "serviceName";
- private static String siteName = "siteName";
- private static String apiflag = "apiflag";
- private static String dictionaryFields = "dictionaryFields";
- private static String update = "update";
- private static String duplicateResponseString = "Duplicate";
- private static String userid = "userid";
- private static String utf8 = "UTF-8";
- private static String applicationJsonContentType = "application / json";
- private static String successMsg = "Success";
-
- @Autowired
- public ClosedLoopDictionaryController(CommonClassDao commonClassDao){
- ClosedLoopDictionaryController.commonClassDao = commonClassDao;
- }
- /*
- * This is an empty constructor
- */
- public ClosedLoopDictionaryController(){}
-
- public UserInfo getUserInfo(String loginId){
- return (UserInfo) commonClassDao.getEntityItem(UserInfo.class, "userLoginId", loginId);
- }
-
-
- @RequestMapping(value={"/get_VSCLActionDataByName"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getVSCLActionDictionaryByNameEntityData(HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("vsclActionDictionaryDatas", mapper.writeValueAsString(commonClassDao.getDataByColumn(VSCLAction.class, vsclaction)));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
- }
-
-
- @RequestMapping(value={"/get_VSCLActionData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getVSCLActionDictionaryEntityData(HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("vsclActionDictionaryDatas", mapper.writeValueAsString(commonClassDao.getData(VSCLAction.class)));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.addHeader(successMapKey, successMessage);
- response.addHeader(operation, getDictionary);
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
- response.addHeader(errorMsg, dictionaryDBQuery);
- }
- }
-
- @RequestMapping(value={"/get_VNFTypeDataByName"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getVNFTypeDictionaryByNameEntityData(HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("vnfTypeDictionaryDatas", mapper.writeValueAsString(commonClassDao.getDataByColumn(VNFType.class, vnftype)));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.addHeader(successMapKey, successMessage);
- response.addHeader(operation, getDictionary);
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
- }
-
- @RequestMapping(value={"/get_VNFTypeData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getVNFTypeDictionaryEntityData(HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("vnfTypeDictionaryDatas", mapper.writeValueAsString(commonClassDao.getData(VNFType.class)));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.addHeader(successMapKey, successMessage);
- response.addHeader(operation, getDictionary);
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
- response.addHeader(errorMsg, dictionaryDBQuery);
- }
- }
-
- @RequestMapping(value={"/get_PEPOptionsDataByName"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getPEPOptionsDictionaryByNameEntityData(HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("pepOptionsDictionaryDatas", mapper.writeValueAsString(commonClassDao.getDataByColumn(PEPOptions.class, pepName)));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
- }
-
- @RequestMapping(value={"/get_PEPOptionsData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getPEPOptionsDictionaryEntityData(HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("pepOptionsDictionaryDatas", mapper.writeValueAsString(commonClassDao.getData(PEPOptions.class)));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.addHeader(successMapKey, successMessage);
- response.addHeader(operation, getDictionary);
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
- response.addHeader(errorMsg, dictionaryDBQuery);
- }
- }
-
- @RequestMapping(value={"/get_VarbindDictionaryDataByName"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getVarbindDictionaryByNameEntityData(HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("varbindDictionaryDatas", mapper.writeValueAsString(commonClassDao.getDataByColumn(VarbindDictionary.class, varbindName)));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
- }
-
- @RequestMapping(value={"/get_VarbindDictionaryData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getVarbindDictionaryEntityData(HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("varbindDictionaryDatas", mapper.writeValueAsString(commonClassDao.getData(VarbindDictionary.class)));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.addHeader(successMapKey, successMessage);
- response.addHeader(operation, getDictionary);
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
- response.addHeader(errorMsg, dictionaryDBQuery);
- }
- }
-
- @RequestMapping(value={"/get_ClosedLoopServicesDataByName"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getClosedLoopServiceDictionaryByNameEntityData(HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("closedLoopServiceDictionaryDatas", mapper.writeValueAsString(commonClassDao.getDataByColumn(ClosedLoopD2Services.class, serviceName)));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
- }
-
- @RequestMapping(value={"/get_ClosedLoopServicesData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getClosedLoopServiceDictionaryEntityData(HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("closedLoopServiceDictionaryDatas", mapper.writeValueAsString(commonClassDao.getData(ClosedLoopD2Services.class)));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.addHeader(successMapKey, successMessage);
- response.addHeader(operation, getDictionary);
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
- response.addHeader(errorMsg, dictionaryDBQuery);
- }
- }
-
- @RequestMapping(value={"/get_ClosedLoopSiteDataByName"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getClosedLoopSiteDictionaryByNameEntityData(HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("closedLoopSiteDictionaryDatas", mapper.writeValueAsString(commonClassDao.getDataByColumn(ClosedLoopSite.class, siteName)));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
- }
-
- @RequestMapping(value={"/get_ClosedLoopSiteData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getClosedLoopSiteDictionaryEntityData(HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("closedLoopSiteDictionaryDatas", mapper.writeValueAsString(commonClassDao.getData(ClosedLoopSite.class)));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.addHeader(successMapKey, successMessage);
- response.addHeader(operation, getDictionary);
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
- response.addHeader(errorMsg, dictionaryDBQuery);
- }
- }
-
- @RequestMapping(value={"/cl_dictionary/save_vsclAction"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveVSCLAction(HttpServletRequest request, HttpServletResponse response)throws IOException{
- try {
- boolean duplicateflag = false;
- boolean isFakeUpdate = false;
- boolean fromAPI = false;
- if (request.getParameter(apiflag)!=null && ("api").equalsIgnoreCase(request.getParameter(apiflag))) {
- fromAPI = true;
- }
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- JsonNode root = mapper.readTree(request.getReader());
- VSCLAction vSCLAction;
- String userId = null;
- if (fromAPI) {
- vSCLAction = (VSCLAction)mapper.readValue(root.get(dictionaryFields).toString(), VSCLAction.class);
- userId = "API";
-
- //check if update operation or create, get id for data to be updated and update attributeData
- if ((update).equals(request.getParameter(operation))) {
- List<Object> duplicateData = commonClassDao.checkDuplicateEntry(vSCLAction.getVsclaction(), vsclaction, VSCLAction.class);
- VSCLAction data = (VSCLAction) duplicateData.get(0);
- int id = data.getId();
- if(id==0){
- isFakeUpdate=true;
- vSCLAction.setId(1);
- } else {
- vSCLAction.setId(id);
- }
-
- vSCLAction.setUserCreatedBy(this.getUserInfo(userId));
- }
-
- } else {
- vSCLAction = (VSCLAction)mapper.readValue(root.get("vsclActionDictionaryData").toString(), VSCLAction.class);
- userId = root.get(userid).textValue();
- }
- if(vSCLAction.getId() == 0){
- List<Object> duplicateData = commonClassDao.checkDuplicateEntry(vSCLAction.getVsclaction(), vsclaction, VSCLAction.class);
- if(!duplicateData.isEmpty()){
- duplicateflag = true;
- }else{
- vSCLAction.setUserCreatedBy(this.getUserInfo(userId));
- vSCLAction.setUserModifiedBy(this.getUserInfo(userId));
- vSCLAction.setModifiedDate(new Date());
- commonClassDao.save(vSCLAction);
- }
- }else{
- if(!isFakeUpdate) {
- vSCLAction.setUserModifiedBy(this.getUserInfo(userId));
- commonClassDao.update(vSCLAction);
- }
- }
-
- String responseString = "";
- if(duplicateflag){
- responseString = duplicateResponseString;
- }else{
- responseString = mapper.writeValueAsString(commonClassDao.getData(VSCLAction.class));
- }
- if (fromAPI) {
- if (responseString!=null && !(duplicateResponseString).equals(responseString)) {
- if(isFakeUpdate) {
- responseString = "Exists";
- } else {
- responseString = successMsg;
- }
-
- }
- ModelAndView result = new ModelAndView();
- result.setViewName(responseString);
- return result;
- } else {
- response.setCharacterEncoding(utf8);
- response.setContentType(applicationJsonContentType);
- request.setCharacterEncoding(utf8);
-
- PrintWriter out = response.getWriter();
- JSONObject j = new JSONObject("{vsclActionDictionaryDatas: " + responseString + "}");
- out.write(j.toString());
- return null;
- }
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- response.setCharacterEncoding(utf8);
- request.setCharacterEncoding(utf8);
- PrintWriter out = response.getWriter();
- out.write(e.getMessage());
- }
- return null;
- }
-
- @RequestMapping(value={"/cl_dictionary/remove_VsclAction"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeVSCLAction(HttpServletRequest request, HttpServletResponse response) throws IOException {
- try{
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- JsonNode root = mapper.readTree(request.getReader());
- VSCLAction vSCLAction = (VSCLAction)mapper.readValue(root.get("data").toString(), VSCLAction.class);
- commonClassDao.delete(vSCLAction);
- response.setCharacterEncoding(utf8);
- response.setContentType(applicationJsonContentType);
- request.setCharacterEncoding(utf8);
-
- PrintWriter out = response.getWriter();
-
- String responseString = mapper.writeValueAsString(commonClassDao.getData(VSCLAction.class));
- JSONObject j = new JSONObject("{vsclActionDictionaryDatas: " + responseString + "}");
- out.write(j.toString());
-
- return null;
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- response.setCharacterEncoding(utf8);
- request.setCharacterEncoding(utf8);
- PrintWriter out = response.getWriter();
- out.write(e.getMessage());
- }
- return null;
- }
-
- @RequestMapping(value={"/cl_dictionary/save_vnfType"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveVnfType(HttpServletRequest request, HttpServletResponse response) throws IOException{
- try {
- boolean duplicateflag = false;
- boolean isFakeUpdate = false;
- boolean fromAPI = false;
-
- if (request.getParameter(apiflag)!=null && ("api").equalsIgnoreCase(request.getParameter(apiflag))) {
- fromAPI = true;
- }
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- JsonNode root = mapper.readTree(request.getReader());
- VNFType vNFType;
- String userId = null;
-
- if (fromAPI) {
- vNFType = (VNFType)mapper.readValue(root.get(dictionaryFields).toString(), VNFType.class);
- userId = "API";
-
- //check if update operation or create, get id for data to be updated and update attributeData
- if ((update).equals(request.getParameter(operation))) {
- List<Object> duplicateData = commonClassDao.checkDuplicateEntry(vNFType.getVnftype(), vnftype, VNFType.class);
- VNFType data = (VNFType) duplicateData.get(0);
- int id = data.getId();
- if(id==0){
- isFakeUpdate=true;
- vNFType.setId(1);
- } else {
- vNFType.setId(id);
- }
- vNFType.setUserCreatedBy(this.getUserInfo(userId));
- }
- } else {
- vNFType = (VNFType)mapper.readValue(root.get("vnfTypeDictionaryData").toString(), VNFType.class);
- userId = root.get(userid).textValue();
- }
- if(vNFType.getId() == 0){
- List<Object> duplicateData = commonClassDao.checkDuplicateEntry(vNFType.getVnftype(), vnftype, VNFType.class);
- if(!duplicateData.isEmpty()){
- duplicateflag = true;
- }else{
- vNFType.setUserCreatedBy(this.getUserInfo(userId));
- vNFType.setUserModifiedBy(this.getUserInfo(userId));
- commonClassDao.save(vNFType);
- }
- }else{
- if(!isFakeUpdate) {
- vNFType.setUserModifiedBy(this.getUserInfo(userId));
- vNFType.setModifiedDate(new Date());
- commonClassDao.update(vNFType);
- }
- }
- String responseString = "";
- if(duplicateflag){
- responseString = duplicateResponseString;
- }else{
- responseString = mapper.writeValueAsString(commonClassDao.getData(VNFType.class));
- }
- if (fromAPI) {
- if (responseString!=null && !(duplicateResponseString).equals(responseString)) {
- if(isFakeUpdate) {
- responseString = "Exists";
- } else {
- responseString = successMsg;
- }
- }
- ModelAndView result = new ModelAndView();
- result.setViewName(responseString);
- return result;
- } else {
- response.setCharacterEncoding(utf8);
- response.setContentType(applicationJsonContentType);
- request.setCharacterEncoding(utf8);
-
- PrintWriter out = response.getWriter();
- JSONObject j = new JSONObject("{vnfTypeDictionaryDatas: " + responseString + "}");
- out.write(j.toString());
- return null;
- }
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- response.setCharacterEncoding(utf8);
- request.setCharacterEncoding(utf8);
- PrintWriter out = response.getWriter();
- out.write(e.getMessage());
- }
- return null;
- }
-
- @RequestMapping(value={"/cl_dictionary/remove_vnfType"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeVnfType(HttpServletRequest request, HttpServletResponse response) throws IOException {
- try{
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- JsonNode root = mapper.readTree(request.getReader());
- VNFType vNFType = (VNFType)mapper.readValue(root.get("data").toString(), VNFType.class);
- commonClassDao.delete(vNFType);
- response.setCharacterEncoding(utf8);
- response.setContentType(applicationJsonContentType);
- request.setCharacterEncoding(utf8);
-
- PrintWriter out = response.getWriter();
-
- String responseString = mapper.writeValueAsString(commonClassDao.getData(VNFType.class));
- JSONObject j = new JSONObject("{vnfTypeDictionaryDatas: " + responseString + "}");
- out.write(j.toString());
-
- return null;
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- response.setCharacterEncoding(utf8);
- request.setCharacterEncoding(utf8);
- PrintWriter out = response.getWriter();
- out.write(e.getMessage());
- }
- return null;
- }
-
- @RequestMapping(value={"/cl_dictionary/save_pepOptions"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView savePEPOptions(HttpServletRequest request, HttpServletResponse response) throws IOException{
- try {
- boolean duplicateflag = false;
- boolean isFakeUpdate = false;
- boolean fromAPI = false;
- if (request.getParameter(apiflag)!=null && ("api").equalsIgnoreCase(request.getParameter(apiflag))) {
- fromAPI = true;
- }
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- JsonNode root = mapper.readTree(request.getReader());
- PEPOptions pEPOptions;
- GridData gridData;
+ private static CommonClassDao commonClassDao;
+ private static String vsclaction = "vsclaction";
+ private static String operation = "operation";
+ private static String vnftype = "vnftype";
+ private static String pepName = "pepName";
+ private static String varbindName = "varbindName";
+ private static String serviceName = "serviceName";
+ private static String siteName = "siteName";
+ private static String dictionaryFields = "dictionaryFields";
+ private static String duplicateResponseString = "Duplicate";
+ private static String userid = "userid";
+ private static String vsclActionDatas = "vsclActionDictionaryDatas";
+ private static String vnfTypeDatas = "vnfTypeDictionaryDatas";
+ private static String pepOptionDatas = "pepOptionsDictionaryDatas";
+ private static String varbindDatas = "varbindDictionaryDatas";
+ private static String closedLoopDatas = "closedLoopServiceDictionaryDatas";
+ private static String closedLoopSiteDatas = "closedLoopSiteDictionaryDatas";
+
+ @Autowired
+ public ClosedLoopDictionaryController(CommonClassDao commonClassDao){
+ ClosedLoopDictionaryController.commonClassDao = commonClassDao;
+ }
+
+ public void setCommonClassDao(CommonClassDao commonClassDao){
+ ClosedLoopDictionaryController.commonClassDao = commonClassDao;
+ }
+
+ public static void setCommonClassDao(CommonClassDaoImpl commonClassDaoImpl) {
+ commonClassDao = commonClassDaoImpl;
+ }
+
+ public ClosedLoopDictionaryController(){
+ super();
+ }
+
+ private DictionaryUtils getDictionaryUtilsInstance(){
+ return DictionaryUtils.getDictionaryUtils();
+ }
+
+ @RequestMapping(value={"/get_VSCLActionDataByName"}, method={RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
+ public void getVSCLActionDictionaryByNameEntityData(HttpServletResponse response){
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getDataByEntity(response, vsclActionDatas, vsclaction, VSCLAction.class);
+ }
+
+
+ @RequestMapping(value={"/get_VSCLActionData"}, method={RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
+ public void getVSCLActionDictionaryEntityData(HttpServletResponse response){
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getData(response, vsclActionDatas, VSCLAction.class);
+ }
+
+ @RequestMapping(value={"/get_VNFTypeDataByName"}, method={RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
+ public void getVNFTypeDictionaryByNameEntityData(HttpServletResponse response){
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getDataByEntity(response, vnfTypeDatas, vnftype, VNFType.class);
+ }
+
+ @RequestMapping(value={"/get_VNFTypeData"}, method={RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
+ public void getVNFTypeDictionaryEntityData(HttpServletResponse response){
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getData(response, vnfTypeDatas, VNFType.class);
+ }
+
+ @RequestMapping(value={"/get_PEPOptionsDataByName"}, method={RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
+ public void getPEPOptionsDictionaryByNameEntityData(HttpServletResponse response){
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getDataByEntity(response, pepOptionDatas, pepName, PEPOptions.class);
+ }
+
+ @RequestMapping(value={"/get_PEPOptionsData"}, method={RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
+ public void getPEPOptionsDictionaryEntityData(HttpServletResponse response){
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getData(response, pepOptionDatas, PEPOptions.class);
+ }
+
+ @RequestMapping(value={"/get_VarbindDictionaryDataByName"}, method={RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
+ public void getVarbindDictionaryByNameEntityData(HttpServletResponse response){
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getDataByEntity(response, varbindDatas, varbindName, VarbindDictionary.class);
+ }
+
+ @RequestMapping(value={"/get_VarbindDictionaryData"}, method={RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
+ public void getVarbindDictionaryEntityData(HttpServletResponse response){
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getData(response, varbindDatas, VarbindDictionary.class);
+ }
+
+ @RequestMapping(value={"/get_ClosedLoopServicesDataByName"}, method={RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
+ public void getClosedLoopServiceDictionaryByNameEntityData(HttpServletResponse response){
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getDataByEntity(response, closedLoopDatas, serviceName, ClosedLoopD2Services.class);
+ }
+
+ @RequestMapping(value={"/get_ClosedLoopServicesData"}, method={RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
+ public void getClosedLoopServiceDictionaryEntityData(HttpServletResponse response){
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getData(response, closedLoopDatas, ClosedLoopD2Services.class);
+ }
+
+ @RequestMapping(value={"/get_ClosedLoopSiteDataByName"}, method={RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
+ public void getClosedLoopSiteDictionaryByNameEntityData(HttpServletResponse response){
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getDataByEntity(response, closedLoopSiteDatas, siteName, ClosedLoopSite.class);
+ }
+
+ @RequestMapping(value={"/get_ClosedLoopSiteData"}, method={RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
+ public void getClosedLoopSiteDictionaryEntityData(HttpServletResponse response){
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ utils.getData(response, closedLoopSiteDatas, ClosedLoopSite.class);
+ }
+
+ @RequestMapping(value={"/cl_dictionary/save_vsclAction"}, method={RequestMethod.POST})
+ public ModelAndView saveVSCLAction(HttpServletRequest request, HttpServletResponse response)throws IOException{
+ DictionaryUtils utils = getDictionaryUtilsInstance();
+ try {
+ boolean fromAPI = utils.isRequestFromAPI(request);
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ JsonNode root = mapper.readTree(request.getReader());
+ VSCLAction vSCLAction;