use of password.pwm.health.HealthRecord in project pwm by pwm-project.
the class ConfigEditorServlet method restDatabaseHealthCheck.
@ActionHandler(action = "databaseHealthCheck")
private ProcessStatus restDatabaseHealthCheck(final PwmRequest pwmRequest) throws IOException, PwmUnrecoverableException {
final Instant startTime = Instant.now();
final ConfigManagerBean configManagerBean = getBean(pwmRequest);
LOGGER.debug(pwmRequest, "beginning restDatabaseHealthCheck");
final Configuration config = new Configuration(configManagerBean.getStoredConfiguration());
final List<HealthRecord> healthRecords = DatabaseStatusChecker.checkNewDatabaseStatus(pwmRequest.getPwmApplication(), config);
final HealthData healthData = HealthRecord.asHealthDataBean(config, pwmRequest.getLocale(), healthRecords);
final RestResultBean restResultBean = RestResultBean.withData(healthData);
pwmRequest.outputJsonResult(restResultBean);
LOGGER.debug(pwmRequest, "completed restDatabaseHealthCheck in " + TimeDuration.fromCurrent(startTime).asCompactString());
return ProcessStatus.Halt;
}
Aggregations