aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.aai
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-11-18 10:44:41 -0500
committerJim Hahn <jrh3@att.com>2020-11-20 11:49:01 -0500
commit1dd41890f83702d47c5a957493046433989ef36c (patch)
tree4271931cf6ca6e7c43141cc600bd8351015be294 /models-interactions/model-actors/actor.aai
parentca468c57a4d09842f2608e32da74b30eba52d015 (diff)
Delete preprocessed flag from actors
Removed the "preprocessed" flag from the Actor parameter class, now that the actors no longer have a startPreprocess() method. Also removed targetEntity from Actor parameter class. Created a makeOutcome method within OperationPartial, which is used to create an initial outcome whose target field is pre-populated with the target-entity extracted from the properties. As the meaning of "target" may be specific to an operation, the makeOutcome method may be overridden by an operation subclass. Issue-ID: POLICY-2804 Change-Id: Ifb66de63301d644e69340009593513773ee5672d Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.aai')
-rw-r--r--models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperation.java4
-rw-r--r--models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperation.java5
-rw-r--r--models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java2
-rw-r--r--models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java1
-rw-r--r--models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java1
5 files changed, 10 insertions, 3 deletions
diff --git a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperation.java b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperation.java
index a4b30652d..c1582c51a 100644
--- a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperation.java
+++ b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperation.java
@@ -30,6 +30,7 @@ import org.onap.policy.aai.AaiConstants;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
+import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig;
@@ -71,7 +72,8 @@ public class AaiGetPnfOperation extends AaiGetOperation {
StringBuilder str = new StringBuilder(getClient().getBaseUrl());
- String path = getPath() + URI_SEP + URLEncoder.encode(getTargetEntity(), StandardCharsets.UTF_8);
+ String target = getProperty(OperationProperties.AAI_TARGET_ENTITY);
+ String path = getPath() + URI_SEP + URLEncoder.encode(target, StandardCharsets.UTF_8);
WebTarget web = getClient().getWebTarget().path(path);
str.append(path);
diff --git a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperation.java b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperation.java
index add9c647a..b3bf4ce12 100644
--- a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperation.java
+++ b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperation.java
@@ -28,6 +28,7 @@ import org.onap.policy.aai.AaiConstants;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
+import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig;
@@ -72,8 +73,10 @@ public class AaiGetTenantOperation extends AaiGetOperation {
WebTarget web = getClient().getWebTarget().path(path);
str.append(path);
+ String target = getProperty(OperationProperties.AAI_TARGET_ENTITY);
+
web = addQuery(web, str, "?", "search-node-type", "vserver");
- web = addQuery(web, str, "&", "filter", "vserver-name:EQUALS:" + getTargetEntity());
+ web = addQuery(web, str, "&", "filter", "vserver-name:EQUALS:" + target);
Builder webldr = web.request();
addHeaders(webldr, headers);
diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java
index 61155ce07..b5ba5d2ab 100644
--- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java
+++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java
@@ -91,7 +91,7 @@ public class AaiCustomQueryOperationTest extends BasicAaiOperation {
HttpParams opParams = HttpParams.builder().clientName(MY_CLIENT).path("v16/query").build();
config = new HttpConfig(blockingExecutor, opParams, HttpClientFactoryInstance.getClientFactory());
- params = params.toBuilder().retry(0).timeoutSec(5).executor(blockingExecutor).preprocessed(true).build();
+ params = params.toBuilder().retry(0).timeoutSec(5).executor(blockingExecutor).build();
oper = new AaiCustomQueryOperation(params, config);
oper.setProperty(OperationProperties.AAI_VSERVER_LINK, MY_LINK);
diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java
index fb2b770db..9e72fe2e8 100644
--- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java
+++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperationTest.java
@@ -72,6 +72,7 @@ public class AaiGetPnfOperationTest extends BasicAaiOperation {
public void setUp() throws Exception {
super.setUpBasic();
oper = new AaiGetPnfOperation(params, config);
+ oper.setProperty(OperationProperties.AAI_TARGET_ENTITY, TARGET_ENTITY);
}
@Test
diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java
index 27495d8fc..a79a8f79a 100644
--- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java
+++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperationTest.java
@@ -72,6 +72,7 @@ public class AaiGetTenantOperationTest extends BasicAaiOperation {
public void setUp() throws Exception {
super.setUpBasic();
oper = new AaiGetTenantOperation(params, config);
+ oper.setProperty(OperationProperties.AAI_TARGET_ENTITY, TARGET_ENTITY);
}
@Test