aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/actors/actor.appc
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/actors/actor.appc')
-rw-r--r--controlloop/common/actors/actor.appc/pom.xml12
-rw-r--r--controlloop/common/actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/APPCActorServiceProvider.java23
-rw-r--r--controlloop/common/actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcServiceProviderTest.java14
3 files changed, 2 insertions, 47 deletions
diff --git a/controlloop/common/actors/actor.appc/pom.xml b/controlloop/common/actors/actor.appc/pom.xml
index cc5f3b604..3036f52b4 100644
--- a/controlloop/common/actors/actor.appc/pom.xml
+++ b/controlloop/common/actors/actor.appc/pom.xml
@@ -18,18 +18,6 @@
</dependency>
<dependency>
<groupId>org.onap.policy.drools-applications</groupId>
- <artifactId>actor.appclcm</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.drools-applications</groupId>
- <artifactId>aai</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.drools-applications</groupId>
<artifactId>appc</artifactId>
<version>1.1.0-SNAPSHOT</version>
<scope>provided</scope>
diff --git a/controlloop/common/actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/APPCActorServiceProvider.java b/controlloop/common/actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/APPCActorServiceProvider.java
index 44411ca72..d525c4c85 100644
--- a/controlloop/common/actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/APPCActorServiceProvider.java
+++ b/controlloop/common/actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/APPCActorServiceProvider.java
@@ -24,9 +24,6 @@ import java.util.Collections;
import java.util.List;
import org.onap.policy.controlloop.VirtualControlLoopEvent;
-import org.onap.policy.controlloop.actor.appclcm.AppcLcmActorServiceProvider;
-import org.onap.policy.aai.AAIGETVnfResponse;
-import org.onap.policy.aai.util.AAIException;
import org.onap.policy.appc.CommonHeader;
import org.onap.policy.appc.Request;
import org.onap.policy.controlloop.ControlLoopOperation;
@@ -91,7 +88,7 @@ public class APPCActorServiceProvider implements Actor {
* @throws AAIException
*/
public static Request constructRequest(VirtualControlLoopEvent onset, ControlLoopOperation operation,
- Policy policy, AAIGETVnfResponse vnfResponse) throws AAIException {
+ Policy policy, String targetVnf) {
/*
* Construct an APPC request
*/
@@ -101,24 +98,6 @@ public class APPCActorServiceProvider implements Actor {
request.CommonHeader.SubRequestID = operation.subRequestId;
request.Action = policy.getRecipe().substring(0, 1).toUpperCase()
+ policy.getRecipe().substring(1);
-
- /*
- * The target vnf-id may not be the same as the source vnf-id
- * specified in the yaml, the target vnf-id is retrieved by
- * a named query to A&AI.
- */
- String sourceVnf = onset.AAI.get("generic-vnf.vnf-id");
- if (sourceVnf == null) {
- /*
- * Lets see if the vnf-name is provided
- */
- sourceVnf = vnfResponse.vnfID;
- if (sourceVnf == null) {
- throw new AAIException("No vnf-id found");
- }
- }
- String targetVnf = AppcLcmActorServiceProvider.vnfNamedQuery(
- policy.getTarget().getResourceID(), sourceVnf);
/*
* For now Policy generates the PG Streams as a demo, in the
diff --git a/controlloop/common/actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcServiceProviderTest.java b/controlloop/common/actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcServiceProviderTest.java
index 5a107f814..31a041d4b 100644
--- a/controlloop/common/actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcServiceProviderTest.java
+++ b/controlloop/common/actors/actor.appc/src/test/java/org/onap/policy/controlloop/actor/appc/AppcServiceProviderTest.java
@@ -29,8 +29,6 @@ import java.util.UUID;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.onap.policy.aai.AAIGETVnfResponse;
-import org.onap.policy.aai.util.AAIException;
import org.onap.policy.appc.Request;
import org.onap.policy.appc.Response;
import org.onap.policy.appc.ResponseCode;
@@ -55,7 +53,6 @@ public class AppcServiceProviderTest {
private static VirtualControlLoopEvent onsetEvent;
private static ControlLoopOperation operation;
private static Policy policy;
- private static AAIGETVnfResponse aaiResponse;
static {
/*
@@ -94,10 +91,6 @@ public class AppcServiceProviderTest {
policy.setRetry(2);
policy.setTimeout(300);
- /* Construct a mock A&AI response */
- aaiResponse = new AAIGETVnfResponse();
- aaiResponse.vnfID = "vnf01";
-
/* Set environment properties */
PolicyEngine.manager.setEnvironmentProperty("aai.url", "http://localhost:6666");
PolicyEngine.manager.setEnvironmentProperty("aai.username", "AAI");
@@ -123,12 +116,7 @@ public class AppcServiceProviderTest {
public void constructModifyConfigRequestTest() {
Request appcRequest = null;
- try {
- appcRequest = APPCActorServiceProvider.constructRequest(onsetEvent, operation, policy, aaiResponse);
- } catch (AAIException e) {
- logger.warn(e.toString());
- fail("no vnfid found");
- }
+ appcRequest = APPCActorServiceProvider.constructRequest(onsetEvent, operation, policy, "vnf01");
/* The service provider must return a non null APPC request */
assertNotNull(appcRequest);