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%2FDeletePolicyService.java;fp=ONAP-PDP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpdp%2Frest%2Fapi%2Fservices%2FDeletePolicyService.java;h=52e3bcc1bb0f0e56cb98ade23cf0eba540b15779;hb=c47063d7cf7b6294547c7628630a5b9fca1daedc;hp=a7dc42642a6671548b6d234deb0f04064bab5d23;hpb=84df4a428ded309f750f52ac1c104ac84e426fc0;p=policy%2Fengine.git diff --git a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/DeletePolicyService.java b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/DeletePolicyService.java index a7dc42642..52e3bcc1b 100644 --- a/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/DeletePolicyService.java +++ b/ONAP-PDP-REST/src/main/java/org/onap/policy/pdp/rest/api/services/DeletePolicyService.java @@ -3,6 +3,7 @@ * ONAP-PDP-REST * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Modifications 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; import org.springframework.http.HttpStatus; public class DeletePolicyService { @@ -162,9 +164,12 @@ public class DeletePolicyService { LOGGER.error(message); return message; } - + // for deleting policies from the API final StdPAPPolicy deletePapPolicy = - new StdPAPPolicy(fullPolicyName, deletePolicyParameters.getDeleteCondition().toString()); + new StdPAPPolicy(StdPAPPolicyParams.builder() + .policyName(fullPolicyName) + .deleteCondition(deletePolicyParameters.getDeleteCondition().toString()) + .build()); // send JSON object to PAP response = (String) papServices.callPAP(deletePapPolicy, new String[] {"groupId=" + pdpGroup, "apiflag=deletePapApi", "operation=delete"},