summaryrefslogtreecommitdiffstats
path: root/ONAP-PDP-REST
diff options
context:
space:
mode:
Diffstat (limited to 'ONAP-PDP-REST')
-rw-r--r--ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpLoader.java4
-rw-r--r--ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpServlet.java4
-rw-r--r--ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/notifications/NotificationController.java4
3 files changed, 7 insertions, 5 deletions
diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpLoader.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpLoader.java
index 7526af692..9b2b61f76 100644
--- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpLoader.java
+++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpLoader.java
@@ -189,14 +189,12 @@ public class XACMLPdpLoader {
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{
diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpServlet.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpServlet.java
index 1e1b94d9b..d57e88498 100644
--- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpServlet.java
+++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/XACMLPdpServlet.java
@@ -216,6 +216,8 @@ public class XACMLPdpServlet extends HttpServlet implements Runnable {
synchronized(pdpEngineLock) {
pdpEngine = engine;
}
+ // Notification will be Sent Here.
+ XACMLPdpLoader.sendNotification();
}
//
// Logging stuff....
@@ -1228,6 +1230,8 @@ public class XACMLPdpServlet extends HttpServlet implements Runnable {
newStatus.addLoadWarning("Unable to save configuration: " + e.getMessage());
}
}
+ // Notification will be Sent Here.
+ XACMLPdpLoader.sendNotification();
} else {
newStatus.setStatus(Status.LAST_UPDATE_FAILED);
}
diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/notifications/NotificationController.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/notifications/NotificationController.java
index 873db4b6c..109d421f8 100644
--- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/notifications/NotificationController.java
+++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/notifications/NotificationController.java
@@ -361,10 +361,10 @@ public class NotificationController {
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");
}