summaryrefslogtreecommitdiffstats
path: root/BRMSGateway
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2018-03-06 02:37:08 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-06 02:37:08 +0000
commit0ca791ec99d07b563cc28949d205c29b663437c1 (patch)
tree28d5f9421e5829dfa7b123a85d80f2ae4ca11e81 /BRMSGateway
parent48e538289151180b550b77c6905339f22d1d8097 (diff)
parent23c1e146852b43841c666aca584123dec896167e (diff)
Merge "Remove auto generated rule to the drl"
Diffstat (limited to 'BRMSGateway')
-rw-r--r--BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSHandler.java4
-rw-r--r--BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java10
2 files changed, 12 insertions, 2 deletions
diff --git a/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSHandler.java b/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSHandler.java
index c0a9cd203..b460fb87b 100644
--- a/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSHandler.java
+++ b/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSHandler.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP Policy Engine
* ================================================================================
- * 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.
@@ -120,6 +120,8 @@ public class BRMSHandler implements BackUpHandler{
*/
@Override
public void runOnNotification(PDPNotification notification){
+ // reset the BRMSPush data structures
+ bRMSPush.resetDS();
if(notification.getNotificationType().equals(NotificationType.REMOVE)){
removedPolicies(notification.getRemovedPolicies());
}else if(notification.getNotificationType().equals(NotificationType.UPDATE)|| notification.getNotificationType().equals(NotificationType.BOTH)){
diff --git a/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java b/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java
index ac1d0ac87..b76812b00 100644
--- a/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java
+++ b/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP Policy Engine
* ================================================================================
- * 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.
@@ -374,6 +374,11 @@ public class BRMSPush {
if (flag)
syncGroupInfo();
}
+
+ public void resetDS(){
+ resetModifiedGroups();
+ controllers = new ArrayList<>();
+ }
private static void resetModifiedGroups() {
modifiedGroups = new HashMap<>();
@@ -410,6 +415,7 @@ public class BRMSPush {
PEDependency dependency = PolicyUtils.jsonStringToObject(value,
PEDependency.class);
userControllerName = key.replaceFirst("$controller:", "");
+ LOGGER.info("addRule: userControllerName - " + userControllerName + ", dependency: - " + dependency);
addToGroup(userControllerName, dependency);
} catch (Exception e) {
LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error while resolving Controller: " + e);
@@ -445,6 +451,7 @@ public class BRMSPush {
// If the key is not got as parameters set by the user, setting the default value for kSessionName as
// closedLoop
if (kSessionName == null) {
+ LOGGER.info("kSessionName is null, selectedName is : " + selectedName );
if (selectedName == defaultName) {
kSessionName = "closedloop";
} else {
@@ -747,6 +754,7 @@ public class BRMSPush {
InvocationResult result = null;
String group = entry.getKey();
try {
+ LOGGER.info("PushRules: ModifiedGroups, Key: " + group + ", Value: " + entry.getValue());
InvocationRequest request = new DefaultInvocationRequest();
setVersion(group);
createPom(group);