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%2FDecisionPolicyService.java;h=85e9c6ae5e3ea1733fb9f564c3ff04baaee81de4;hb=8f4e03b0867eada5220f78a3988865851443b7da;hp=7bdf1dc71bab2eddf4f61427efba5c92c68e0e1c;hpb=a54ec0fce0cb5032d373e811d830cdd027b0dd9c;p=policy%2Fengine.git diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/DecisionPolicyService.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/DecisionPolicyService.java index 7bdf1dc71..85e9c6ae5 100644 --- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/DecisionPolicyService.java +++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/DecisionPolicyService.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. @@ -29,6 +30,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; /** * Decision Policy Implementation @@ -97,12 +99,22 @@ public class DecisionPolicyService { matchingAttributes = policyParameters.getAttributes().get(AttributeType.MATCHING); } // Create StdPAPPolicy object used to send policy data to PAP-REST. - StdPAPPolicy newPAPPolicy = new StdPAPPolicy(policyName, policyParameters.getPolicyDescription(), onapName, - ruleProvider.toString(), matchingAttributes, settingsAttributes, - policyParameters.getTreatments(), policyParameters.getDynamicRuleAlgorithmLabels(), - policyParameters.getDynamicRuleAlgorithmFunctions(), - policyParameters.getDynamicRuleAlgorithmField1(), policyParameters.getDynamicRuleAlgorithmField2(), - null, null, null, updateFlag, policyScope, 0); + StdPAPPolicy newPAPPolicy = new StdPAPPolicy(StdPAPPolicyParams.builder() + .policyName(policyName) + .description(policyParameters.getPolicyDescription()) + .onapName(onapName) + .providerComboBox(ruleProvider.toString()) + .dynamicFieldConfigAttributes(matchingAttributes) + .dynamicSettingsMap(settingsAttributes) + .treatments(policyParameters.getTreatments()) + .dynamicRuleAlgorithmLabels(policyParameters.getDynamicRuleAlgorithmLabels()) + .dynamicRuleAlgorithmCombo(policyParameters.getDynamicRuleAlgorithmFunctions()) + .dynamicRuleAlgorithmField1(policyParameters.getDynamicRuleAlgorithmField1()) + .dynamicRuleAlgorithmField2(policyParameters.getDynamicRuleAlgorithmField2()) + .editPolicy(updateFlag) + .domain(policyScope) + .highestVersion(0) + .build()); // Send JSON to PAP. response = (String) papServices.callPAP(newPAPPolicy, new String[]{"operation=" + operation, "apiflag=api", "policyType=Decision"}, policyParameters.getRequestID(), "Decision");