aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions
diff options
context:
space:
mode:
authorRam Krishna Verma <ram_krishna.verma@bell.ca>2020-08-18 19:59:14 +0000
committerGerrit Code Review <gerrit@onap.org>2020-08-18 19:59:14 +0000
commitca3827f43ada2b160f6966d205ca97d4402a0935 (patch)
tree39ad0af2687a16f722690676ebc0b28778530796 /models-interactions
parent132299e0db10e19f956ee3a886dc7e0966215279 (diff)
parent2c789f6a45f50da129d05ff3ea20acd9f45774d0 (diff)
Merge "Remove event context from Operation post processor"
Diffstat (limited to 'models-interactions')
-rw-r--r--models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperation.java6
-rw-r--r--models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetOperation.java7
2 files changed, 8 insertions, 5 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 c8e087036..388959ddf 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
@@ -193,8 +193,10 @@ public class AaiCustomQueryOperation extends HttpOperation<String> {
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));
+ if (params.getContext() != null) {
+ 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 c18d06c95..c91e2a0d6 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
@@ -112,9 +112,10 @@ public class AaiGetOperation extends HttpOperation<StandardCoderObject> {
Response rawResponse, StandardCoderObject response) {
String entity = params.getTargetEntity();
- logger.info("{}: caching response of {} for {}", getFullName(), entity, params.getRequestId());
-
- params.getContext().setProperty(propertyPrefix + entity, response);
+ if (params.getContext() != null) {
+ logger.info("{}: caching response of {} for {}", getFullName(), entity, params.getRequestId());
+ params.getContext().setProperty(propertyPrefix + entity, response);
+ }
return super.postProcessResponse(outcome, url, rawResponse, response);
}