@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
try {
- if(req.isUserInRole(PERM_DB_POOL_CLEAR)) {
+ if (req.isUserInRole(PERM_DB_POOL_CLEAR)) {
context.dbReset(trans);
trans.audit().log("DB Sessions have been cleared by "+trans.user());
return;
}
context.error(trans,resp,Result.err(Result.ERR_Denied,"%s is not allowed to clear dbsessions",trans.user()));
- } catch(Exception e) {
+ } catch (Exception e) {
trans.error().log(e, "clearing dbsession");
context.error(trans,resp,Result.err(e));
}
@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
String ip = pathParam(req,":ip");
- if(req.isUserInRole(PERM_DENY_IP)) {
- if(DenialOfServiceTaf.denyIP(ip)) {
+ if (req.isUserInRole(PERM_DENY_IP)) {
+ if (DenialOfServiceTaf.denyIP(ip)) {
trans.audit().log(ip+" has been set to deny by "+trans.user());
trans.checkpoint(SUCCESS,Trans.ALWAYS);
@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
String ip = pathParam(req,":ip");
- if(req.isUserInRole(PERM_DENY_IP)) {
- if(DenialOfServiceTaf.removeDenyIP(ip)) {
+ if (req.isUserInRole(PERM_DENY_IP)) {
+ if (DenialOfServiceTaf.removeDenyIP(ip)) {
trans.audit().log(ip+" has been removed from denial by "+trans.user());
trans.checkpoint(SUCCESS,Trans.ALWAYS);
resp.setStatus(HttpStatus.OK_200);
@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
String id = pathParam(req,":id");
- if(req.isUserInRole(PERM_DENY_ID)) {
- if(DenialOfServiceTaf.denyID(id)) {
+ if (req.isUserInRole(PERM_DENY_ID)) {
+ if (DenialOfServiceTaf.denyID(id)) {
trans.audit().log(id+" has been set to deny by "+trans.user());
trans.checkpoint(SUCCESS,Trans.ALWAYS);
resp.setStatus(HttpStatus.CREATED_201);
@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
String id = pathParam(req,":id");
- if(req.isUserInRole(PERM_DENY_ID)) {
- if(DenialOfServiceTaf.removeDenyID(id)) {
+ if (req.isUserInRole(PERM_DENY_ID)) {
+ if (DenialOfServiceTaf.removeDenyID(id)) {
trans.audit().log(id+" has been removed from denial by " + trans.user());
trans.checkpoint(SUCCESS,Trans.ALWAYS);
resp.setStatus(HttpStatus.OK_200);
@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
String id = pathParam(req,":id");
- if(req.isUserInRole(PERM_LOG_ID)) {
- if(Question.specialLogOn(trans,id)) {
+ if (req.isUserInRole(PERM_LOG_ID)) {
+ if (Question.specialLogOn(trans,id)) {
trans.audit().log(id+" has been set to special Log by "+trans.user());
trans.checkpoint(SUCCESS,Trans.ALWAYS);
resp.setStatus(HttpStatus.CREATED_201);
@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
String id = pathParam(req,":id");
- if(req.isUserInRole(PERM_LOG_ID)) {
- if(Question.specialLogOff(trans,id)) {
+ if (req.isUserInRole(PERM_LOG_ID)) {
+ if (Question.specialLogOff(trans,id)) {
trans.audit().log(id+" has been removed from special Logging by " + trans.user());
trans.checkpoint(SUCCESS,Trans.ALWAYS);
resp.setStatus(HttpStatus.OK_200);