X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ONAP-PDP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpdp%2Frest%2Fapi%2Fservices%2FActionPolicyService.java;h=b60878f8b4be9cdc9f0a55fa7b9a9f4fee061c6d;hb=343df73f2b2dd2a39d090244c091371edbd2127f;hp=5016e0690c9a37b99ee94d92981f5a3366588f27;hpb=6ed1731fa2ce340d745dc2d39ffc6a066f50fbc2;p=policy%2Fengine.git diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/ActionPolicyService.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/ActionPolicyService.java index 5016e0690..b60878f8b 100644 --- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/ActionPolicyService.java +++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/ActionPolicyService.java @@ -3,6 +3,7 @@ * ONAP-PDP-REST * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Modified Copyright (C) 2018 Samsung Electronics Co., Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +29,7 @@ import org.onap.policy.common.logging.flexlogger.FlexLogger; import org.onap.policy.common.logging.flexlogger.Logger; import org.onap.policy.xacml.api.XACMLErrorConstants; import org.onap.policy.xacml.std.pap.StdPAPPolicy; +import org.onap.policy.xacml.std.pap.StdPAPPolicyParams; /** * Action Policy Implementation. @@ -94,11 +96,19 @@ public class ActionPolicyService { operation = "create"; } // Create Policy - StdPAPPolicy newPAPPolicy = new StdPAPPolicy(policyName, policyParameters.getPolicyDescription(), - componentAttributes, policyParameters.getDynamicRuleAlgorithmLabels(), - policyParameters.getDynamicRuleAlgorithmFunctions(), - policyParameters.getDynamicRuleAlgorithmField1(), policyParameters.getDynamicRuleAlgorithmField2(), - actionPerformer, actionAttribute, updateFlag, policyScope, 0); + StdPAPPolicy newPAPPolicy = new StdPAPPolicy(StdPAPPolicyParams.builder().policyName(policyName) + .description(policyParameters.getPolicyDescription()) + .dynamicFieldConfigAttributes(componentAttributes) + .dynamicRuleAlgorithmLabels(policyParameters.getDynamicRuleAlgorithmLabels()) + .dynamicRuleAlgorithmCombo(policyParameters.getDynamicRuleAlgorithmFunctions()) + .dynamicRuleAlgorithmField1(policyParameters.getDynamicRuleAlgorithmField1()) + .dynamicRuleAlgorithmField2(policyParameters.getDynamicRuleAlgorithmField2()) + .actionPerformer(actionPerformer) + .actionAttribute(actionAttribute) + .editPolicy(updateFlag) + .domain(policyScope) + .highestVersion(0) + .build()); // send Json to PAP response = (String) papServices.callPAP(newPAPPolicy, new String[]{"operation=" + operation, "apiflag=api", "policyType=Action"}, policyParameters.getRequestID(), "Action");