Stream doCheck()

in geronimo-microprofile-reporter/src/main/java/org/apache/geronimo/microprofile/reporter/storage/plugins/health/HealthDataExtractor.java [35:49]


    Stream<CheckSnapshot> doCheck() {
        return checks.stream().map(check -> {
            try {
                return check.call();
            } catch (final RuntimeException re) {
                return HealthCheckResponse.named(check.getClass().getName())
                                          .down()
                                          .withData("exceptionMessage", re.getMessage())
                                          .build();
            }
        }).map(healthCheckResponse -> new CheckSnapshot(
                healthCheckResponse.getName(),
                ofNullable(healthCheckResponse.getState()).orElse(HealthCheckResponse.State.DOWN).name(),
                healthCheckResponse.getData().map(HashMap::new).orElseGet(HashMap::new)));
    }