use of password.pwm.ws.server.RestResultBean in project pwm by pwm-project.
the class AdminServlet method processClearIntruderTable.
@ActionHandler(action = "clearIntruderTable")
private ProcessStatus processClearIntruderTable(final PwmRequest pwmRequest) throws ChaiUnavailableException, PwmUnrecoverableException, IOException, ServletException {
if (!pwmRequest.getPwmSession().getSessionManager().checkPermission(pwmRequest.getPwmApplication(), Permission.PWMADMIN)) {
LOGGER.info(pwmRequest, "unable to execute clear intruder records");
return ProcessStatus.Halt;
}
// pwmApplication.getIntruderManager().clear();
final RestResultBean restResultBean = RestResultBean.forSuccessMessage(pwmRequest, Message.Success_Unknown);
pwmRequest.outputJsonResult(restResultBean);
return ProcessStatus.Halt;
}
use of password.pwm.ws.server.RestResultBean in project pwm by pwm-project.
the class AdminServlet method processReportStatus.
@ActionHandler(action = "reportStatus")
private ProcessStatus processReportStatus(final PwmRequest pwmRequest) throws ChaiUnavailableException, PwmUnrecoverableException, IOException {
try {
final ReportStatusBean returnMap = ReportStatusBean.makeReportStatusData(pwmRequest.getPwmApplication().getReportService(), pwmRequest.getPwmSession().getSessionStateBean().getLocale());
final RestResultBean restResultBean = RestResultBean.withData(returnMap);
pwmRequest.outputJsonResult(restResultBean);
} catch (LocalDBException e) {
throw new PwmUnrecoverableException(e.getErrorInformation());
}
return ProcessStatus.Halt;
}
use of password.pwm.ws.server.RestResultBean in project pwm by pwm-project.
the class AdminServlet method restSessionDataHandler.
@ActionHandler(action = "sessionData")
private ProcessStatus restSessionDataHandler(final PwmRequest pwmRequest) throws ChaiUnavailableException, PwmUnrecoverableException, IOException {
final int max = readMaxParameter(pwmRequest, 1000, 10 * 1000);
final ArrayList<SessionStateInfoBean> gridData = new ArrayList<>();
int counter = 0;
final Iterator<SessionStateInfoBean> infos = pwmRequest.getPwmApplication().getSessionTrackService().getSessionInfoIterator();
while (counter < max && infos.hasNext()) {
gridData.add(infos.next());
counter++;
}
final RestResultBean restResultBean = RestResultBean.withData(gridData);
pwmRequest.outputJsonResult(restResultBean);
return ProcessStatus.Halt;
}
Aggregations