diff options
Diffstat (limited to 'ONAP-PDP-REST')
4 files changed, 10 insertions, 6 deletions
diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/ConfigPolicyService.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/ConfigPolicyService.java index c8d3d74d1..690e94a5e 100644 --- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/ConfigPolicyService.java +++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/ConfigPolicyService.java @@ -82,12 +82,12 @@ public class ConfigPolicyService { message = XACMLErrorConstants.ERROR_DATA_ISSUE + "No Config Name given."; return false; } - message = PolicyUtils.emptyPolicyValidator(onapName); + message = PolicyUtils.policySpecialCharValidator(onapName); if(!message.contains("success")){ message = XACMLErrorConstants.ERROR_DATA_ISSUE+ message; return false; } - message = PolicyUtils.emptyPolicyValidator(configName); + message = PolicyUtils.policySpecialCharValidator(configName); if(!message.contains("success")){ message = XACMLErrorConstants.ERROR_DATA_ISSUE+ message; return false; diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java index 945cdba8b..528e5cda9 100644 --- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java +++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/CreateUpdatePolicyServiceImpl.java @@ -234,12 +234,12 @@ public class CreateUpdatePolicyServiceImpl implements CreateUpdatePolicyService message = XACMLErrorConstants.ERROR_DATA_ISSUE + "No Policy Name given."; return false; } - message = PolicyUtils.emptyPolicyValidator(policyScope); + message = PolicyUtils.policySpecialCharValidator(policyScope); if(!message.contains("success")){ message = XACMLErrorConstants.ERROR_DATA_ISSUE+ message; return false; } - message = PolicyUtils.emptyPolicyValidator(policyName); + message = PolicyUtils.policySpecialCharValidator(policyName); if(!message.contains("success")){ message = XACMLErrorConstants.ERROR_DATA_ISSUE+ message; return false; 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 6ca52ca40..bba51965b 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 @@ -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; @@ -269,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()); } } diff --git a/ONAP-PDP-REST/xacml.pdp.properties b/ONAP-PDP-REST/xacml.pdp.properties index b88c93543..6cf2e945b 100644 --- a/ONAP-PDP-REST/xacml.pdp.properties +++ b/ONAP-PDP-REST/xacml.pdp.properties @@ -118,6 +118,10 @@ xacml.rest.pap.password=alpha123 # Delay for Notifications Don't change this. Value in milliSec. xacml.rest.notification.delay=30 + +# Client interval to ping notification service. +CLIENT_INTERVAL=15000 + # Buffer Size. REQUEST_BUFFER_SIZE=15 |