diff options
author | 2020-08-04 16:27:18 -0400 | |
---|---|---|
committer | 2020-08-06 19:19:46 -0400 | |
commit | deed677c3dc8751209d50e7d35132c929fe6800d (patch) | |
tree | 01f3149d4a03206e134d889d50834ae8d141a0ce /models-interactions/model-actors/actor.appc/src/main | |
parent | 364ef26929f06637bca03dd7bfb5e8ac69b611f8 (diff) |
Modify Actors to use properties when provided
Modified the Actors to use properties when the application provides them
instead of going to the event context for the data. This sometimes entailed
moving code out of the Operation subclass constructor that used or validated
the context data.
Combined some property names and renamed others.
Changed VF Count from AtomicInteger to Integer.
Issue-ID: POLICY-2746
Change-Id: Ib8730538309bb77d2f4f6161e9a20a49362d8972
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.appc/src/main')
-rw-r--r-- | models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/ModifyConfigOperation.java | 14 |
1 files changed, 13 insertions, 1 deletions
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 680bd9cc7..13ddaf4a9 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 @@ -69,7 +69,19 @@ public class ModifyConfigOperation extends AppcOperation { @Override protected Request makeRequest(int attempt) { + return makeRequest(attempt, getVnfId()); + } + + protected String getVnfId() { + GenericVnf vnf = this.getProperty(OperationProperties.AAI_RESOURCE_VNF); + if (vnf != null) { + return vnf.getVnfId(); + } + AaiCqResponse cq = params.getContext().getProperty(AaiCqResponse.CONTEXT_KEY); + if (cq == null) { + throw new IllegalStateException("target vnf-id could not be determined"); + } GenericVnf genvnf = cq.getGenericVnfByModelInvariantId(params.getTarget().getResourceID()); if (genvnf == null) { @@ -77,6 +89,6 @@ public class ModifyConfigOperation extends AppcOperation { throw new IllegalArgumentException("target vnf-id could not be found"); } - return makeRequest(attempt, genvnf.getVnfId()); + return genvnf.getVnfId(); } } |