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

public static class SystemdProperties.Availability extends SystemdProperties.Toggle
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 Type
    Method
    Description
    @Nullable Duration
    Check the delay before suppressing the watchdog heartbeat while the liveness state of the application is broken.
    boolean
    Check if the watchdog heartbeat is suppressed while the liveness state of the application is broken.
    void
    setHealth(boolean health)
    Enable or disable suppressing the watchdog heartbeat while the liveness state of the application is broken.
    void
    setUnhealthyDelay(@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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isHealth

      public boolean isHealth()
      Check if the watchdog heartbeat is suppressed while the liveness state of the application is broken.
      Returns:
      true if 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 - true to make the application unhealthy while its liveness state is broken
    • getUnhealthyDelay

      public @Nullable Duration getUnhealthyDelay()
      Check the delay before suppressing the watchdog heartbeat while the liveness state of the application is broken.
      Returns:
      the delay, or null if there is no delay
    • setUnhealthyDelay

      public void setUnhealthyDelay(@Nullable Duration unhealthyDelay)
      Set the delay before suppressing the watchdog heartbeat while the liveness state of the application is broken.
      Parameters:
      unhealthyDelay - the delay, or null to disable the delay