diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2020-02-18 17:14:29 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-02-18 17:14:29 +0000 |
commit | 1bb549251599ce7866e1143158a68b5f259d22b1 (patch) | |
tree | 96d6d4bb8e5501be14b314e3979fbaa358a37478 /models-interactions/model-actors/actor.aai/src | |
parent | 88fb2e33c81fa0d69846e8d0d218b0ef4015a4ba (diff) | |
parent | e44f1a1c58efed9fbe2efce78864aaee3b577003 (diff) |
Merge "More changes to actor code"
Diffstat (limited to 'models-interactions/model-actors/actor.aai/src')
6 files changed, 15 insertions, 10 deletions
diff --git a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java index bc2dde9d8..e32734b7d 100644 --- a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java +++ b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java @@ -121,9 +121,12 @@ public class AaiCustomQueryOperation extends HttpOperation<String> { * Injects the response into the context. */ @Override - protected void postProcessResponse(OperationOutcome outcome, String url, Response rawResponse, String response) { + protected CompletableFuture<OperationOutcome> postProcessResponse(OperationOutcome outcome, String url, + Response rawResponse, String response) { logger.info("{}: caching response for {}", getFullName(), params.getRequestId()); params.getContext().setProperty(AaiCqResponse.CONTEXT_KEY, new AaiCqResponse(response)); + + return super.postProcessResponse(outcome, url, rawResponse, response); } } diff --git a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetOperation.java b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetOperation.java index 60a28209b..ee1c4612d 100644 --- a/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetOperation.java +++ b/models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetOperation.java @@ -116,13 +116,15 @@ public class AaiGetOperation extends HttpOperation<StandardCoderObject> { * Injects the response into the context. */ @Override - protected void postProcessResponse(OperationOutcome outcome, String url, Response rawResponse, - StandardCoderObject response) { + protected CompletableFuture<OperationOutcome> postProcessResponse(OperationOutcome outcome, String url, + Response rawResponse, StandardCoderObject response) { String entity = params.getTargetEntity(); logger.info("{}: caching response of {} for {}", getFullName(), entity, params.getRequestId()); params.getContext().setProperty(propertyPrefix + entity, response); + + return super.postProcessResponse(outcome, url, rawResponse, response); } /** 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 c95425e7a..a93508757 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 @@ -50,7 +50,7 @@ import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams; import org.onap.policy.controlloop.actorserviceprovider.spi.Actor; import org.onap.policy.controlloop.policy.PolicyResult; -public class AaiCustomQueryOperationTest extends BasicAaiOperator<Map<String, String>> { +public class AaiCustomQueryOperationTest extends BasicAaiOperation<Map<String, String>> { private static final StandardCoder coder = new StandardCoder(); private static final String MY_LINK = "my-link"; diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperatorTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java index ebe953570..654864246 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperatorTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiGetOperationTest.java @@ -38,14 +38,14 @@ import org.onap.policy.common.utils.coder.StandardCoderObject; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; import org.onap.policy.controlloop.policy.PolicyResult; -public class AaiGetOperatorTest extends BasicAaiOperator<Void> { +public class AaiGetOperationTest extends BasicAaiOperation<Void> { private static final String INPUT_FIELD = "input"; private static final String TEXT = "my-text"; private AaiGetOperation oper; - public AaiGetOperatorTest() { + public AaiGetOperationTest() { super(AaiConstants.ACTOR_NAME, AaiGetOperation.TENANT); } diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiUtilTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiUtilTest.java index 39ed6fe88..ae38cca35 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiUtilTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiUtilTest.java @@ -23,7 +23,7 @@ package org.onap.policy.controlloop.actor.aai; import java.util.Map; import org.junit.Test; -public class AaiUtilTest extends BasicAaiOperator<Void> { +public class AaiUtilTest extends BasicAaiOperation<Void> { @Test public void testMakeHeaders() { diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/BasicAaiOperator.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/BasicAaiOperation.java index 50b562afb..00485c935 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/BasicAaiOperator.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/BasicAaiOperation.java @@ -28,12 +28,12 @@ import org.onap.policy.controlloop.actor.test.BasicHttpOperation; /** * Superclass for various operator tests. */ -public abstract class BasicAaiOperator<Q> extends BasicHttpOperation<Q> { +public abstract class BasicAaiOperation<Q> extends BasicHttpOperation<Q> { /** * Constructs the object using a default actor and operation name. */ - public BasicAaiOperator() { + public BasicAaiOperation() { super(); } @@ -43,7 +43,7 @@ public abstract class BasicAaiOperator<Q> extends BasicHttpOperation<Q> { * @param actor actor name * @param operation operation name */ - public BasicAaiOperator(String actor, String operation) { + public BasicAaiOperation(String actor, String operation) { super(actor, operation); } |