summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.aai/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-02-17 13:57:56 -0500
committerJim Hahn <jrh3@att.com>2020-02-17 20:41:09 -0500
commite44f1a1c58efed9fbe2efce78864aaee3b577003 (patch)
treee0a1903c107162dc2d9a3bcae2257862a99c6b48 /models-interactions/model-actors/actor.aai/src/main
parent85a2fee4074903012e77f78e26328b9a03a8bdfc (diff)
More changes to actor code
Use Coder.convert() from policy-common. Passed response to setOutcome(). Changed class names from XxxOperator to XxxOperation. Modified SDNC junits to invoke start() instead of startOperationAsync(). Changed context obtain() to re-run if the future was canceled. Added junit support class, BasicBidirectionalTopicOperation. Modified HttpOperation to allow subsequent requests to be issued. Some actors, like SO, send an initial HTTP request and then follow it with HTTP "are you done?" requests. Issue-ID: POLICY-2363-prop Change-Id: I12b5c2d4f07254e0cb79fabfe1ccf844b70a0654 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.aai/src/main')
-rw-r--r--models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java5
-rw-r--r--models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetOperation.java6
2 files changed, 8 insertions, 3 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);
}
/**