X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcontroller%2FMicroServiceDictionaryController.java;fp=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcontroller%2FMicroServiceDictionaryController.java;h=526e28649b0a3e5c4ded9ef2288348b6145d5fb8;hb=7925630b5edc79119f29392edc6ddc84cf7c3757;hp=621f0c474bc3f5da391482a5a41cb694ac4c0bca;hpb=c53fa990ea27ec074859eb94bcb7ec6deaa2157b;p=policy%2Fengine.git diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java index 621f0c474..526e28649 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java @@ -20,7 +20,9 @@ package org.onap.policy.pap.xacml.rest.controller; +import java.io.IOException; import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -124,12 +126,12 @@ public class MicroServiceDictionaryController { catch (Exception e){ response.setStatus(HttpServletResponse.SC_BAD_REQUEST); response.addHeader(ERROR, DICTIONARYDBQUERY); - LOGGER.error(e.getMessage()); + LOGGER.error(e); } } @RequestMapping(value={"/ms_dictionary/save_dcaeUUID"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView saveDCAEUUIDDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{ + public ModelAndView saveDCAEUUIDDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{ try { boolean duplicateflag = false; boolean isFakeUpdate = false; @@ -205,12 +207,13 @@ public class MicroServiceDictionaryController { request.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); out.write(e.getMessage()); + LOGGER.error(e); } return null; } @RequestMapping(value={"/ms_dictionary/remove_dcaeuuid"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView removeDCAEUUIDDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception { + public ModelAndView removeDCAEUUIDDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException { try{ ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); @@ -272,12 +275,12 @@ public class MicroServiceDictionaryController { catch (Exception e){ response.setStatus(HttpServletResponse.SC_BAD_REQUEST); response.addHeader(ERROR, DICTIONARYDBQUERY); - LOGGER.error(e.getMessage()); + LOGGER.error(e); } } @RequestMapping(value={"/ms_dictionary/save_configName"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView saveMicroServiceConfigNameDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{ + public ModelAndView saveMicroServiceConfigNameDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{ try { boolean duplicateflag = false; boolean isFakeUpdate = false; @@ -354,12 +357,13 @@ public class MicroServiceDictionaryController { request.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); out.write(e.getMessage()); + LOGGER.error(e); } return null; } @RequestMapping(value={"/ms_dictionary/remove_msConfigName"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView removeMicroServiceConfigNameDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception { + public ModelAndView removeMicroServiceConfigNameDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException { try{ ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); @@ -418,12 +422,12 @@ public class MicroServiceDictionaryController { catch (Exception e){ response.setStatus(HttpServletResponse.SC_BAD_REQUEST); response.addHeader(ERROR, DICTIONARYDBQUERY); - LOGGER.error(e.getMessage()); + LOGGER.error(e); } } @RequestMapping(value={"/ms_dictionary/save_location"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView saveMicroServiceLocationDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{ + public ModelAndView saveMicroServiceLocationDictionary(HttpServletRequest request, HttpServletResponse response)throws UnsupportedEncodingException, IOException{ try { boolean duplicateflag = false; boolean isFakeUpdate = false; @@ -500,12 +504,13 @@ public class MicroServiceDictionaryController { request.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); out.write(e.getMessage()); + LOGGER.error(e); } return null; } @RequestMapping(value={"/ms_dictionary/remove_msLocation"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView removeMicroServiceLocationDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception { + public ModelAndView removeMicroServiceLocationDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException { try{ ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); @@ -545,7 +550,7 @@ public class MicroServiceDictionaryController { response.getWriter().write(j.toString()); } catch (Exception e){ - LOGGER.error(e.getMessage()); + LOGGER.error(e); } } @@ -565,12 +570,12 @@ public class MicroServiceDictionaryController { catch (Exception e){ response.setStatus(HttpServletResponse.SC_BAD_REQUEST); response.addHeader(ERROR, DICTIONARYDBQUERY); - LOGGER.error(e.getMessage()); + LOGGER.error(e); } } @RequestMapping(value={"/ms_dictionary/save_modelAttribute"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView saveMicroServiceAttributeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{ + public ModelAndView saveMicroServiceAttributeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{ try { boolean duplicateflag = false; boolean fromAPI = false; @@ -645,12 +650,13 @@ public class MicroServiceDictionaryController { request.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); out.write(e.getMessage()); + LOGGER.error(e); } return null; } @RequestMapping(value={"/ms_dictionary/remove_modelAttribute"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView removeMicroServiceAttributeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception { + public ModelAndView removeMicroServiceAttributeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{ try{ ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); @@ -670,7 +676,7 @@ public class MicroServiceDictionaryController { return null; } catch (Exception e){ - LOGGER.error(e.getMessage()); + LOGGER.error(e); response.setCharacterEncoding("UTF-8"); request.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); @@ -691,7 +697,7 @@ public class MicroServiceDictionaryController { response.getWriter().write(j.toString()); } catch (Exception e){ - LOGGER.error(e.getMessage()); + LOGGER.error(e); } } @@ -715,7 +721,7 @@ public class MicroServiceDictionaryController { response.getWriter().write(j.toString()); } catch (Exception e){ - LOGGER.error(e.getMessage()); + LOGGER.error(e); } } @@ -734,7 +740,7 @@ public class MicroServiceDictionaryController { catch (Exception e){ response.setStatus(HttpServletResponse.SC_BAD_REQUEST); response.addHeader(ERROR, DICTIONARYDBQUERY); - LOGGER.error(e.getMessage()); + LOGGER.error(e); } } @@ -782,12 +788,12 @@ public class MicroServiceDictionaryController { catch (Exception e){ response.setStatus(HttpServletResponse.SC_BAD_REQUEST); response.addHeader(ERROR, DICTIONARYDBQUERY); - LOGGER.error(e.getMessage()); + LOGGER.error(e); } } @RequestMapping(value={"/ms_dictionary/save_model"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView saveMicroServiceModelsDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{ + public ModelAndView saveMicroServiceModelsDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{ try { boolean duplicateflag = false; boolean fromAPI = false; @@ -953,12 +959,13 @@ public class MicroServiceDictionaryController { request.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); out.write(e.getMessage()); + LOGGER.error(e); } return null; } @RequestMapping(value={"/ms_dictionary/remove_msModel"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView removeMicroServiceModelsDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception { + public ModelAndView removeMicroServiceModelsDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException { try{ ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);