X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FPolicyNotificationController.java;h=21f3793f1224a70315fc55c241224fb55af2491c;hp=73121757336161718818673150b1a35e4089246e;hb=80f072f60509ef3a35369a60857fe05f6c2a993a;hpb=c53fa990ea27ec074859eb94bcb7ec6deaa2157b diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyNotificationController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyNotificationController.java index 731217573..21f3793f1 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyNotificationController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyNotificationController.java @@ -25,6 +25,7 @@ package org.onap.policy.controller; * * */ import java.io.File; +import java.io.IOException; import java.io.PrintWriter; import java.util.List; @@ -33,6 +34,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.json.JSONObject; +import org.onap.policy.common.logging.flexlogger.FlexLogger; +import org.onap.policy.common.logging.flexlogger.Logger; import org.onap.policy.rest.dao.CommonClassDao; import org.onap.policy.rest.jpa.WatchPolicyNotificationTable; import org.openecomp.portalsdk.core.controller.RestrictedBaseController; @@ -50,12 +53,13 @@ import com.fasterxml.jackson.databind.node.ArrayNode; @Controller @RequestMapping({"/"}) public class PolicyNotificationController extends RestrictedBaseController { + private static Logger logger = FlexLogger.getLogger(PolicyNotificationController.class); @Autowired CommonClassDao commonClassDao; @RequestMapping(value={"/watchPolicy"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}) - public ModelAndView watchPolicy(HttpServletRequest request, HttpServletResponse response) throws Exception{ + public ModelAndView watchPolicy(HttpServletRequest request, HttpServletResponse response) throws IOException{ String path = ""; String responseValue = ""; try { @@ -118,6 +122,7 @@ public class PolicyNotificationController extends RestrictedBaseController { }catch(Exception e){ response.setCharacterEncoding("UTF-8"); request.setCharacterEncoding("UTF-8"); + logger.error("Error druing watchPolicy function " + e); PrintWriter out = response.getWriter(); out.write(e.getMessage()); }