use of password.pwm.svc.intruder.RecordType in project pwm by pwm-project.
the class AdminServlet method restIntruderDataHandler.
@ActionHandler(action = "intruderData")
private ProcessStatus restIntruderDataHandler(final PwmRequest pwmRequest) throws ChaiUnavailableException, PwmUnrecoverableException, IOException {
final int max = readMaxParameter(pwmRequest, 1000, 10 * 1000);
final TreeMap<String, Object> returnData = new TreeMap<>();
try {
for (final RecordType recordType : RecordType.values()) {
returnData.put(recordType.toString(), pwmRequest.getPwmApplication().getIntruderManager().getRecords(recordType, max));
}
} catch (PwmException e) {
final ErrorInformation errorInfo = new ErrorInformation(PwmError.ERROR_UNKNOWN, e.getMessage());
LOGGER.debug(pwmRequest, errorInfo);
pwmRequest.outputJsonResult(RestResultBean.fromError(errorInfo));
}
final RestResultBean restResultBean = RestResultBean.withData(returnData);
pwmRequest.outputJsonResult(restResultBean);
return ProcessStatus.Halt;
}
Aggregations