Class HealthSupport.Builder

    • Method Detail

      • webContext

        public HealthSupport.Builder webContext​(String path)
        Path under which to register health check endpoint on the web server.
        Parameters:
        path - webContext to use, defaults to
        Returns:
        updated builder instance
      • 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
      • 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.
        Parameters:
        config - node located on this component's configuration
        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... healthCheck)
        Add liveness health check(s).
        Parameters:
        healthCheck - a health check to add
        Returns:
        updated builder instance
      • addReadiness

        public HealthSupport.Builder addReadiness​(HealthCheck... healthCheck)
        Add readiness health check(s).
        Parameters:
        healthCheck - a health check 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
      • backwardCompatible

        public HealthSupport.Builder backwardCompatible​(boolean enabled)
        Backward compatibility flag to produce Health 1.X compatible JSON output (including "outcome" property).
        Parameters:
        enabled - whether to enable backward compatible mode (defaults to true)
        Returns:
        updated builder instance