diff options
Diffstat (limited to 'models-interactions/model-actors/actor.appc/src/main')
2 files changed, 5 insertions, 11 deletions
diff --git a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcOperation.java b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcOperation.java index 3ed23957a..75a4c9f58 100644 --- a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcOperation.java +++ b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcOperation.java @@ -23,9 +23,7 @@ package org.onap.policy.controlloop.actor.appc; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.UUID; import java.util.concurrent.CompletableFuture; -import org.apache.commons.lang3.tuple.Pair; import org.onap.policy.appc.CommonHeader; import org.onap.policy.appc.Request; import org.onap.policy.appc.Response; @@ -86,14 +84,11 @@ public abstract class AppcOperation extends BidirectionalTopicOperation<Request, * @param targetVnf target VNF * @return a new request */ - protected Pair<String, Request> makeRequest(int attempt, String targetVnf) { + protected Request makeRequest(int attempt, String targetVnf) { Request request = new Request(); request.setCommonHeader(new CommonHeader()); request.getCommonHeader().setRequestId(params.getRequestId()); - - // TODO ok to use UUID, or does it have to be the "attempt"? - final String subreq = UUID.randomUUID().toString(); - request.getCommonHeader().setSubRequestId(subreq); + request.getCommonHeader().setSubRequestId(getSubRequestId()); request.setAction(getName()); @@ -107,7 +102,7 @@ public abstract class AppcOperation extends BidirectionalTopicOperation<Request, // add/replace specific values request.getPayload().put(VNF_ID_KEY, targetVnf); - return Pair.of(subreq, request); + return request; } /** @@ -139,7 +134,7 @@ public abstract class AppcOperation extends BidirectionalTopicOperation<Request, */ @Override protected List<String> getExpectedKeyValues(int attempt, Request request) { - return List.of(request.getCommonHeader().getSubRequestId()); + return List.of(getSubRequestId()); } @Override diff --git a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java index e4fd51c07..a318444aa 100644 --- a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java +++ b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java @@ -21,7 +21,6 @@ package org.onap.policy.controlloop.actor.appc; import java.util.concurrent.CompletableFuture; -import org.apache.commons.lang3.tuple.Pair; import org.onap.aai.domain.yang.GenericVnf; import org.onap.policy.aai.AaiConstants; import org.onap.policy.aai.AaiCqResponse; @@ -61,7 +60,7 @@ public class ModifyConfigOperation extends AppcOperation { } @Override - protected Pair<String, Request> makeRequest(int attempt) { + protected Request makeRequest(int attempt) { AaiCqResponse cq = params.getContext().getProperty(AaiCqResponse.CONTEXT_KEY); GenericVnf genvnf = cq.getGenericVnfByModelInvariantId(params.getTarget().getResourceID()); |