Fixed the PDP Notification issues by sending Notifcations after the engine is properly loaded.
Issue-Id: POLICY-146
Change-Id: I70bba9adf6e08fb0bafe1364b8fe4a789f70a88e
Signed-off-by: Tarun Tej Velaga <tt3868@att.com>
LOGGER.error(XACMLErrorConstants.ERROR_SYSTEM_ERROR +error, e);
status.addLoadError(error);
}
- // Notification will be Sent Here.
- sendNotification();
return engine;
}
private static HashMap<String, PolicyDef> policyContainer = null;
- private static void sendNotification(){
+ public static synchronized void sendNotification(){
Thread notify = new Thread(){
public void run(){
try{
synchronized(pdpEngineLock) {
pdpEngine = engine;
}
+ // Notification will be Sent Here.
+ XACMLPdpLoader.sendNotification();
}
//
// Logging stuff....
newStatus.addLoadWarning("Unable to save configuration: " + e.getMessage());
}
}
+ // Notification will be Sent Here.
+ XACMLPdpLoader.sendNotification();
} else {
newStatus.setStatus(Status.LAST_UPDATE_FAILED);
}
Files.deleteIfExists(removedPolicyFile);
boolean delete=false;
File dir= null;
- if(oldPolicy.getName().startsWith("Config")){
+ if(oldPolicy.getName().contains(".Config_")){
delete = true;
dir = new File(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_WEBAPPS)+File.separator+"Config");
- }else if(oldPolicy.getName().startsWith("Action")){
+ }else if(oldPolicy.getName().contains(".Action_")){
delete = true;
dir = new File(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_WEBAPPS)+File.separator+"Action");
}