diff options
Diffstat (limited to 'models-interactions/model-actors/actorServiceProvider/src/main')
2 files changed, 14 insertions, 28 deletions
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java index e9f6b024c..c3d3f6663 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java @@ -226,7 +226,7 @@ public abstract class OperationPartial implements Operation { logger.info("{}: start operation attempt {} for {}", getFullName(), attempt, params.getRequestId()); final Executor executor = params.getExecutor(); - final OperationOutcome outcome = params.makeOutcome(getTargetEntity()); + final OperationOutcome outcome = makeOutcome(); final CallbackManager callbacks = new CallbackManager(); // this operation attempt gets its own controller @@ -357,7 +357,7 @@ public abstract class OperationPartial implements Operation { outcome = origOutcome; } else { logger.warn("{}: null outcome; treating as a failure for {}", getFullName(), params.getRequestId()); - outcome = this.setOutcome(params.makeOutcome(getTargetEntity()), OperationResult.FAILURE); + outcome = this.setOutcome(makeOutcome(), OperationResult.FAILURE); } // ensure correct actor/operation @@ -456,7 +456,7 @@ public abstract class OperationPartial implements Operation { private Function<Throwable, OperationOutcome> fromException(String type) { return thrown -> { - OperationOutcome outcome = params.makeOutcome(getTargetEntity()); + OperationOutcome outcome = makeOutcome(); if (thrown instanceof CancellationException || thrown.getCause() instanceof CancellationException) { // do not include exception in the message, as it just clutters the log @@ -893,6 +893,16 @@ public abstract class OperationPartial implements Operation { } /** + * Makes an outcome, populating the "target" field with the contents of the target + * entity property. + * + * @return a new operation outcome + */ + protected OperationOutcome makeOutcome() { + return params.makeOutcome(getProperty(OperationProperties.AAI_TARGET_ENTITY)); + } + + /** * Determines if a throwable is due to a timeout. * * @param thrown throwable of interest @@ -976,16 +986,6 @@ public abstract class OperationPartial implements Operation { } /** - * Gets the target entity, first trying the properties and then the parameters. - * - * @return the target entity - */ - protected String getTargetEntity() { - String targetEntity = getProperty(OperationProperties.AAI_TARGET_ENTITY); - return (targetEntity != null ? targetEntity : params.getTargetEntity()); - } - - /** * Gets the operation timeout. * * @param timeoutSec timeout, in seconds, extracted from the parameters, or diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParams.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParams.java index 67f68036b..2769697cf 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParams.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParams.java @@ -97,13 +97,6 @@ public class ControlLoopOperationParams { private Map<String, Object> payload; /** - * {@code True} if the preprocessing steps have already been executed, {@code false} - * otherwise. - */ - // TODO remove this once the rules no longer reference it - private boolean preprocessed; - - /** * Number of retries allowed, or {@code null} if no retries. */ private Integer retry; @@ -121,12 +114,6 @@ public class ControlLoopOperationParams { private Map<String, String> targetEntityIds; /** - * Target entity. - */ - // TODO to be removed - private String targetEntity; - - /** * Timeout, in seconds, or {@code null} if no timeout. Zero and negative values also * imply no timeout. */ @@ -197,9 +184,8 @@ public class ControlLoopOperationParams { * * @return a new operation outcome */ - // TODO to be removed public OperationOutcome makeOutcome() { - return makeOutcome(getTargetEntity()); + return makeOutcome(null); } /** |