diff options
author | uj426b <uj426b@att.com> | 2020-04-22 12:46:19 -0400 |
---|---|---|
committer | uj426b <uj426b@att.com> | 2020-04-22 13:40:01 -0400 |
commit | 3c368e2cdb9817ae0b04596f317e966c31aef569 (patch) | |
tree | 4d573b8fb864d3496c9a0ba24b6f5b0f6aafc837 /POLICY-SDK-APP/src/main/java | |
parent | 1f35b78f96933ad3a0976d03863e4d23b544ee86 (diff) |
Fix for Push/Unpush Policy On GUI
Issue-ID: POLICY-2518
Change-Id: Ie70fc5049f87b55384731900373884d8b25803bb
Signed-off-by: uj426b <uj426b@att.com>
Diffstat (limited to 'POLICY-SDK-APP/src/main/java')
-rw-r--r-- | POLICY-SDK-APP/src/main/java/org/onap/policy/admin/RESTfulPAPEngine.java | 10 | ||||
-rw-r--r-- | POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/RESTfulPAPEngine.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/RESTfulPAPEngine.java index ff72e0224..d89dd2784 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/RESTfulPAPEngine.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/RESTfulPAPEngine.java @@ -270,7 +270,7 @@ public class RESTfulPAPEngine extends StdPDPItemSetChangeNotifier implements PAP public void publishPolicy(String id, String name, boolean isRoot, InputStream policy, OnapPDPGroup group) throws PAPException { // copy the (one) file into the target directory on the PAP servlet - copyFile(id, group, policy); + copyFile(id, group, policy, null); // adjust the local copy of the group to include the new policy PDPPolicy pdpPolicy = new StdPDPPolicy(id, isRoot, name); @@ -289,10 +289,10 @@ public class RESTfulPAPEngine extends StdPDPItemSetChangeNotifier implements PAP * @param policy Input stream of policy * @throws PAPException exception */ - public void copyFile(String policyId, OnapPDPGroup group, InputStream policy) throws PAPException { + public void copyFile(String policyId, OnapPDPGroup group, InputStream policy, String usrId) throws PAPException { // send the policy file to the PAP Servlet try { - sendToPap("POST", policy, null, null, GROUP_ID + group.getId(), "policyId=" + policyId); + sendToPap("POST", policy, null, null, GROUP_ID + group.getId(), "policyId=" + policyId, "userId=" + usrId ); } catch (Exception e) { String message = UNABLE_MSG + policyId + EXCEPTION_MSG + e; LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + message, e); @@ -301,12 +301,12 @@ public class RESTfulPAPEngine extends StdPDPItemSetChangeNotifier implements PAP } @Override - public void copyPolicy(PDPPolicy policy, OnapPDPGroup group) throws PAPException { + public void copyPolicy(PDPPolicy policy, OnapPDPGroup group, String userId) throws PAPException { if (policy == null || group == null) { throw new PAPException("Null input policy=" + policy + " group=" + group); } try (InputStream is = new FileInputStream(new File(policy.getLocation()))) { - copyFile(policy.getId(), group, is); + copyFile(policy.getId(), group, is, userId); } catch (Exception e) { String message = UNABLE_MSG + policy.getId() + EXCEPTION_MSG + e; LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + message, e); diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java index e8217b99b..dc342eeed 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java @@ -293,7 +293,7 @@ public class AutoPushController extends RestrictedBaseController { } // copy policy to PAP try { - controller.getPapEngine().copyPolicy(selectedPolicy, (StdPDPGroup) pdpDestinationGroupId); + controller.getPapEngine().copyPolicy(selectedPolicy, (StdPDPGroup) pdpDestinationGroupId, userId); } catch (PAPException e) { logger.error("Exception Occured" + e); return null; @@ -390,7 +390,7 @@ public class AutoPushController extends RestrictedBaseController { updatedGroupObject.setPipConfigs(group.getPipConfigs()); updatedGroupObject.setStatus(group.getStatus()); updatedGroupObject.setOperation("delete"); - this.container.updateGroup(updatedGroupObject); + this.container.updateGroup(updatedGroupObject, userId); } response.setContentType(PolicyUtils.APPLICATION_JSON); |