From 6a37af48d1db199a0f5a9e9c48f7c5f834a90d1b Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 30 Jul 2020 18:05:02 -0400 Subject: Add "special" Operation classes for new usecases Created place-holder for new "usecases" controller. Note: as of yet, this is still just a normal java project; it will be turned into a full-fledged kie-based controller in a later review. Added some Operation and a few other support classes that will be needed. Note: the detmTarget() method and it's various supporting methods, detmXxx(), found in GetTargetEntityOperation2 were cloned from the pre-existing ControlLoopOperationManager2 class, and modified to fit the strategy of the new controller. Likewise for the junit tests of those methods. Issue-ID: POLICY-2748 Change-Id: Idffa135a11a56bd6afdd2728706fd40168e80912 Signed-off-by: Jim Hahn --- .../onap/policy/controlloop/eventmanager/Step.java | 27 +++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'controlloop/common/eventmanager/src/main') diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/Step.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/Step.java index 01c64e5bc..ae51c737f 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/Step.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/Step.java @@ -55,11 +55,19 @@ public class Step { private final AtomicReference startTime; /** - * {@code True} if this step is for the policy's actual operation, {@code false} if it's a preprocessor step. + * {@code True} if this step is for the policy's actual operation, {@code false} if + * it's a preprocessor step. */ @Getter private final boolean policyStep; + /** + * The parent step from which this was constructed, or {@code null} if is was not + * constructed from another step. + */ + @Getter + private final Step parentStep; + /** * The operation for this step. */ @@ -73,7 +81,8 @@ public class Step { /** - * Constructs the object. This is used when constructing the step for the policy's actual operation. + * Constructs the object. This is used when constructing the step for the policy's + * actual operation. * * @param params operation parameters * @param startTime start time of the first step for the current policy, initially @@ -83,21 +92,23 @@ public class Step { this.params = params; this.startTime = startTime; this.policyStep = true; + this.parentStep = null; } /** - * Constructs the object using information from another step. This is used when constructing a preprocessing - * step. + * Constructs the object using information from another step. This is used when + * constructing a preprocessing step. * - * @param otherStep step whose information should be used + * @param parentStep parent step whose information should be used * @param actor actor name * @param operation operation name */ - public Step(Step otherStep, String actor, String operation) { - this.params = otherStep.params.toBuilder().actor(actor).operation(operation).retry(null).timeoutSec(null) + public Step(Step parentStep, String actor, String operation) { + this.params = parentStep.params.toBuilder().actor(actor).operation(operation).retry(null).timeoutSec(null) .payload(new LinkedHashMap<>()).build(); - this.startTime = otherStep.startTime; + this.startTime = parentStep.startTime; this.policyStep = false; + this.parentStep = parentStep; } public String getActorName() { -- cgit 1.2.3-korg