X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=ONAP-PDP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpdp%2Frest%2Fnotifications%2FNotificationController.java;h=974ca5c01b15bd6e6db208521794387fb2eba304;hp=c62872fbd4553c840596eca70e06e2b9f83db692;hb=c2ca6ea5cb44103903e1409e8dd6db80167e61e8;hpb=766f999081e73b301062f1b96bffb9c52d7e9852 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 c62872fbd..974ca5c01 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 @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -44,7 +44,7 @@ import org.onap.policy.api.UpdateType; import org.onap.policy.common.logging.flexlogger.FlexLogger; import org.onap.policy.common.logging.flexlogger.Logger; import org.onap.policy.pdp.rest.PapUrlResolver; -import org.onap.policy.rest.XACMLRestProperties; +import org.onap.policy.rest.XacmlRestProperties; import org.onap.policy.xacml.api.XACMLErrorConstants; import com.att.research.xacml.api.pap.PDPPolicy; @@ -61,7 +61,7 @@ import com.fasterxml.jackson.databind.ObjectWriter; /** * NotificationController Checks for the Updated and Removed policies. It notifies the Server to send Notifications to * the Client. - * + * * @version 0.2 * */ @@ -81,7 +81,7 @@ public class NotificationController { private static Boolean notificationFlag = false; public void check(PDPStatus newStatus, Map policyContainer) { - + LOGGER.info("NotificationController: checking for updated and removed policies."); boolean isUpdated = false; boolean isRemoved = false; @@ -101,7 +101,7 @@ public class NotificationController { LOGGER.info("There is an Update to the PDP"); LOGGER.debug(oldStatus.getLoadedPolicies()); LOGGER.debug(newStatus.getLoadedPolicies()); - + // Check if there is an Update/additions in the policy. LOGGER.info("NotificationController: check for updated or new policies"); for (PDPPolicy newPolicy : newStatus.getLoadedPolicies()) { @@ -191,8 +191,8 @@ public class NotificationController { } private static void setPropNotification() { - propNotificationType = XACMLProperties.getProperty(XACMLRestProperties.PROP_NOTIFICATION_TYPE); - pdpURL = XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_ID); + propNotificationType = XACMLProperties.getProperty(XacmlRestProperties.PROP_NOTIFICATION_TYPE); + pdpURL = XACMLProperties.getProperty(XacmlRestProperties.PROP_PDP_ID); } public static void sendNotification() { @@ -382,7 +382,7 @@ public class NotificationController { private void removeFile(PDPPolicy oldPolicy) { try { - Path removedPolicyFile = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_CONFIG) + Path removedPolicyFile = Paths.get(XACMLProperties.getProperty(XacmlRestProperties.PROP_PDP_CONFIG) + File.separator + oldPolicy.getId()); Files.deleteIfExists(removedPolicyFile); boolean delete = false; @@ -390,11 +390,11 @@ public class NotificationController { if (oldPolicy.getName().contains(".Config_")) { delete = true; dir = new File( - XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_WEBAPPS) + File.separator + "Config"); + XACMLProperties.getProperty(XacmlRestProperties.PROP_PDP_WEBAPPS) + File.separator + "Config"); } else if (oldPolicy.getName().contains(".Action_")) { delete = true; dir = new File( - XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_WEBAPPS) + File.separator + "Action"); + XACMLProperties.getProperty(XacmlRestProperties.PROP_PDP_WEBAPPS) + File.separator + "Action"); } if (delete) { FileFilter fileFilter = new WildcardFileFilter( @@ -412,7 +412,7 @@ public class NotificationController { private void callPap(String urlString, String type) { Path configLocation = Paths - .get(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_WEBAPPS) + File.separator + type); + .get(XACMLProperties.getProperty(XacmlRestProperties.PROP_PDP_WEBAPPS) + File.separator + type); if (Files.notExists(configLocation)) { try { Files.createDirectories(configLocation);