Class SystemdProperties.Availability
java.lang.Object
com.github.jpmsilva.jsystemd.spring.autoconfigure.SystemdProperties.Toggle
com.github.jpmsilva.jsystemd.spring.autoconfigure.SystemdProperties.Availability
- Enclosing class:
- SystemdProperties
The
AvailabilityStatusProvider, which provides the liveness and readiness of the application.
The AvailabilityStatusProvider is always a health provider of the watchdog, while enabled, and these properties control its health: it is
opted into, as it lets systemd restart the application, so the application is always healthy unless enabled.
-
Method Summary
Modifier and TypeMethodDescription@Nullable DurationCheck the delay before suppressing the watchdog heartbeat while the liveness state of the application is broken.booleanisHealth()Check if the watchdog heartbeat is suppressed while the liveness state of the application is broken.voidsetHealth(boolean health) Enable or disable suppressing the watchdog heartbeat while the liveness state of the application is broken.voidsetUnhealthyDelay(@Nullable Duration unhealthyDelay) Set the delay before suppressing the watchdog heartbeat while the liveness state of the application is broken.Methods inherited from class com.github.jpmsilva.jsystemd.spring.autoconfigure.SystemdProperties.Toggle
isEnabled, setEnabled
-
Method Details
-
isHealth
public boolean isHealth()Check if the watchdog heartbeat is suppressed while the liveness state of the application is broken.- Returns:
trueif a broken liveness state makes the application unhealthy
-
setHealth
public void setHealth(boolean health) Enable or disable suppressing the watchdog heartbeat while the liveness state of the application is broken.- Parameters:
health-trueto make the application unhealthy while its liveness state is broken
-
getUnhealthyDelay
Check the delay before suppressing the watchdog heartbeat while the liveness state of the application is broken.- Returns:
- the delay, or
nullif there is no delay
-
setUnhealthyDelay
Set the delay before suppressing the watchdog heartbeat while the liveness state of the application is broken.- Parameters:
unhealthyDelay- the delay, ornullto disable the delay
-