Class HealthSupport.Builder

All Implemented Interfaces:
Builder<HealthSupport.Builder,HealthSupport>, Supplier<HealthSupport>
Enclosing class:
HealthSupport

public static final class HealthSupport.Builder extends HelidonRestServiceSupport.Builder<HealthSupport.Builder,HealthSupport>
Fluent API builder for HealthSupport.
  • Field Details

    • HEALTH_CONFIG_KEY

      public static final String HEALTH_CONFIG_KEY
      Config key for the health section.
      See Also:
    • ENABLED_CONFIG_KEY

      public static final String ENABLED_CONFIG_KEY
      Config key within the config health section controlling whether health is enabled.
      See Also:
    • INCLUDE_CONFIG_KEY

      public static final String INCLUDE_CONFIG_KEY
      Config key within the config health section indicating health checks to include.
      See Also:
    • EXCLUDE_CONFIG_KEY

      public static final String EXCLUDE_CONFIG_KEY
      Config key within the config health section indicating health checks to exclude.
      See Also:
    • EXCLUDE_CLASSES_CONFIG_KEY

      public static final String EXCLUDE_CLASSES_CONFIG_KEY
      Config key within the config health section indicating health check implementation classes to exclude.
      See Also:
    • TIMEOUT_CONFIG_KEY

      public static final String TIMEOUT_CONFIG_KEY
      Config key within the config health section controlling the timeout for calculating the health report when clients access the health endpoint.
      See Also:
  • Method Details

    • build

      public HealthSupport build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Returns:
      instance of the built type
    • addIncluded

      public HealthSupport.Builder addIncluded(String healthCheckName)
      Add a health check to a white list (in case HealthSupport.includeAll is set to false.
      Parameters:
      healthCheckName - name of a health check to include
      Returns:
      updated builder instance
    • addIncluded

      public HealthSupport.Builder addIncluded(Collection<String> names)
      Add health checks to a white list (in case HealthSupport.includeAll is set to false.
      Parameters:
      names - names of health checks to include
      Returns:
      updated builder instance
    • addExcluded

      public HealthSupport.Builder addExcluded(String healthCheckName)
      Add a health check to a black list. Health check results that match by name with a blacklisted records will not be part of the result.
      Parameters:
      healthCheckName - name of a health check to exclude
      Returns:
      updated builder instance
    • addExcluded

      public HealthSupport.Builder addExcluded(Collection<String> names)
      Add health checks to a black list. Health check results that match by name with a blacklisted records will not be part of the result.
      Parameters:
      names - names of health checks to exclude
      Returns:
      updated builder instance
    • config

      public HealthSupport.Builder config(Config config)
      Update this builder from configuration.
      Overrides:
      config in class HelidonRestServiceSupport.Builder<HealthSupport.Builder,HealthSupport>
      Parameters:
      config - node located on this component's configuration
      Returns:
      updated builder instance
    • timeout

      public HealthSupport.Builder timeout(long timeout, TimeUnit unit)
      Configure overall timeout of health check call.
      Parameters:
      timeout - timeout value
      unit - timeout time unit
      Returns:
      updated builder instance
    • addExcludedClass

      public HealthSupport.Builder addExcludedClass(Class<?> aClass)
      A class may be excluded from invoking health checks on it. This allows configurable approach to disabling broken health-checks.
      Parameters:
      aClass - class to ignore (any health check instance of this class will be ignored)
      Returns:
      updated builder instance
    • addLiveness

      public HealthSupport.Builder addLiveness(HealthCheck... healthChecks)
      Add liveness health check(s).
      Parameters:
      healthChecks - health check(s) to add
      Returns:
      updated builder instance
    • addLiveness

      public HealthSupport.Builder addLiveness(Collection<HealthCheck> healthChecks)
      Add liveness health check(s).
      Parameters:
      healthChecks - health checks to add
      Returns:
      updated builder instance
    • addReadiness

      public HealthSupport.Builder addReadiness(HealthCheck... healthChecks)
      Add readiness health check(s).
      Parameters:
      healthChecks - health checks to add
      Returns:
      updated builder instance
    • addReadiness

      public HealthSupport.Builder addReadiness(Collection<HealthCheck> healthChecks)
      Add readiness health check(s).
      Parameters:
      healthChecks - health checks to add
      Returns:
      updated builder instance
    • addStartup

      public HealthSupport.Builder addStartup(HealthCheck... healthChecks)
      Add start-up health check(s).
      Parameters:
      healthChecks - health checks to add
      Returns:
      updated builder instance
    • addStartup

      public HealthSupport.Builder addStartup(Collection<HealthCheck> healthChecks)
      Add start-up health check(s).
      Parameters:
      healthChecks - health checks to add
      Returns:
      updated builder instance
    • enabled

      public HealthSupport.Builder enabled(boolean enabled)
      HealthSupport can be disabled by invoking this method.
      Parameters:
      enabled - whether to enable the health support (defaults to true)
      Returns:
      updated builder instance