- // Check Permissions.
- if (PDPApiAuth.checkPermissions(clientEncoding, requestID, "createPolicy")) {
- CreateUpdatePolicyService createPolicyService;
- try {
- createPolicyService = (CreateUpdatePolicyService) XACMLPdpServlet.getCreateUpdatePolicyConstructor()
- .newInstance(policyParameters, requestID, false);
- response = createPolicyService.getResult();
- status = createPolicyService.getResponseCode();
- } catch (InstantiationException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
- logger.error(e.getMessage(), e);
- response = "Problem with CreateUpdate Policy Service. ";
- status = HttpStatus.INTERNAL_SERVER_ERROR;
- }
+ logger.info("Operation: createPolicy for " + policyParameters.toString() + ", Mechid : " + mechId);
+
+ CreateUpdatePolicyService createPolicyService;
+ try {
+ createPolicyService = (CreateUpdatePolicyService) XACMLPdpServlet.getCreateUpdatePolicyConstructor()
+ .newInstance(policyParameters, requestId, false);
+ response = createPolicyService.getResult();
+ status = createPolicyService.getResponseCode();
+ } catch (InstantiationException | IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException e) {
+ logger.error(e.getMessage(), e);
+ response = "Problem with CreateUpdate Policy Service. ";
+ status = HttpStatus.INTERNAL_SERVER_ERROR;