summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java
diff options
context:
space:
mode:
Diffstat (limited to 'models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java')
-rw-r--r--models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java27
1 files changed, 4 insertions, 23 deletions
diff --git a/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java b/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java
index 5768cd12a..21cce2fd6 100644
--- a/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java
+++ b/models-interactions/model-actors/actor.appclcm/src/main/java/org/onap/policy/controlloop/actor/appclcm/AppcLcmActorServiceProvider.java
@@ -24,7 +24,6 @@ package org.onap.policy.controlloop.actor.appclcm;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
-
import java.util.AbstractMap;
import java.util.AbstractMap.SimpleEntry;
import java.util.Collections;
@@ -32,7 +31,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
-
import org.onap.policy.aai.AaiManager;
import org.onap.policy.aai.AaiNqInstanceFilters;
import org.onap.policy.aai.AaiNqInventoryResponseItem;
@@ -52,7 +50,6 @@ 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.onap.policy.rest.RestManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -144,7 +141,8 @@ public class AppcLcmActorServiceProvider implements Actor {
* @return the target entities vnf id to act upon
* @throws AaiException it an error occurs
*/
- public static String vnfNamedQuery(String resourceId, String sourceVnfId) throws AaiException {
+ public static String vnfNamedQuery(String resourceId, String sourceVnfId, String aaiUrl,
+ String aaiUser, String aaiPassword) throws AaiException {
// TODO: This request id should not be hard coded in future releases
UUID requestId = UUID.fromString("a93ac487-409c-4e8c-9e5f-334ae8f99087");
@@ -163,9 +161,8 @@ public class AppcLcmActorServiceProvider implements Actor {
aaiRequest.setInstanceFilters(new AaiNqInstanceFilters());
aaiRequest.getInstanceFilters().getInstanceFilter().add(filter);
- AaiNqResponse aaiResponse = new AaiManager(new RestManager()).postQuery(getPeManagerEnvProperty("aai.url"),
- getPeManagerEnvProperty("aai.username"), getPeManagerEnvProperty("aai.password"), aaiRequest,
- requestId);
+ AaiNqResponse aaiResponse = new AaiManager(new RestManager()).postQuery(aaiUrl,
+ aaiUser, aaiPassword, aaiRequest, requestId);
if (aaiResponse == null) {
throw new AaiException("The named query response was null");
@@ -341,20 +338,4 @@ public class AppcLcmActorServiceProvider implements Actor {
}
return new AbstractMap.SimpleEntry<>(result, message);
}
-
- /**
- * This method reads and validates environmental properties coming from the policy engine. Null
- * properties cause an {@link IllegalArgumentException} runtime exception to be thrown
- *
- * @param enginePropertyName the name of the parameter to retrieve
- * @return the property value
- */
- private static String getPeManagerEnvProperty(String enginePropertyName) {
- String enginePropertyValue = PolicyEngine.manager.getEnvironmentProperty(enginePropertyName);
- if (enginePropertyValue == null) {
- throw new IllegalArgumentException("The value of policy engine manager environment property \""
- + enginePropertyName + "\" may not be null");
- }
- return enginePropertyValue;
- }
}