diff options
Diffstat (limited to 'controlloop/common/actors/actor.appclcm')
-rw-r--r-- | controlloop/common/actors/actor.appclcm/pom.xml | 6 | ||||
-rw-r--r-- | controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java | 14 |
2 files changed, 17 insertions, 3 deletions
diff --git a/controlloop/common/actors/actor.appclcm/pom.xml b/controlloop/common/actors/actor.appclcm/pom.xml index 6aa5f6439..1120df33a 100644 --- a/controlloop/common/actors/actor.appclcm/pom.xml +++ b/controlloop/common/actors/actor.appclcm/pom.xml @@ -41,6 +41,12 @@ <scope>provided</scope> </dependency> <dependency> + <groupId>org.onap.policy.drools-pdp</groupId> + <artifactId>policy-management</artifactId> + <version>1.1.0-SNAPSHOT</version> + <scope>provided</scope> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> diff --git a/controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java b/controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java index eaff2503a..9f556fa2e 100644 --- a/controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java +++ b/controlloop/common/actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java @@ -49,6 +49,7 @@ import org.onap.policy.controlloop.VirtualControlLoopEvent; import org.onap.policy.controlloop.actorServiceProvider.spi.Actor; import org.onap.policy.controlloop.policy.Policy; import org.onap.policy.controlloop.policy.PolicyResult; +import org.onap.policy.drools.system.PolicyEngine; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -157,10 +158,17 @@ public class AppcLcmActorServiceProvider implements Actor { aaiRequest.instanceFilters = new AAINQInstanceFilters(); aaiRequest.instanceFilters.instanceFilter.add(filter); - //TODO: URL should not be hard coded for future releases + /* + * Obtain A&AI credentials from properties.environment file + * TODO: What if these are null? + */ + String aaiUrl = PolicyEngine.manager.getEnvironmentProperty("aai.url"); + String aaiUsername = PolicyEngine.manager.getEnvironmentProperty("aai.username"); + String aaiPassword = PolicyEngine.manager.getEnvironmentProperty("aai.password"); + AAINQResponse aaiResponse = AAIManager.postQuery( - "http://localhost:6666", - "policy", "policy", + aaiUrl, + aaiUsername, aaiPassword, aaiRequest, requestId); //TODO: What if the resourceId never matches? |