public class AvailabilityStateHealthIndicator extends AbstractHealthIndicator
HealthIndicator
that checks a specific AvailabilityState
of the
application.Modifier and Type | Class and Description |
---|---|
static interface |
AvailabilityStateHealthIndicator.StatusMappings<S extends AvailabilityState>
Callback used to add status mappings.
|
Constructor and Description |
---|
AvailabilityStateHealthIndicator(ApplicationAvailability applicationAvailability,
Class<S> stateType,
Consumer<AvailabilityStateHealthIndicator.StatusMappings<S>> statusMappings)
Create a new
AvailabilityStateHealthIndicator instance. |
Modifier and Type | Method and Description |
---|---|
protected void |
doHealthCheck(Health.Builder builder)
Actual health check logic.
|
protected AvailabilityState |
getState(ApplicationAvailability applicationAvailability)
Return the current availability state.
|
health
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHealth
public AvailabilityStateHealthIndicator(ApplicationAvailability applicationAvailability, Class<S> stateType, Consumer<AvailabilityStateHealthIndicator.StatusMappings<S>> statusMappings)
AvailabilityStateHealthIndicator
instance.S
- the availability state typeapplicationAvailability
- the application availabilitystateType
- the availability state typestatusMappings
- consumer used to setup the status mappingsprotected void doHealthCheck(Health.Builder builder) throws Exception
AbstractHealthIndicator
doHealthCheck
in class AbstractHealthIndicator
builder
- the Health.Builder
to report health status and detailsException
- any Exception
that should create a Status.DOWN
system status.protected AvailabilityState getState(ApplicationAvailability applicationAvailability)
applicationAvailability
- the application availability