X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fadmin%2FRESTfulPAPEngine.java;fp=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fadmin%2FRESTfulPAPEngine.java;h=d89dd278478c0ebd35217825bd83147c42efc746;hp=ff72e022466fb08ca9a270a679b53bb1e62a3a8f;hb=3c368e2cdb9817ae0b04596f317e966c31aef569;hpb=1f35b78f96933ad3a0976d03863e4d23b544ee86 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);