summaryrefslogtreecommitdiffstats
path: root/policy-management/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2018-08-29 17:15:37 -0400
committerJim Hahn <jrh3@att.com>2018-08-29 17:30:42 -0400
commit32813b8a9b805f26358289f28801ee8e095233b7 (patch)
tree8649895f9bf9f061df9f74c54b2fafb1b5b9a5c0 /policy-management/src
parent181e4d4f95d7fab6b1e134406a22b568a9881bf3 (diff)
handle null drools object in configuration
Modified code to explicitly check for missing drools object, and to not throw an exception during MDC setup. Change-Id: Iac16f2fc46e2ffff03195985383b09b814fa4008 Issue-ID: POLICY-1082 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-management/src')
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/PolicyControllerFactory.java6
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java2
2 files changed, 4 insertions, 4 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyControllerFactory.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyControllerFactory.java
index e2af0fbc..d8d4289f 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyControllerFactory.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyControllerFactory.java
@@ -241,9 +241,6 @@ class IndexedPolicyControllerFactory implements PolicyControllerFactory {
throw makeArgEx(name);
}
- if (droolsConfig == null)
- throw new IllegalArgumentException("Invalid Drools Configuration");
-
PolicyController controller = this.get(name);
if (controller == null) {
@@ -271,6 +268,9 @@ class IndexedPolicyControllerFactory implements PolicyControllerFactory {
if (controller == null)
throw new IllegalArgumentException("Not a valid controller: null");
+ if (droolsConfig == null)
+ throw new IllegalArgumentException("Invalid Drools Configuration");
+
if (!controller.updateDrools(droolsConfig)) {
logger.warn("Cannot update drools configuration: " + droolsConfig + " on " + this);
throw new IllegalArgumentException("Cannot update drools configuration Drools Configuration");
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java
index 5b8cb2f0..993c09c0 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java
@@ -619,7 +619,7 @@ class PolicyEngineManager implements PolicyEngine {
for (final ControllerConfiguration configController : configControllers) {
MDCTransaction mdcTrans = MDCTransaction.newSubTransaction(null).setTargetEntity(configController.getName())
.setTargetServiceName(configController.getOperation())
- .setTargetVirtualEntity(configController.getDrools().toString());
+ .setTargetVirtualEntity(""+configController.getDrools());
try {
final PolicyController policyController = this.updatePolicyController(configController);
policyControllers.add(policyController);