aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/feature-controlloop-management/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-08-13 15:52:22 -0400
committerJim Hahn <jrh3@att.com>2019-08-15 09:21:28 -0400
commitfdaae76549bafb2e482c02fb26de719c69431b48 (patch)
treea3f477da55f80fe7e4bed3d959d8089cf1971438 /controlloop/common/feature-controlloop-management/src/main
parent9e8023a455633c7daf0dd291c6268986e39352d7 (diff)
Modify to work with new drools-pdp
Due to sonar fixes, drools-pdp changed in a way that requires changes to drools-applications. In the case of template.demo, lots of test cases had to be modified, so they were refactored to extract common setup and tear down code. Fixed checkstyle issues. Fixed license date. Change-Id: Ie9e0239b95916ae7ef8c1b669987f7bb07d841b9 Issue-ID: POLICY-1968 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/common/feature-controlloop-management/src/main')
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeature.java3
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java26
2 files changed, 19 insertions, 10 deletions
diff --git a/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeature.java b/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeature.java
index 3b5792a42..ae19b914e 100644
--- a/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeature.java
+++ b/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeature.java
@@ -24,6 +24,7 @@ import java.util.stream.Stream;
import org.onap.policy.controlloop.params.ControlLoopParams;
import org.onap.policy.drools.features.PolicyEngineFeatureApi;
import org.onap.policy.drools.system.PolicyController;
+import org.onap.policy.drools.system.PolicyControllerConstants;
/**
* Control Loop Management Feature.
@@ -100,7 +101,7 @@ public class ControlLoopManagementFeature implements PolicyEngineFeatureApi {
*/
public static class Factory {
public PolicyController getController(String controllerName) {
- return PolicyController.factory.get(controllerName);
+ return PolicyControllerConstants.getFactory().get(controllerName);
}
}
}
diff --git a/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java b/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java
index 4b62e489a..08b218dd6 100644
--- a/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java
+++ b/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java
@@ -47,8 +47,8 @@ import org.onap.policy.controlloop.params.ControlLoopParams;
import org.onap.policy.controlloop.processor.ControlLoopProcessor;
import org.onap.policy.drools.apps.controlloop.feature.management.ControlLoopManagementFeature;
import org.onap.policy.drools.controller.DroolsController;
-import org.onap.policy.drools.system.PolicyController;
-import org.onap.policy.drools.system.PolicyEngine;
+import org.onap.policy.drools.system.PolicyControllerConstants;
+import org.onap.policy.drools.system.PolicyEngineConstants;
import org.onap.policy.rest.RestManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -206,7 +206,7 @@ public class RestControlLoopManager {
.build();
}
- DroolsController controller = PolicyController.factory.get(controllerName).getDrools();
+ DroolsController controller = PolicyControllerConstants.getFactory().get(controllerName).getDrools();
controlLoop = new ControlLoopParams();
controlLoop.setPolicyScope(controller.getGroupId());
@@ -240,9 +240,13 @@ public class RestControlLoopManager {
return Response
.status(Status.OK)
.entity(new AaiManager(new RestManager())
- .getCustomQueryResponse(PolicyEngine.manager.getEnvironmentProperty(ControlLoopEventManager.AAI_URL),
- PolicyEngine.manager.getEnvironmentProperty(ControlLoopEventManager.AAI_USERNAME_PROPERTY),
- PolicyEngine.manager.getEnvironmentProperty(ControlLoopEventManager.AAI_PASS_PROPERTY),
+ .getCustomQueryResponse(
+ PolicyEngineConstants.getManager()
+ .getEnvironmentProperty(ControlLoopEventManager.AAI_URL),
+ PolicyEngineConstants.getManager().getEnvironmentProperty(
+ ControlLoopEventManager.AAI_USERNAME_PROPERTY),
+ PolicyEngineConstants.getManager().getEnvironmentProperty(
+ ControlLoopEventManager.AAI_PASS_PROPERTY),
UUID.randomUUID(),
vserverId))
.build();
@@ -261,9 +265,13 @@ public class RestControlLoopManager {
return Response
.status(Status.OK)
.entity(new AaiManager(new RestManager())
- .postQuery(PolicyEngine.manager.getEnvironmentProperty(ControlLoopEventManager.AAI_URL),
- PolicyEngine.manager.getEnvironmentProperty(ControlLoopEventManager.AAI_USERNAME_PROPERTY),
- PolicyEngine.manager.getEnvironmentProperty(ControlLoopEventManager.AAI_PASS_PROPERTY),
+ .postQuery(
+ PolicyEngineConstants.getManager()
+ .getEnvironmentProperty(ControlLoopEventManager.AAI_URL),
+ PolicyEngineConstants.getManager().getEnvironmentProperty(
+ ControlLoopEventManager.AAI_USERNAME_PROPERTY),
+ PolicyEngineConstants.getManager().getEnvironmentProperty(
+ ControlLoopEventManager.AAI_PASS_PROPERTY),
ControlLoopEventManager.getAaiNqRequest(vserverId),
UUID.randomUUID()))
.build();