X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ONAP-PDP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpdp%2Frest%2FXACMLPdpLoader.java;h=5c9f8602f0c2d4e9d7a89dbee7b961fb42a5c9d5;hb=c5d97e8a9a6bea71f3be329a2e44bdbe5fe50882;hp=7526af6920d66297cfc923b9d399f3098dc9f497;hpb=073cc188efe9abb4c010cf674e34e2cf46ef1c52;p=policy%2Fengine.git 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..5c9f8602f 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 @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PDP-REST * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,10 +107,12 @@ public class XACMLPdpLoader { // - creating new ".file" properties for files existing // local // + LOGGER.info("XACMLPdpLoader: cache the policies."); XACMLPdpLoader.cachePolicies(policyProperties); // // Validate the policies // + LOGGER.info("XACMLPdpLoader: validating the policies."); XACMLPdpLoader.validatePolicies(policyProperties, status); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Status: " + status); @@ -189,14 +191,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 policyContainer = null; - private static void sendNotification(){ + public static synchronized void sendNotification(){ Thread notify = new Thread(){ public void run(){ try{ @@ -217,12 +217,13 @@ public class XACMLPdpLoader { .getReferencedPolicyIDs(properties); policyContainer = new HashMap(); + LOGGER.info("XACMLPdpLoader: load rootPolicies"); for (String id : rootPolicies) { loadPolicy(properties, status, id, true); } // remember which policies were root policies status.addAllLoadedRootPolicies(status.getLoadedPolicies()); - + LOGGER.info("XACMLPdpLoader: load referencedPolicies"); for (String id : refPolicies) { loadPolicy(properties, status, id, false); }