X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=PolicyEngineClient%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2FpolicyEngine%2FHandler.java;h=ea11f9d8d254399cace3d55b9a87fb6d4759fd45;hb=7e547eaa55920dfbc9691eab33bb728395b50cf2;hp=448b54270c858aa5dd3dd0df12b8eb7f64199479;hpb=91d04c64771832a0b8815ffbe1f0f9920320d94d;p=policy%2Fengine.git diff --git a/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/Handler.java b/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/Handler.java index 448b54270..ea11f9d8d 100644 --- a/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/Handler.java +++ b/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/Handler.java @@ -32,9 +32,13 @@ import org.openecomp.policy.api.PolicyConfigStatus; import org.openecomp.policy.api.PolicyEngine; import org.openecomp.policy.api.PolicyEngineException; import org.openecomp.policy.api.RemovedPolicy; +import org.openecomp.policy.common.logging.flexlogger.FlexLogger; +import org.openecomp.policy.common.logging.flexlogger.Logger; public class Handler implements NotificationHandler{ + private static final Logger LOGGER = FlexLogger.getLogger(Handler.class); + @Override public void notificationReceived(PDPNotification notification) { System.out.println("Notification Received..."); @@ -56,6 +60,7 @@ public class Handler implements NotificationHandler{ // Checking the Name is correct or not. try { PolicyEngine policyEngine = new PolicyEngine("config.properties"); + @SuppressWarnings("deprecation") Collection policyConfigs = policyEngine.getConfigByPolicyName(updatedPolicy.getPolicyName()); for(PolicyConfig policyConfig: policyConfigs){ if(policyConfig.getPolicyConfigStatus().equals(PolicyConfigStatus.CONFIG_RETRIEVED)){ @@ -71,9 +76,9 @@ public class Handler implements NotificationHandler{ } } } catch (PolicyEngineException e) { - e.printStackTrace(); + LOGGER.error("Exception Occured"+e); } catch (PolicyConfigException e) { - e.printStackTrace(); + LOGGER.error("Exception Occured"+e); } } } @@ -93,6 +98,7 @@ public class Handler implements NotificationHandler{ // Checking the Name is correct or not. try { PolicyEngine policyEngine = new PolicyEngine("config.properties"); + @SuppressWarnings("deprecation") Collection policyConfigs = policyEngine.getConfigByPolicyName(updatedPolicy.getPolicyName()); for(PolicyConfig policyConfig: policyConfigs){ if(policyConfig.getPolicyConfigStatus().equals(PolicyConfigStatus.CONFIG_RETRIEVED)){ @@ -108,9 +114,9 @@ public class Handler implements NotificationHandler{ } } } catch (PolicyEngineException e) { - e.printStackTrace(); + LOGGER.error("Exception Occured"+e); } catch (PolicyConfigException e) { - e.printStackTrace(); + LOGGER.error("Exception Occured"+e); } } }