Class HealthCheckResponse


  • public class HealthCheckResponse
    extends java.lang.Object
    The response to a health check invocation.

    The HealthCheckResponse class is reserved for an extension by implementation providers. An application should use one of the static methods to create a Response instance using a HealthCheckResponseBuilder. When used on the consuming end, The class can also be instantiated directly.

    • Constructor Detail

      • HealthCheckResponse

        public HealthCheckResponse​(java.lang.String name,
                                   HealthCheckResponse.State state,
                                   java.util.Optional<java.util.Map<java.lang.String,​java.lang.Object>> data)
        Constructor allowing instantiation from 3rd party framework like MicroProfile Rest client
        Parameters:
        name - Health Check procedure's name
        state - Health Check procedure's state
        data - additional data for Health Check procedure
      • HealthCheckResponse

        public HealthCheckResponse()
        Default constructor
    • Method Detail

      • setResponseProvider

        public static void setResponseProvider​(HealthCheckResponseProvider provider)
        Used by OSGi environment where the service loader pattern is not supported.
        Parameters:
        provider - the provider instance to use.
      • up

        public static HealthCheckResponse up​(java.lang.String name)
        Creates a successful health check with a name.
        Parameters:
        name - the check name
        Returns:
        a new sucessful health check response with a name
      • down

        public static HealthCheckResponse down​(java.lang.String name)
        Creates a failed health check with a name.
        Parameters:
        name - the check name
        Returns:
        a new failed health check response with a name
      • getName

        public java.lang.String getName()
      • getData

        public java.util.Optional<java.util.Map<java.lang.String,​java.lang.Object>> getData()