Code Review
/
policy
/
models.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add subrequest ID to OperationOutcome
[policy/models.git]
/
models-interactions
/
model-actors
/
actorServiceProvider
/
src
/
main
/
java
/
org
/
onap
/
policy
/
controlloop
/
actorserviceprovider
/
impl
/
BidirectionalTopicOperation.java
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
b38ddb0
..
ec522a4
100644
(file)
--- 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
@@
-25,6
+25,7
@@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.function.BiConsumer;
import lombok.Getter;
import java.util.concurrent.Executor;
import java.util.function.BiConsumer;
import lombok.Getter;
+import org.apache.commons.lang3.tuple.Pair;
import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoderObject;
@@
-105,7
+106,10
@@
public abstract class BidirectionalTopicOperation<Q, S> extends OperationPartial
@Override
protected CompletableFuture<OperationOutcome> startOperationAsync(int attempt, OperationOutcome outcome) {
@Override
protected CompletableFuture<OperationOutcome> startOperationAsync(int attempt, OperationOutcome outcome) {
- final Q request = makeRequest(attempt);
+ final Pair<String,Q> pair = makeRequest(attempt);
+ final Q request = pair.getRight();
+ outcome.setSubRequestId(pair.getLeft());
+
final List<String> expectedKeyValues = getExpectedKeyValues(attempt, request);
final PipelineControllerFuture<OperationOutcome> controller = new PipelineControllerFuture<>();
final List<String> expectedKeyValues = getExpectedKeyValues(attempt, request);
final PipelineControllerFuture<OperationOutcome> controller = new PipelineControllerFuture<>();
@@
-142,9
+146,10
@@
public abstract class BidirectionalTopicOperation<Q, S> extends OperationPartial
* Makes the request.
*
* @param attempt operation attempt
* Makes the request.
*
* @param attempt operation attempt
- * @return a new request
+ * @return a pair containing sub request ID, which may be {@code null} and the new
+ * request
*/
*/
- protected abstract
Q
makeRequest(int attempt);
+ protected abstract
Pair<String, Q>
makeRequest(int attempt);
/**
* Gets values, expected in the response, that should match the selector keys.
/**
* Gets values, expected in the response, that should match the selector keys.