use of org.eclipse.microprofile.health.HealthCheckResponseBuilder in project wildfly by wildfly.
the class MicroProfileHealthReporterService method wrap.
static HealthCheck wrap(ServerProbe delegate) {
return new HealthCheck() {
@Override
public HealthCheckResponse call() {
ServerProbe.Outcome outcome = delegate.getOutcome();
HealthCheckResponseBuilder check = HealthCheckResponse.named(delegate.getName()).status(outcome.isSuccess());
if (outcome.getData().isDefined()) {
for (Property property : outcome.getData().asPropertyList()) {
check.withData(property.getName(), property.getValue().asString());
}
}
return check.build();
}
};
}
Aggregations