diff options
author | Jim Hahn <jrh3@att.com> | 2020-05-27 10:49:39 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-05-27 16:31:35 -0400 |
commit | 770e374bc2e4ba814bb0e59eadf0f9fe2d5291e5 (patch) | |
tree | d9ad1100fbb13b468865474a3450700b1b5c9f52 /models-interactions/model-actors/actorServiceProvider/src/main | |
parent | ddd400dc81f6bdabc76924cf904af540aa912ca2 (diff) |
Include response in OperationOutcome
Added the response field and modified the actors to populate it.
Issue-ID: POLICY-2592
Change-Id: I24487b6fbc23b69bde4a95acd470864d8231c49d
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actorServiceProvider/src/main')
3 files changed, 9 insertions, 0 deletions
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcome.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcome.java index e2d94b3b3..0fd2c0bfd 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcome.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcome.java @@ -43,6 +43,7 @@ public class OperationOutcome { private PolicyResult result = PolicyResult.SUCCESS; private String message; private boolean finalOutcome; + private Object response; private ControlLoopResponse controlLoopResponse; /** @@ -60,6 +61,7 @@ public class OperationOutcome { this.result = source.result; this.message = source.message; this.finalOutcome = source.finalOutcome; + this.response = source.response; this.controlLoopResponse = source.controlLoopResponse; } @@ -85,6 +87,11 @@ public class OperationOutcome { return clo; } + @SuppressWarnings("unchecked") + public <T> T getResponse() { + return (T) response; + } + /** * Determines if this outcome is for the given actor and operation. * diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java index 9decd8a61..8285a5635 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java @@ -250,6 +250,7 @@ public abstract class BidirectionalTopicOperation<Q, S> extends OperationPartial * @return the updated operation */ public OperationOutcome setOutcome(OperationOutcome outcome, PolicyResult result, S response) { + outcome.setResponse(response); return setOutcome(outcome, result); } diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java index e83fe8c94..1acc1ff65 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java @@ -217,6 +217,7 @@ public abstract class HttpOperation<T> extends OperationPartial { public OperationOutcome setOutcome(OperationOutcome outcome, PolicyResult result, Response rawResponse, T response) { + outcome.setResponse(response); return setOutcome(outcome, result); } |