diff options
Diffstat (limited to 'controlloop/common/policy-yaml/src/main')
2 files changed, 13 insertions, 23 deletions
diff --git a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/ControlLoopPolicyBuilder.java b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/ControlLoopPolicyBuilder.java index 123fe2fa1..3c43756c3 100644 --- a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/ControlLoopPolicyBuilder.java +++ b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/ControlLoopPolicyBuilder.java @@ -177,20 +177,12 @@ public interface ControlLoopPolicyBuilder { /** * Creates a policy that is chained to the result of another Policy. * - * @param name name - * @param description description - * @param actor actor - * @param target target - * @param recipe recipe - * @param retries retries - * @param timeout timeout - * @param policyId id + * @param policyParam policy parameters object * @param results results * @return Policy that was set * @throws BuilderException builder exception */ - public Policy setPolicyForPolicyResult(String name, String description, String actor, Target target, String recipe, - Map<String, String> payload, Integer retries, Integer timeout, String policyId, PolicyResult... results) + public Policy setPolicyForPolicyResult(PolicyParam policyParam, PolicyResult... results) throws BuilderException; diff --git a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/impl/ControlLoopPolicyBuilderImpl.java b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/impl/ControlLoopPolicyBuilderImpl.java index 6950523cb..bd3939886 100644 --- a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/impl/ControlLoopPolicyBuilderImpl.java +++ b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/impl/ControlLoopPolicyBuilderImpl.java @@ -228,30 +228,28 @@ public class ControlLoopPolicyBuilderImpl implements ControlLoopPolicyBuilder { } @Override - public Policy setPolicyForPolicyResult(String name, String description, String actor, Target target, String recipe, - Map<String, String> payload, Integer retries, Integer timeout, - String policyId, PolicyResult... results) + public Policy setPolicyForPolicyResult(PolicyParam policyParam, PolicyResult... results) throws BuilderException { // // Find the existing policy // - Policy existingPolicy = this.findPolicy(policyId); + Policy existingPolicy = this.findPolicy(policyParam.getId()); if (existingPolicy == null) { - throw new BuilderException(UNKNOWN_POLICY + policyId); + throw new BuilderException(UNKNOWN_POLICY + policyParam.getId()); } // // Create the new Policy // Policy newPolicy = new Policy( PolicyParam.builder().id(UUID.randomUUID().toString()) - .name(name) - .description(description) - .actor(actor) - .payload(payload) - .target(target) - .recipe(recipe) - .retries(retries) - .timeout(timeout) + .name(policyParam.getName()) + .description(policyParam.getDescription()) + .actor(policyParam.getActor()) + .payload(policyParam.getPayload()) + .target(policyParam.getTarget()) + .recipe(policyParam.getRecipe()) + .retries(policyParam.getRetries()) + .timeout(policyParam.getTimeout()) .build()); // // Connect the results |