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...");
// Checking the Name is correct or not.
try {
PolicyEngine policyEngine = new PolicyEngine("config.properties");
+ @SuppressWarnings("deprecation")
Collection<PolicyConfig> policyConfigs = policyEngine.getConfigByPolicyName(updatedPolicy.getPolicyName());
for(PolicyConfig policyConfig: policyConfigs){
if(policyConfig.getPolicyConfigStatus().equals(PolicyConfigStatus.CONFIG_RETRIEVED)){
}
}
} catch (PolicyEngineException e) {
- e.printStackTrace();
+ LOGGER.error("Exception Occured"+e);
} catch (PolicyConfigException e) {
- e.printStackTrace();
+ LOGGER.error("Exception Occured"+e);
}
}
}
// Checking the Name is correct or not.
try {
PolicyEngine policyEngine = new PolicyEngine("config.properties");
+ @SuppressWarnings("deprecation")
Collection<PolicyConfig> policyConfigs = policyEngine.getConfigByPolicyName(updatedPolicy.getPolicyName());
for(PolicyConfig policyConfig: policyConfigs){
if(policyConfig.getPolicyConfigStatus().equals(PolicyConfigStatus.CONFIG_RETRIEVED)){
}
}
} catch (PolicyEngineException e) {
- e.printStackTrace();
+ LOGGER.error("Exception Occured"+e);
} catch (PolicyConfigException e) {
- e.printStackTrace();
+ LOGGER.error("Exception Occured"+e);
}
}
}