diff options
author | 2020-07-29 13:50:40 -0400 | |
---|---|---|
committer | 2020-07-31 14:08:17 -0400 | |
commit | acded8235dcbb0b06abaa98297fecef78b4eec41 (patch) | |
tree | 8b400d09875cd2c6f7844fbbe0c4d9e1e1a16230 /models-interactions/model-actors/actor.aai/src/main/java | |
parent | 1da24b28d9df7c8ad5154d7788dab0ab9da589f8 (diff) |
Add property lists to Actors
Modified the Actor code to provide a list of properties needed by the
actor to perform a given operation.
Added a build() method to the parameter class so invokers can build an
operation and set its properties prior to starting it.
Added a "preprocessed" field to the parameter class so invokers can
indicate that the Actor need not perform any preprocessing steps. Will
modify the actors, in a subsequent review, to observe the flag.
Added "properties" to Operation so invokers can set the properties. Will
modify the actors, in a subsequent review, to use the property values
instead of the event context.
Tweaked a few Actors to get values using the "params" object instead of
reaching inside to the event object that it contains.
Addressed review comment(s):
- add prefix to other property names
Issue-ID: POLICY-2746
Change-Id: I65996aef5cec5afe25e8287c0b2f5f322c532ca5
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.aai/src/main/java')
2 files changed, 7 insertions, 2 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 718047cfc..caa8b9e1f 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 @@ -20,6 +20,7 @@ package org.onap.policy.controlloop.actor.aai; +import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.CompletableFuture; @@ -36,6 +37,7 @@ import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType; import org.onap.policy.common.utils.coder.StandardCoderObject; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; +import org.onap.policy.controlloop.actorserviceprovider.OperationProperties; import org.onap.policy.controlloop.actorserviceprovider.impl.HttpOperation; import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams; import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig; @@ -57,6 +59,8 @@ public class AaiCustomQueryOperation extends HttpOperation<String> { public static final String RESOURCE_LINK = "resource-link"; public static final String RESULT_DATA = "result-data"; + private static final List<String> PROPERTY_NAMES = List.of(OperationProperties.AAI_VSERVER_LINK); + // TODO make this configurable private static final String PREFIX = "/aai/v16"; @@ -70,7 +74,7 @@ public class AaiCustomQueryOperation extends HttpOperation<String> { * @param config configuration for this operation */ public AaiCustomQueryOperation(ControlLoopOperationParams params, HttpConfig config) { - super(params, config, String.class); + super(params, config, String.class, PROPERTY_NAMES); this.vserver = params.getContext().getEnrichment().get(VSERVER_VSERVER_NAME); if (StringUtils.isBlank(this.vserver)) { 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 07738b084..c18d06c95 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 @@ -20,6 +20,7 @@ package org.onap.policy.controlloop.actor.aai; +import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.CompletableFuture; @@ -58,7 +59,7 @@ public class AaiGetOperation extends HttpOperation<StandardCoderObject> { * @param config configuration for this operation */ public AaiGetOperation(ControlLoopOperationParams params, HttpConfig config) { - super(params, config, StandardCoderObject.class); + super(params, config, StandardCoderObject.class, Collections.emptyList()); this.propertyPrefix = getFullName() + "."; } |