X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ONAP-PDP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpdp%2Frest%2Fapi%2Fservices%2FNotificationService.java;h=3806d26d9081838bf09206ae8992ac06a5e92294;hb=c5d97e8a9a6bea71f3be329a2e44bdbe5fe50882;hp=c1b9f63e1a158de536e72ee138dc66ddd694c1d9;hpb=073cc188efe9abb4c010cf674e34e2cf46ef1c52;p=policy%2Fengine.git diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/NotificationService.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/NotificationService.java index c1b9f63e1..3806d26d9 100644 --- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/NotificationService.java +++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/NotificationService.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. @@ -99,7 +99,7 @@ public class NotificationService { dmaapServers = XACMLProperties.getProperty(XACMLRestProperties.PROP_NOTIFICATION_SERVERS); aafLogin = XACMLProperties.getProperty("DMAAP_AAF_LOGIN"); aafPassword = XACMLProperties.getProperty("DMAAP_AAF_PASSWORD"); - interval = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_NOTIFICATION_DELAY, Integer.toString(interval))); + interval = Integer.parseInt(XACMLProperties.getProperty("CLIENT_INTERVAL", Integer.toString(interval))); if(dmaapServers==null || aafLogin==null || aafPassword==null){ logger.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "DMaaP properties are missing from the property file "); return; @@ -118,6 +118,13 @@ public class NotificationService { callThread(); } } + + public static void reloadProps(){ + dmaapServers = null; + aafLogin = null; + aafPassword = null; + backUpthread = null; + } private void run(String notificationTopic, NotificationServiceType serviceType) throws PolicyException{ // Check Validation @@ -262,7 +269,7 @@ public class NotificationService { Date currentTime = new Date(); long timeDiff = 0; timeDiff = currentTime.getTime()-map.getValue().getTime(); - if(timeDiff < (interval+1500)){ + if(timeDiff > (interval+1500)){ removeTopic(map.getKey()); } } @@ -297,8 +304,9 @@ public class NotificationService { aafLogin, aafPassword); // Sending notification through DMaaP Message Router + logger.info("NotificationService: send DMaaP Message. "); publisher.send( "MyPartitionKey", notification); - logger.debug("Message Published on DMaaP :" + dmaapList.get(0) + "for Topic: " + topic); + logger.info("Message Published on DMaaP :" + dmaapList.get(0) + "for Topic: " + topic); publisher.close(); }