Search in sources :

Example 1 with HealthRecord

use of password.pwm.ws.server.rest.bean.HealthRecord in project pwm by pwm-project.

the class RestHealthServer method processGetHealthCheckData.

public static HealthData processGetHealthCheckData(final PwmApplication pwmApplication, final Locale locale, final boolean refreshImmediate) throws IOException, PwmUnrecoverableException {
    final HealthMonitor healthMonitor = pwmApplication.getHealthMonitor();
    final HealthMonitor.CheckTimeliness timeliness = determineDataTimeliness(refreshImmediate);
    final List<password.pwm.health.HealthRecord> healthRecords = new ArrayList<>(healthMonitor.getHealthRecords(timeliness));
    final List<HealthRecord> healthRecordBeans = HealthRecord.fromHealthRecords(healthRecords, locale, pwmApplication.getConfig());
    final HealthData healthData = new HealthData();
    healthData.timestamp = healthMonitor.getLastHealthCheckTime();
    healthData.overall = healthMonitor.getMostSevereHealthStatus(timeliness).toString();
    healthData.records = healthRecordBeans;
    return healthData;
}
Also used : HealthData(password.pwm.ws.server.rest.bean.HealthData) HealthRecord(password.pwm.ws.server.rest.bean.HealthRecord) HealthMonitor(password.pwm.health.HealthMonitor) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 HealthMonitor (password.pwm.health.HealthMonitor)1 HealthData (password.pwm.ws.server.rest.bean.HealthData)1 HealthRecord (password.pwm.ws.server.rest.bean.HealthRecord)1