Interface HealthCheck

All Superinterfaces:
HasGroup, HasId, Ordered

public interface HealthCheck extends HasGroup, HasId, Ordered
Health check
  • Field Details

  • Method Details

    • getOrder

      default int getOrder()
      Description copied from interface: Ordered
      Gets the order.

      Use low numbers for higher priority. Normally the sorting will start from 0 and move upwards. So if you want to be last then use Integer.MAX_VALUE or eg Ordered.LOWEST.

      Specified by:
      getOrder in interface Ordered
      Returns:
      the order
    • isEnabled

      boolean isEnabled()
      Whether this health check is enabled
    • setEnabled

      void setEnabled(boolean enabled)
      Used for enabling or disabling this health check
    • getMetaData

      default Map<String,Object> getMetaData()
      Return metadata associated with this HealthCheck.
    • isReadiness

      default boolean isReadiness()
      Whether this health check can be used for readiness checks. Readiness check is default.
    • isLiveness

      default boolean isLiveness()
      Whether this health check can be used for liveness checks Liveness check is not default, and must be explicit enabled.
    • call

      default HealthCheck.Result call()
      Invoke the check.
      See Also:
    • callReadiness

      default HealthCheck.Result callReadiness()
      Invoke the check as readiness check.
      See Also:
    • callLiveness

      default HealthCheck.Result callLiveness()
      Invoke the check as liveness check.
      See Also:
    • call

      Invoke the check. The implementation is responsible to eventually perform the check according to the limitation of the third party system i.e. it should not be performed too often to avoid rate limiting. The options argument can be used to pass information specific to the check like forcing the check to be performed against the policies. The implementation is responsible to catch and handle any exception thrown by the underlying technology, including unchecked ones.