Class HealthEndpoint


  • @Endpoint(value="health",
              defaultSensitive=false)
    public class HealthEndpoint
    extends java.lang.Object

    Exposes an Endpoint to provide information about the health of the application.

    Since:
    1.0
    • Field Detail

      • DEFAULT_SENSITIVE

        public static final boolean DEFAULT_SENSITIVE
        If the endpoint is sensitive if no configuration is provided.
        See Also:
        Constant Field Values
      • PREFIX

        public static final java.lang.String PREFIX
        Prefix for health endpoint.
        See Also:
        Constant Field Values
    • Method Detail

      • getHealth

        @Read
        @SingleResult
        public org.reactivestreams.Publisher<HealthResult> getHealth​(@Nullable
                                                                     java.security.Principal principal)
        Return all health indicators.
        Parameters:
        principal - Authenticated user
        Returns:
        The health information as a Mono
      • getHealth

        @Read
        @SingleResult
        public org.reactivestreams.Publisher<HealthResult> getHealth​(@Nullable
                                                                     java.security.Principal principal,
                                                                     @Selector
                                                                     HealthCheckType selector)
        Return health indicators based on the selector.
        Parameters:
        principal - Authenticated user
        selector - HealthEndpointSelector
        Returns:
        The health information as a Mono
      • isServiceReadyIndicatorEnabled

        public boolean isServiceReadyIndicatorEnabled()
        Whether the ServiceReadyHealthIndicator is enabled. Defaults to true.
        Returns:
        True if it is enabled.
      • setServiceReadyIndicatorEnabled

        public void setServiceReadyIndicatorEnabled​(boolean serviceReadyIndicatorEnabled)
        Set whether the ServiceReadyHealthIndicator is enabled. Defaults to true.
        Parameters:
        serviceReadyIndicatorEnabled - True if the service ready indicator should be enabled.
      • getDetailsVisible

        public DetailsVisibility getDetailsVisible()
        Returns:
        The visibility policy for health information.
      • setDetailsVisible

        public void setDetailsVisible​(DetailsVisibility detailsVisible)
        Sets the visibility policy for health information.
        Parameters:
        detailsVisible - The DetailsVisibility
      • setStatusConfiguration

        @Inject
        public void setStatusConfiguration​(HealthEndpoint.StatusConfiguration statusConfiguration)
        Sets the status configuration.
        Parameters:
        statusConfiguration - The status configuration
      • levelOfDetail

        protected HealthLevelOfDetail levelOfDetail​(@Nullable
                                                    java.security.Principal principal)
        Returns the level of detail that should be returned by the endpoint.
        Parameters:
        principal - Authenticated user
        Returns:
        The HealthLevelOfDetail