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.Date;
import java.util.HashMap;
response.getWriter().write(j.toString());
}
catch (Exception e){
- LOGGER.error(e.getMessage());
+ LOGGER.error(e.getMessage(),e);
}
}
response.getWriter().write(j.toString());
}
catch (Exception e){
- LOGGER.error(e.getMessage());
+ LOGGER.error(e.getMessage(),e);
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
response.addHeader("error", "dictionaryDBQuery");
}
}
@RequestMapping(value={"/action_dictionary/save_ActionDict"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveActionPolicyDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveActionPolicyDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
}
catch (Exception e){
- LOGGER.error(e.getMessage());
+ LOGGER.error(e.getMessage(),e);
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
}
@RequestMapping(value={"/action_dictionary/remove_actionPolicyDict"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeActionPolicyDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeActionPolicyDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return null;
}
catch (Exception e){
- LOGGER.error(e.getMessage());
+ LOGGER.error(e.getMessage(),e);
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
package org.onap.policy.pap.xacml.rest.controller;
+import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.HashMap;
}
@RequestMapping(value={"/brms_dictionary/set_BRMSParamData"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public void SetRuleData(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public void SetRuleData(HttpServletRequest request, HttpServletResponse response) throws IOException{
StringWriter writer = new StringWriter();
IOUtils.copy(request.getInputStream() , writer, StandardCharsets.UTF_8);
String cleanStreamBoundary = writer.toString().replaceFirst("------(.*)(?s).*octet-stream", "");
}
@RequestMapping(value={"/brms_dictionary/save_BRMSParam"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveBRMSParamDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveBRMSParamDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try {
boolean duplicateflag = false;
boolean fromAPI = false;
}
}
catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW , e);
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
}
@RequestMapping(value={"/brms_dictionary/remove_brmsParam"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeBRMSParamDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeBRMSParamDictionary(HttpServletRequest request, HttpServletResponse response)throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/brms_dictionary/save_BRMSDependencyData"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveBRMSDependencyDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveBRMSDependencyDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try {
boolean duplicateflag = false;
LOGGER.debug("DictionaryController: saveBRMSDependencyDictionary() is called");
try{
dependency = PolicyUtils.jsonStringToObject(brmsDependency.getDependency(), PEDependency.class);
}catch(Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_SCHEMA_INVALID + "wrong data given for BRMS PEDependency Dictionary : " + brmsDependency.getDependency());
+ LOGGER.error(XACMLErrorConstants.ERROR_SCHEMA_INVALID + "wrong data given for BRMS PEDependency Dictionary : " + brmsDependency.getDependency(),e);
}
if(dependency==null){
responseString = "Error";
}
@RequestMapping(value={"/brms_dictionary/remove_brmsDependency"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeBRMSDependencyDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeBRMSDependencyDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/brms_dictionary/save_BRMSControllerData"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveBRMSControllerDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveBRMSControllerDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
LOGGER.debug("DictionaryController: saveBRMSControllerDictionary() is called");
try{
dependency = PolicyUtils.jsonStringToObject(brmsController.getController(), PEDependency.class);
}catch(Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_SCHEMA_INVALID + "wrong data given for BRMS Controller Dictionary : " + brmsController.getController());
+ LOGGER.error(XACMLErrorConstants.ERROR_SCHEMA_INVALID + "wrong data given for BRMS Controller Dictionary : " + brmsController.getController(),e);
}
if(dependency==null){
responseString = "Error";
}
@RequestMapping(value={"/brms_dictionary/remove_brmsController"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeBRMSControllerDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeBRMSControllerDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
package org.onap.policy.pap.xacml.rest.controller;
+import java.io.IOException;
import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
}
@RequestMapping(value={"/cl_dictionary/save_vsclAction"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveVSCLAction(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveVSCLAction(HttpServletRequest request, HttpServletResponse response)throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/cl_dictionary/remove_VsclAction"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeVSCLAction(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeVSCLAction(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/cl_dictionary/save_vnfType"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveVnfType(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveVnfType(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/cl_dictionary/remove_vnfType"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeVnfType(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeVnfType(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/cl_dictionary/save_pepOptions"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView savePEPOptions(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView savePEPOptions(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/cl_dictionary/remove_pepOptions"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removePEPOptions(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removePEPOptions(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/cl_dictionary/save_service"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveServiceType(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveServiceType(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/cl_dictionary/remove_Service"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeServiceType(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeServiceType(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/cl_dictionary/save_siteName"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveSiteType(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveSiteType(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/cl_dictionary/remove_site"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeSiteType(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeSiteType(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/cl_dictionary/save_varbind"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveVarbind(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveVarbind(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/cl_dictionary/remove_varbindDict"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeVarbind(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeVarbind(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
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.Date;
import java.util.HashMap;
}
@RequestMapping(value={"/decision_dictionary/save_Settings"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveSettingsDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveSettingsDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/settings_dictionary/remove_settings"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeSettingsDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeSettingsDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/decision_dictionary/save_RainyDay"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveRainyDayDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveRainyDayDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/decision_dictionary/remove_rainyDay"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeRainyDayDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeRainyDayDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
package org.onap.policy.pap.xacml.rest.controller;
+import java.io.IOException;
import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
}
@RequestMapping(value={"/descriptive_dictionary/save_descriptive"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveDescriptiveDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveDescriptiveDictionary(HttpServletRequest request, HttpServletResponse response)throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/descriptive_dictionary/remove_descriptiveScope"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeDescriptiveDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeDescriptiveDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
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.Date;
import java.util.HashMap;
}
@RequestMapping(value={"/attribute_dictionary/save_attribute"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveAttributeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveAttributeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/attribute_dictionary/remove_attribute"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeAttributeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeAttributeDictionary(HttpServletRequest request, HttpServletResponse response)throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/onap_dictionary/save_onapName"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveOnapDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveOnapDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/onap_dictionary/remove_onap"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeOnapDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeOnapDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
+import java.io.IOException;
import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
@RequestMapping(value={"/dictionary/import_dictionary"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public void ImportDictionaryData(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public void ImportDictionaryData(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
//JsonNode root = mapper.readTree(request.getReader());
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.HashMap;
import java.util.List;
}
@RequestMapping(value={"/enforcer_dictionary/save_enforcerType"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveEnforcerDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveEnforcerDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
out.write(e.getMessage());
+ LOGGER.error(e);
}
return null;
}
@RequestMapping(value={"/enforcer_dictionary/remove_enforcer"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeEnforcerDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeEnforcerDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
package org.onap.policy.pap.xacml.rest.controller;
+import java.io.IOException;
import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Date;
response.getWriter().write(j.toString());
}
catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW, e);
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
response.addHeader("error", "dictionaryDBQuery");
}
}
@RequestMapping(value={"/fw_dictionary/save_prefixList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView savePrefixListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView savePrefixListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
return null;
}
}catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW, e);
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
}
@RequestMapping(value={"/fw_dictionary/remove_PrefixList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removePrefixListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removePrefixListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/fw_dictionary/validate_prefixList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView validatePrefixListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView validatePrefixListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
try{
CIDR.newCIDR(prefixList.getPrefixListValue());
}catch(UnknownHostException e){
+ LOGGER.error(e);
responseValidation = "error";
}
response.setCharacterEncoding("UTF-8");
}
@RequestMapping(value={"/fw_dictionary/save_portName"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView savePortListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView savePortListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
ObjectMapper mapper = new ObjectMapper();
}
@RequestMapping(value={"/fw_dictionary/remove_PortList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removePortListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removePortListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/fw_dictionary/save_protocolList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveProtocolListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveProtocolListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/fw_dictionary/remove_protocol"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeProtocolListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeProtocolListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/fw_dictionary/save_addressGroup"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveAddressGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveAddressGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/fw_dictionary/remove_AddressGroup"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeAddressGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeAddressGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/fw_dictionary/save_ActionList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveActionListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveActionListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/fw_dictionary/remove_ActionList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeActionListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeActionListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/fw_dictionary/save_serviceGroup"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveServiceGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveServiceGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/fw_dictionary/remove_serviceGroup"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeServiceGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeServiceGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/fw_dictionary/save_securityZone"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveSecurityZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveSecurityZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/fw_dictionary/remove_securityZone"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeSecurityZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeSecurityZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/fw_dictionary/save_serviceList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveServiceListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveServiceListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/fw_dictionary/remove_serviceList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeServiceListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeServiceListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/fw_dictionary/save_zoneName"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/fw_dictionary/remove_zone"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/fw_dictionary/save_termList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveTermListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveTermListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
@RequestMapping(value={"/fw_dictionary/remove_termList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeTermListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeTermListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/fw_dictionary/save_FWDictionaryList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveFWDictionaryList(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveFWDictionaryList(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
ObjectMapper mapper = new ObjectMapper();
}
@RequestMapping(value={"/fw_dictionary/remove_FWDictionaryList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeFWDictionaryListy(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeFWDictionaryListy(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/fw_dictionary/save_fwTagPicker"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveFirewallTagPickerDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveFirewallTagPickerDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean fromAPI = false;
}
@RequestMapping(value={"/fw_dictionary/remove_tagPicker"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeFirewallTagPickerDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeFirewallTagPickerDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/fw_dictionary/save_fwTag"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveFirewallTagDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView saveFirewallTagDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean fromAPI = false;
}
@RequestMapping(value={"/fw_dictionary/remove_tagList"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeFirewallTagDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removeFirewallTagDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
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;
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;
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);
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;
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);
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;
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);
response.getWriter().write(j.toString());
}
catch (Exception e){
- LOGGER.error(e.getMessage());
+ LOGGER.error(e);
}
}
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;
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);
return null;
}
catch (Exception e){
- LOGGER.error(e.getMessage());
+ LOGGER.error(e);
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
response.getWriter().write(j.toString());
}
catch (Exception e){
- LOGGER.error(e.getMessage());
+ LOGGER.error(e);
}
}
response.getWriter().write(j.toString());
}
catch (Exception e){
- LOGGER.error(e.getMessage());
+ LOGGER.error(e);
}
}
catch (Exception e){
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
response.addHeader(ERROR, DICTIONARYDBQUERY);
- LOGGER.error(e.getMessage());
+ LOGGER.error(e);
}
}
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;
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);
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.HashMap;
import java.util.List;
}
@RequestMapping(value={"/ps_dictionary/save_psGroupPolicyScope"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView savePSGroupScopeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView savePSGroupScopeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
groupData.setClosedloop(root.get("dictionaryFields").get("closedloop").toString().replace("\"", ""));
groupData.setService(root.get("dictionaryFields").get("service").toString().replace("\"", ""));
groupData.setType(root.get("dictionaryFields").get("type").toString().replace("\"", ""));
+ LOGGER.error(e);
}
if(!gpdata.getGroupName().startsWith("PolicyScope")){
try{
groupData = (GroupPolicyScope)mapper.readValue(root.get("groupPolicyScopeListData1").toString(), GroupPolicyScope.class);
}catch(Exception e){
+ LOGGER.error(e);
groupData = new GroupPolicyScope();
groupData.setResource(root.get("groupPolicyScopeListData1").get("resource").toString().replace("\"", ""));
groupData.setClosedloop(root.get("groupPolicyScopeListData1").get("closedloop").toString().replace("\"", ""));
return null;
}
}catch (Exception e){
+ LOGGER.error(e);
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
out.write(e.getMessage());
+
}
return null;
}
@RequestMapping(value={"/ps_dictionary/remove_GroupPolicyScope"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removePSGroupScopeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removePSGroupScopeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/ps_dictionary/save_psClosedLoop"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView savePSClosedLoopDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView savePSClosedLoopDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
out.write(e.getMessage());
+ LOGGER.error(e);
}
return null;
}
@RequestMapping(value={"/ps_dictionary/remove_PSClosedLoop"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removePSClosedLoopDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removePSClosedLoopDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/ps_dictionary/save_psService"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView savePSServiceDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView savePSServiceDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
out.write(e.getMessage());
+ LOGGER.error(e);
}
return null;
}
@RequestMapping(value={"/ps_dictionary/remove_PSService"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removePSServiceDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removePSServiceDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@RequestMapping(value={"/ps_dictionary/save_psType"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView savePSTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView savePSTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
out.write(e.getMessage());
+ LOGGER.error(e);
}
return null;
}
@RequestMapping(value={"/ps_dictionary/remove_PSType"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removePSTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removePSTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
response.getWriter().write(j.toString());
}
catch (Exception e){
+ LOGGER.error(e);
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
response.addHeader("error", "dictionaryDBQuery");
- LOGGER.error(e);
+
}
}
@RequestMapping(value={"/ps_dictionary/save_psResource"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView savePSResourceDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView savePSResourceDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
}catch (Exception e){
+ LOGGER.error(e);
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
out.write(e.getMessage());
+
}
return null;
}
@RequestMapping(value={"/ps_dictionary/remove_PSResource"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removePSResourceDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public ModelAndView removePSResourceDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
// Create the policy Object
selectedPolicy = new StdPDPPolicy(policyName, true, policyID, selectedURI);
} catch (IOException e) {
- LOGGER.error("Unable to create policy '" + policyName + "': "+ e.getMessage());
+ LOGGER.error("Unable to create policy '" + policyName + "': "+ e.getMessage(),e);
}
try {
new ObjectOutputStream(response.getOutputStream()).writeObject(selectedPolicy);
package org.onap.policy.pap.xacml.rest.controller;
+import java.io.IOException;
import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
response.addHeader("operation", "getDictionary");
response.getWriter().write(j.toString());
} catch (Exception e) {
- LOGGER.error(e.getMessage());
+ LOGGER.error(e);
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
response.addHeader("error", "dictionaryDBQuery");
}
@RequestMapping(value = { "/sp_dictionary/save_riskType" }, method = {
org.springframework.web.bind.annotation.RequestMethod.POST })
public ModelAndView saveRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response)
- throws Exception {
+ throws UnsupportedEncodingException, IOException {
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
return null;
}
}catch (Exception e) {
+ LOGGER.error(e);
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
@RequestMapping(value = { "/sp_dictionary/remove_riskType" }, method = {
org.springframework.web.bind.annotation.RequestMethod.POST })
public ModelAndView removeOnapDictionary(HttpServletRequest request, HttpServletResponse response)
- throws Exception {
+ throws UnsupportedEncodingException, IOException{
try {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return null;
} catch (Exception e) {
+ LOGGER.error(e);
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
response.addHeader("operation", "getDictionary");
response.getWriter().write(j.toString());
} catch (Exception e) {
+ LOGGER.error(e);
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
response.addHeader("error", "dictionaryDBQuery");
- LOGGER.error(e.getMessage());
}
}
@RequestMapping(value = { "/sp_dictionary/save_safePolicyWarning" }, method = {
org.springframework.web.bind.annotation.RequestMethod.POST })
public ModelAndView saveSafePolicyWarningDictionary(HttpServletRequest request, HttpServletResponse response)
- throws Exception {
+ throws UnsupportedEncodingException, IOException {
try {
boolean duplicateflag = false;
boolean isFakeUpdate = false;
}
}catch (Exception e) {
+ LOGGER.error(e);
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
@RequestMapping(value = { "/sp_dictionary/remove_SafePolicyWarning" }, method = {
org.springframework.web.bind.annotation.RequestMethod.POST })
public ModelAndView removeSafePolicyWarningDictionary(HttpServletRequest request, HttpServletResponse response)
- throws Exception {
+ throws UnsupportedEncodingException, IOException {
try {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
}finally{
try{
session.close();
- }catch(Exception e1){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement"+e1);
- throw e1;
+ }catch(HibernateException e1){
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement",e1);
}
}
return data;
import java.nio.file.Paths;
import java.sql.Connection;
import java.sql.DriverManager;
+import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
+ elkURL + ":"+ databseUrl + ":"+ userName + ":"+ password + ":"+ databaseDriver + ":");
}
} catch (Exception e) {
- LOGGER.error("Config File doesn't Exist in the specified Path " + file.toString());
+ LOGGER.error("Config File doesn't Exist in the specified Path " + file.toString(),e);
}
}
}
if(!"decision".equals(_type)){
if(configurationdataid != null){
- String configEntityQuery = "Select * from ConfigurationDataEntity where configurationDataId = "+configurationdataid+"";
- Statement configstmt = conn.createStatement();
- ResultSet configResult = configstmt.executeQuery(configEntityQuery);
+ String configEntityQuery = "Select * from ConfigurationDataEntity where configurationDataId = ?";
+ PreparedStatement pstmt = null;
+ pstmt = conn.prepareStatement(configEntityQuery);
+ pstmt.setString(1, configurationdataid);
+ ResultSet configResult = pstmt.executeQuery();
while(configResult.next()){
String configBody = configResult.getString("configbody");
String configType = configResult.getString("configtype");
}
if(actionbodyid != null){
- String actionEntityQuery = "Select * from ActionBodyEntity where actionBodyId = "+actionbodyid+"";
- Statement actionstmt = conn.createStatement();
- ResultSet actionResult = actionstmt.executeQuery(actionEntityQuery);
+ String actionEntityQuery = "Select * from ActionBodyEntity where actionBodyId = ?";
+ PreparedStatement pstmt = null;
+ pstmt = conn.prepareStatement(actionEntityQuery);
+ pstmt.setString(1, actionbodyid);
+ ResultSet actionResult = pstmt.executeQuery();
while(actionResult.next()){
String actionBody = actionResult.getString("actionbody");
policyDataString.append("\"jsonBodyData\":"+actionBody+",");
Gson gson = new Gson();
gson.fromJson(dataString, Object.class);
}catch(Exception e){
+ LOGGER.error(e);
continue;
}
String[] splitPolicyName = policyName.split(":");
indexType = ElkConnector.toPolicyIndexType(splitPolicyName[1]);
} catch (IllegalArgumentException e) {
+ LOGGER.error(e);
throw new IllegalStateException("ELK: Index: " + ELK_INDEX_POLICY + e.getMessage());
}
PolicyElasticData elasticData = new PolicyElasticData(policyData);
package org.onap.policy.pap.xacml.rest.elk.client;
+import java.io.IOException;
import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.X509Certificate;
psGroupPolicy, safeRisk, safePolicyWarning
}
- public static final HashMap<String, String> name2jsonPath = new HashMap<String, String>() {
+ protected static final HashMap<String, String> name2jsonPath = new HashMap<String, String>() {
private static final long serialVersionUID = 1L;
};
}catch(Exception e){
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
response.addHeader("error", "Exception Occured While Performing Elastic Transaction");
- LOGGER.error("Exception Occured While Performing Elastic Transaction"+e.getMessage());
+ LOGGER.error("Exception Occured While Performing Elastic Transaction"+e.getMessage(),e);
}
}
@RequestMapping(value={"/searchDictionary"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView searchDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public ModelAndView searchDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
try{
PolicyIndexType config = PolicyIndexType.config;
PolicyIndexType closedloop = PolicyIndexType.closedloop;
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
out.write(e.getMessage());
+ LOGGER.error(e);
}
return null;
}
package org.onap.policy.pap.xacml.rest.handler;
import java.io.IOException;
+import java.sql.SQLException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
}
}
- public void doDelete(HttpServletRequest request, HttpServletResponse response, ONAPLoggingContext loggingContext, String apiflag) throws Exception {
+ public void doDelete(HttpServletRequest request, HttpServletResponse response, ONAPLoggingContext loggingContext, String apiflag) throws IOException, SQLException{
DeleteHandler deleteHandler = DeleteHandler.getInstance();
if ("deletePapApi".equalsIgnoreCase(apiflag)) {
deleteHandler.doAPIDeleteFromPAP(request, response, loggingContext);
import org.onap.policy.common.logging.ONAPLoggingContext;
import org.onap.policy.common.logging.eelf.MessageCodes;
import org.onap.policy.common.logging.eelf.PolicyLogger;
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.pap.xacml.rest.XACMLPapServlet;
import org.onap.policy.pap.xacml.rest.components.PolicyDBDaoTransaction;
import org.onap.policy.pap.xacml.rest.elk.client.PolicyElasticSearchController;
import org.onap.policy.xacml.api.pap.OnapPDPGroup;
import org.onap.policy.xacml.std.pap.StdPAPPolicy;
import org.onap.policy.xacml.std.pap.StdPDPGroup;
-
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
import com.att.research.xacml.api.pap.PAPException;
import com.att.research.xacml.api.pap.PDPPolicy;
import com.att.research.xacml.util.XACMLProperties;
public class DeleteHandler {
private OnapPDPGroup newgroup;
-
+ private static Logger logger = FlexLogger.getLogger(DeleteHandler.class);
+
private static String papDbDriver = null;
private static String papDbUrl = null;
private static String papDbUser = null;
private static String papDbPassword = null;
- public void doAPIDeleteFromPAP(HttpServletRequest request, HttpServletResponse response, ONAPLoggingContext loggingContext) throws Exception {
+ public static void doAPIDeleteFromPAP(HttpServletRequest request, HttpServletResponse response, ONAPLoggingContext loggingContext) throws IOException, SQLException {
// get the request content into a String
String json = null;
java.util.Scanner scanner = new java.util.Scanner(request.getInputStream());
policyVersionDeleted = true;
em.remove(pVersion);
}catch(Exception e){
+ logger.error(e.getMessage(),e);
policyVersionDeleted = false;
}
}
policyVersionDeleted = true;
em.persist(pVersion);
}catch(Exception e){
+ logger.error(e.getMessage(),e);
policyVersionDeleted = false;
}
}else{
policyVersionDeleted = true;
em.remove(pVersion);
}catch(Exception e){
+ logger.error(e.getMessage(),e);
policyVersionDeleted = false;
}
}
}
}
- public String deletePolicyEntityData(EntityManager em, PolicyEntity policyEntity) throws SQLException{
+ public static String deletePolicyEntityData(EntityManager em, PolicyEntity policyEntity) throws SQLException{
PolicyElasticSearchController controller = new PolicyElasticSearchController();
PolicyRestAdapter policyData = new PolicyRestAdapter();
String policyName = policyEntity.getPolicyName();
controller.deleteElk(policyData);
em.remove(policyEntity);
}catch(Exception e){
+ logger.error(e.getMessage(),e);
return "error";
}
return "success";
}
- public boolean checkPolicyGroupEntity(EntityManager em, Connection con, List<?> peResult) throws SQLException{
+ public static boolean checkPolicyGroupEntity(EntityManager em, Connection con, List<?> peResult) throws SQLException{
for(Object peData : peResult){
PolicyEntity policyEntity = (PolicyEntity) peData;
Statement st = null;
DeleteHandler instance = (DeleteHandler) deleteHandler.newInstance();
return instance;
} catch (Exception e) {
- PolicyLogger.error(e.getMessage());
+ logger.error(e.getMessage(),e);
}
return null;
}
import javax.servlet.http.HttpServletResponse;
import org.onap.policy.common.logging.eelf.PolicyLogger;
-
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
import com.att.research.xacml.util.XACMLProperties;
public interface DictionaryHandler {
+ public static final Logger logger = FlexLogger.getLogger(DictionaryHandler.class);
String DICTIONARY_DEFAULT_CLASS = DictionaryHandlerImpl.class.getName();
/*
DictionaryHandler instance = (DictionaryHandler) dictionaryHandler.newInstance();
return instance;
} catch (Exception e) {
- PolicyLogger.error(e.getMessage());
+ logger.error(e.getMessage(),e);
}
return null;
}
import org.onap.policy.rest.jpa.PolicyVersion;
import org.onap.policy.xacml.api.pap.OnapPDPGroup;
import org.onap.policy.xacml.std.pap.StdPDPPolicy;
-
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
import com.att.research.xacml.util.XACMLProperties;
public class PushPolicyHandler {
-
+ private static final Logger logger = FlexLogger.getLogger(PushPolicyHandler.class);
/*
* Get Active Version.
*/
PushPolicyHandler instance = (PushPolicyHandler) pushPolicyHandler.newInstance();
return instance;
} catch (Exception e) {
- PolicyLogger.error(e.getMessage());
+ logger.error(e.getMessage(),e);
}
return null;
}
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.parsers.ParserConfigurationException;
-
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.common.logging.eelf.PolicyLogger;
import org.onap.policy.pap.xacml.rest.XACMLPapServlet;
import org.onap.policy.pap.xacml.rest.policycontroller.PolicyCreation;
import com.att.research.xacml.util.XACMLProperties;
public class SavePolicyHandler {
+ private static final Logger logger = FlexLogger.getLogger(SavePolicyHandler.class);
private HashMap<String, String> ErrorHeaders = null;
public void doPolicyAPIPut(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.addHeader("operation", "create");
}
} catch (Exception e1) {
- PolicyLogger.error(XACMLErrorConstants.ERROR_UNKNOWN +
- "Could not set data to policy adapter "+ e1.getMessage());
+ logger.error("Could not set data to policy adapter "+e1.getMessage(),e1);
}
}
}
SavePolicyHandler instance = (SavePolicyHandler) savePolicyHandler.newInstance();
return instance;
} catch (Exception e) {
- PolicyLogger.error(e.getMessage());
+ logger.error(e.getMessage(),e);
}
return null;
}
/**
* String identifier of a file's "Id" property.
*/
- public static String PROPERTY_ID = "Id";
+ public static final String PROPERTY_ID = "Id";
/**
* String identifier of a file's "name" property.
*/
- public static String PROPERTY_NAME = "Name";
+ public static final String PROPERTY_NAME = "Name";
/**
* String identifier of a file's "name" property.
*/
- public static String PROPERTY_VERSION = "Version";
+ public static final String PROPERTY_VERSION = "Version";
/**
* String identifier of a file's "Description" property.
*/
- public static String PROPERTY_DESCRIPTION = "Description";
+ public static final String PROPERTY_DESCRIPTION = "Description";
/**
* String identifier of a file's "IsRoot" property.
*/
- public static String PROPERTY_ISROOT = "Root";
+ public static final String PROPERTY_ISROOT = "Root";
/**
* List of the string identifiers for the available properties.
response.addHeader("error", "error");
}
}catch(Exception e){
+ LOGGER.error("Exception Occured : ",e);
if(policyDBDaoTransaction != null){
policyDBDaoTransaction.rollbackTransaction();
}
}
}
catch (Exception e){
- LOGGER.error("Exception Occured : "+e);
+ LOGGER.error("Exception Occured : "+e.getMessage(),e);
body = "error";
response.addHeader("error", e.getMessage());
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
*/
package org.onap.policy.pap.xacml.rest.service;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/*
* Methods that call the controller method directly to Save and Update dictionary data
*/
- public String saveOnapDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveOnapDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
DictionaryController dictionary = new DictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveOnapDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
-
return responseString;
}
- public String saveAttributeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveAttributeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
DictionaryController dictionary = new DictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveAttributeDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
-
return responseString;
}
- public String saveActionPolicyDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveActionPolicyDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
ActionPolicyDictionaryController action = new ActionPolicyDictionaryController();
String responseString = null;
- try {
ModelAndView result = action.saveActionPolicyDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
-
return responseString;
}
- public String saveBRMSParamDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveBRMSParamDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
BRMSDictionaryController dictionary = new BRMSDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveBRMSParamDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
-
return responseString;
}
- public String saveVSCLAction(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveVSCLAction(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ClosedLoopDictionaryController dictionary = new ClosedLoopDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveVSCLAction(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
-
return responseString;
}
- public String saveVnfType(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveVnfType(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ClosedLoopDictionaryController dictionary = new ClosedLoopDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveVnfType(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
-
return responseString;
}
- public String savePEPOptions(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String savePEPOptions(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ClosedLoopDictionaryController dictionary = new ClosedLoopDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.savePEPOptions(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
-
return responseString;
}
- public String saveVarbind(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveVarbind(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ClosedLoopDictionaryController dictionary = new ClosedLoopDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveVarbind(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
-
return responseString;
}
- public String saveServiceType(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveServiceType(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ClosedLoopDictionaryController dictionary = new ClosedLoopDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveServiceType(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
-
return responseString;
}
- public String saveSiteType(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveSiteType(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ClosedLoopDictionaryController dictionary = new ClosedLoopDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveSiteType(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
-
return responseString;
}
- public String saveSettingsDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveSettingsDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
DecisionPolicyDictionaryController dictionary = new DecisionPolicyDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveSettingsDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveDescriptiveDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveDescriptiveDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
DescriptiveDictionaryController dictionary = new DescriptiveDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveDescriptiveDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveEnforcerDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveEnforcerDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
EnforcerDictionaryController dictionary = new EnforcerDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveEnforcerDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveActionListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveActionListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveActionListDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveProtocolListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveProtocolListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveProtocolListDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveZoneDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveSecurityZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveSecurityZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveSecurityZoneDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String savePrefixListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String savePrefixListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.savePrefixListDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveAddressGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveAddressGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveAddressGroupDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveServiceGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveServiceGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveServiceGroupDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveServiceListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveServiceListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveServiceListDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveTermListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveTermListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveTermListDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveMicroServiceLocationDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveMicroServiceLocationDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
MicroServiceDictionaryController dictionary = new MicroServiceDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveMicroServiceLocationDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveMicroServiceConfigNameDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveMicroServiceConfigNameDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
MicroServiceDictionaryController dictionary = new MicroServiceDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveMicroServiceConfigNameDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveDCAEUUIDDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveDCAEUUIDDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
MicroServiceDictionaryController dictionary = new MicroServiceDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveDCAEUUIDDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveMicroServiceModelsDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveMicroServiceModelsDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
MicroServiceDictionaryController dictionary = new MicroServiceDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveMicroServiceModelsDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveMicroServiceDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveMicroServiceDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
MicroServiceDictionaryController dictionary = new MicroServiceDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveMicroServiceAttributeDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String savePSServiceDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String savePSServiceDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
PolicyScopeDictionaryController dictionary = new PolicyScopeDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.savePSServiceDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String savePSResourceDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String savePSResourceDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
PolicyScopeDictionaryController dictionary = new PolicyScopeDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.savePSResourceDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String savePSTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String savePSTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
PolicyScopeDictionaryController dictionary = new PolicyScopeDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.savePSTypeDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String savePSClosedLoopDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String savePSClosedLoopDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
PolicyScopeDictionaryController dictionary = new PolicyScopeDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.savePSClosedLoopDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String savePSGroupScopeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String savePSGroupScopeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
PolicyScopeDictionaryController dictionary = new PolicyScopeDictionaryController();
String responseString = null;
- try {
ModelAndView result = dictionary.savePSGroupScopeDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
+ public String saveRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
SafePolicyController dictionary = new SafePolicyController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveRiskTypeDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
- public String saveSafePolicyWarningDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public String saveSafePolicyWarningDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
SafePolicyController dictionary = new SafePolicyController();
String responseString = null;
- try {
ModelAndView result = dictionary.saveSafePolicyWarningDictionary(request, response);
responseString = result.getViewName();
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
return responseString;
}
/*
* Methods that call the controller get methods directly to get dictionary data
*/
- public void getOnapDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getOnapDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
DictionaryController dictionary = new DictionaryController();
- try {
dictionary.getOnapNameDictionaryEntityData(request, response);
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getAttributeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getAttributeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
DictionaryController dictionary = new DictionaryController();
- try {
dictionary.getAttributeDictionaryEntityData(request, response);
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getActionPolicyDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getActionPolicyDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ActionPolicyDictionaryController action = new ActionPolicyDictionaryController();
- try {
action.getActionPolicyDictionaryEntityData(request, response);
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getBRMSParamDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getBRMSParamDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
BRMSDictionaryController dictionary = new BRMSDictionaryController();
- try {
dictionary.getBRMSParamDictionaryEntityData(request, response);
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
}
- public void getVSCLAction(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getVSCLAction(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ClosedLoopDictionaryController dictionary = new ClosedLoopDictionaryController();
- try {
dictionary.getVSCLActionDictionaryEntityData(request, response);
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getVnfType(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getVnfType(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ClosedLoopDictionaryController dictionary = new ClosedLoopDictionaryController();
- try {
dictionary.getVNFTypeDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
}
- public void getPEPOptions(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getPEPOptions(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ClosedLoopDictionaryController dictionary = new ClosedLoopDictionaryController();
- try {
dictionary.getPEPOptionsDictionaryEntityData(request, response);
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getVarbind(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getVarbind(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ClosedLoopDictionaryController dictionary = new ClosedLoopDictionaryController();
- try {
dictionary.getVarbindDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
-
}
- public void getServiceType(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getServiceType(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ClosedLoopDictionaryController dictionary = new ClosedLoopDictionaryController();
- try {
dictionary.getClosedLoopServiceDictionaryEntityData(request, response);
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getSiteType(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getSiteType(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
ClosedLoopDictionaryController dictionary = new ClosedLoopDictionaryController();
- try {
dictionary.getClosedLoopSiteDictionaryEntityData(request, response);
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getSettingsDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getSettingsDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
DecisionPolicyDictionaryController dictionary = new DecisionPolicyDictionaryController();
- try {
dictionary.getSettingsDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getDescriptiveDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getDescriptiveDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
DescriptiveDictionaryController dictionary = new DescriptiveDictionaryController();
- try {
dictionary.getDescriptiveDictionaryEntityData(request, response);
-
- } catch (Exception e) {
-
- }
}
- public void getEnforcerDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getEnforcerDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
EnforcerDictionaryController dictionary = new EnforcerDictionaryController();
- try {
dictionary.getEnforcerDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getActionListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getActionListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
- try {
dictionary.getActionListDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getProtocolListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getProtocolListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
- try {
dictionary.getProtocolListDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
- try {
dictionary.getZoneDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getSecurityZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getSecurityZoneDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
- try {
dictionary.getSecurityZoneDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getPrefixListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getPrefixListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
- try {
dictionary.getPrefixListDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getAddressGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getAddressGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
- try {
dictionary.getAddressGroupDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getServiceGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getServiceGroupDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
- try {
dictionary.getServiceGroupDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getServiceListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getServiceListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
- try {
dictionary.getServiceListDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getTermListDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getTermListDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
FirewallDictionaryController dictionary = new FirewallDictionaryController();
- try {
dictionary.getTermListDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getMicroServiceLocationDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getMicroServiceLocationDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
MicroServiceDictionaryController dictionary = new MicroServiceDictionaryController();
- try {
dictionary.getMicroServiceLocationDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getMicroServiceConfigNameDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getMicroServiceConfigNameDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
MicroServiceDictionaryController dictionary = new MicroServiceDictionaryController();
- try {
dictionary.getMicroServiceConfigNameDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getDCAEUUIDDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getDCAEUUIDDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
MicroServiceDictionaryController dictionary = new MicroServiceDictionaryController();
- try {
dictionary.getDCAEUUIDDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getMicroServiceModelsDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getMicroServiceModelsDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
MicroServiceDictionaryController dictionary = new MicroServiceDictionaryController();
- try {
dictionary.getMicroServiceModelsDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getMicroServiceDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getMicroServiceDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
MicroServiceDictionaryController dictionary = new MicroServiceDictionaryController();
- try {
dictionary.getMicroServiceModelsDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getPSServiceDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getPSServiceDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
PolicyScopeDictionaryController dictionary = new PolicyScopeDictionaryController();
- try {
dictionary.getPSServiceEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getPSResourceDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getPSResourceDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
PolicyScopeDictionaryController dictionary = new PolicyScopeDictionaryController();
- try {
dictionary.getPSResourceEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getPSTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getPSTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
PolicyScopeDictionaryController dictionary = new PolicyScopeDictionaryController();
- try {
dictionary.getPSTypeEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getPSClosedLoopDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getPSClosedLoopDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
PolicyScopeDictionaryController dictionary = new PolicyScopeDictionaryController();
- try {
dictionary.getPSClosedLoopEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getPSGroupScopeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getPSGroupScopeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
PolicyScopeDictionaryController dictionary = new PolicyScopeDictionaryController();
- try {
dictionary.getGroupPolicyScopeEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
SafePolicyController dictionary = new SafePolicyController();
- try {
dictionary.getOnapNameDictionaryEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
- public void getSafePolicyWarningDictionary(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ public void getSafePolicyWarningDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
SafePolicyController dictionary = new SafePolicyController();
- try {
dictionary.getSafePolicyWarningeEntityData(request, response);
-
- } catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
-
- }
}
}
\ No newline at end of file
import javax.servlet.http.HttpServletResponse;
import org.onap.policy.common.logging.eelf.PolicyLogger;
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.pap.xacml.rest.components.CreateBRMSRuleTemplate;
import org.onap.policy.pap.xacml.rest.components.CreateNewMicroServiceModel;
+import org.onap.policy.pap.xacml.rest.model.PDPPolicyContainer;
public class ImportService {
-
+ private static final Logger logger = FlexLogger.getLogger(ImportService.class);
public void doImportMicroServicePut(HttpServletRequest request, HttpServletResponse response) {
String importServiceCreation = request.getParameter("importService");;
String fileName = request.getParameter("fileName");
builder.append((char)ch);
}
} catch (IOException e) {
+ logger.error(e);
PolicyLogger.error("Error in reading in file from API call");
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
response.addHeader("error", "missing");
xmi = scanner.hasNext() ? scanner.next() : "";
scanner.close();
} catch (IOException e1) {
+ logger.error(e1);
PolicyLogger.error("Error in reading in file from API call");
return;
}
new FileOutputStream("ExtractDir" + File.separator + randomID+".xmi"), "utf-8"))) {
writer.write(xmi);
} catch (IOException e) {
+ logger.error(e);
PolicyLogger.error("Error in reading in file from API call");
return;
}
public class JPAUtils {
private static Logger LOGGER = FlexLogger.getLogger(JPAUtils.class);
- private EntityManagerFactory emf;
+ private static EntityManagerFactory emf;
private static final Object mapAccess = new Object();
private static Map<Datatype, List<FunctionDefinition>> mapDatatype2Function = null;
private static Map<String, FunctionDefinition> mapID2Function = null;
* @return The new instance of JPAUtils or throw exception if the given emf is null.
* @throws IllegalStateException if a JPAUtils has already been constructed. Call getJPAUtilsInstance() to get this.
*/
- public static JPAUtils getJPAUtilsInstance(EntityManagerFactory emf) throws Exception{
+ public static JPAUtils getJPAUtilsInstance(EntityManagerFactory emf){
LOGGER.debug("getJPAUtilsInstance(EntityManagerFactory emf) as getJPAUtilsInstance("+emf+") called");
if(currentInstance == null){
if(emf != null){
* @return The instance of JPAUtils or throws exception if the given instance is null.
* @throws IllegalStateException if a JPAUtils instance is null. Call getJPAUtilsInstance(EntityManagerFactory emf) to get this.
*/
- public static JPAUtils getJPAUtilsInstance() throws Exception{
+ public static JPAUtils getJPAUtilsInstance(){
LOGGER.debug("getJPAUtilsInstance() as getJPAUtilsInstance() called");
if(currentInstance != null){
return currentInstance;
throw new IllegalStateException("The JPAUtils.currentInstance is Null. Use getJPAUtilsInstance(EntityManagerFactory emf)");
}
- public static AttributeDesignatorType createDesignator(Attribute attribute) {
+ public static AttributeDesignatorType createDesignator(Attribute attribute) {
AttributeDesignatorType designator = new AttributeDesignatorType();
designator.setAttributeId(attribute.getXacmlId());
if (attribute.getCategoryBean() != null) {
public Map<String, FunctionDefinition> getFunctionIDMap() {
synchronized(mapAccess) {
- if (mapID2Function == null||mapID2Function.equals("{}")) {
+ if (mapID2Function == null||mapID2Function.isEmpty()) {
try {
buildFunctionMaps();
} catch (ServletException e) {
return mapID2Function;
}
- private void buildFunctionMaps() throws ServletException {
+ private static void buildFunctionMaps() throws ServletException {
mapDatatype2Function = new HashMap<>();
mapID2Function = new HashMap<>();