if (policyId.contains("Config_MS_") || policyId.contains("BRMS_Param")) {
PushPolicyHandler pushPolicyHandler = PushPolicyHandler.getInstance();
policyForSafetyCheck.setId(policyId);
- if (pushPolicyHandler.preSafetyCheck(policyForSafetyCheck, XACMLPapServlet.getConfigHome())) {
+ if (pushPolicyHandler.preSafetyCheck(policyForSafetyCheck,
+ XACMLPapServlet.getConfigHome())) {
LOGGER.debug("Precheck Successful.");
}
}
}
/*
- * If request comes from the API we need to run the PolicyDBDao updateGroup() to
- * notify other paps of the change. The GUI does this from the POLICY-SDK-APP code.
+ * If request comes from the API we need to run the PolicyDBDao updateGroup() to notify other paps of
+ * the change. The GUI does this from the POLICY-SDK-APP code.
*/
// Get new transaction to perform updateGroup()
// It should never be the case that multiple groups are
// currently marked as the default, but protect against that
// anyway.
- PolicyDBDaoTransaction setDefaultGroupTransaction = XACMLPapServlet.getPolicyDbDao().getNewTransaction();
+ PolicyDBDaoTransaction setDefaultGroupTransaction =
+ XACMLPapServlet.getPolicyDbDao().getNewTransaction();
try {
setDefaultGroupTransaction.changeDefaultGroup(group, PAPSERVLETDOACPOST);
papEngine.setDefaultGroup(group);
loggingContext.transactionEnded();
PolicyLogger.audit(TRANSACTIONFAILED);
setResponseError(response, HttpServletResponse.SC_NOT_FOUND, message);
+ acPutTransaction.rollbackTransaction();
return;
}
if (request.getParameter("policy") != null) {
PolicyLogger.audit(TRANSACTIONFAILED);
auditLogger.info(SUCCESS);
PolicyLogger.audit(TRANSENDED);
+ acPutTransaction.rollbackTransaction();
return;
} else if (request.getParameter("pdpId") != null) {
// ARGS: group=<groupId> pdpId=<pdpId/URL> <= create a new PDP
loggingContext.transactionEnded();
PolicyLogger.audit(TRANSACTIONFAILED);
setResponseError(response, HttpServletResponse.SC_BAD_REQUEST, "UNIMPLEMENTED");
+ acPutTransaction.rollbackTransaction();
return;
} else {
// Assume that this is an update of an existing PDP Group
loggingContext.transactionEnded();
PolicyLogger.audit(TRANSACTIONFAILED);
setResponseError(response, HttpServletResponse.SC_NOT_FOUND, "Unknown groupId '" + groupId + "'");
+ removePdpOrGroupTransaction.rollbackTransaction();
return;
}
// determine the operation needed based on the parameters in the
loggingContext.transactionEnded();
PolicyLogger.audit(TRANSACTIONFAILED);
setResponseError(response, HttpServletResponse.SC_BAD_REQUEST, "UNIMPLEMENTED");
+ removePdpOrGroupTransaction.rollbackTransaction();
return;
} else if (request.getParameter("pdpId") != null) {
// ARGS: group=<groupId> pdpId=<pdpId> <= delete PDP
loggingContext.transactionEnded();
PolicyLogger.audit(TRANSACTIONFAILED);
setResponseError(response, HttpServletResponse.SC_BAD_REQUEST, "UNIMPLEMENTED");
+ removePdpOrGroupTransaction.rollbackTransaction();
return;
} else {
// ARGS: group=<groupId> movePDPsToGroupId=<movePDPsToGroupId>