Search in sources :

Example 1 with AvailabilityState

use of org.springframework.boot.availability.AvailabilityState in project spring-boot by spring-projects.

the class AvailabilityStateHealthIndicator method doHealthCheck.

@Override
protected void doHealthCheck(Builder builder) throws Exception {
    AvailabilityState state = getState(this.applicationAvailability);
    Status status = this.statusMappings.get(state);
    if (status == null) {
        status = this.statusMappings.get(null);
    }
    Assert.state(status != null, () -> "No mapping provided for " + state);
    builder.status(status);
}
Also used : Status(org.springframework.boot.actuate.health.Status) AvailabilityState(org.springframework.boot.availability.AvailabilityState)

Aggregations

Status (org.springframework.boot.actuate.health.Status)1 AvailabilityState (org.springframework.boot.availability.AvailabilityState)1