public class HealthCheckResponse
extends java.lang.Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
HealthCheckResponse.Status |
Constructor and Description |
---|
HealthCheckResponse()
Default constructor
|
HealthCheckResponse(java.lang.String name,
HealthCheckResponse.Status status,
java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>> data)
Constructor allowing instantiation from 3rd party framework like MicroProfile Rest client
|
Modifier and Type | Method and Description |
---|---|
static HealthCheckResponseBuilder |
builder()
Creates an empty
HealthCheckResponseBuilder . |
static HealthCheckResponse |
down(java.lang.String name)
Creates a failed health check with a name.
|
java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>> |
getData() |
java.lang.String |
getName() |
HealthCheckResponse.Status |
getStatus() |
static HealthCheckResponseBuilder |
named(java.lang.String name)
Creates a
HealthCheckResponseBuilder with a name. |
static void |
setResponseProvider(HealthCheckResponseProvider provider)
Used by OSGi environment where the service loader pattern is not supported.
|
static HealthCheckResponse |
up(java.lang.String name)
Creates a successful health check with a name.
|
public HealthCheckResponse(java.lang.String name, HealthCheckResponse.Status status, java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>> data)
name
- Health Check procedure's namestatus
- Health Check procedure's statusdata
- additional data for Health Check procedurepublic HealthCheckResponse()
public static void setResponseProvider(HealthCheckResponseProvider provider)
provider
- the provider instance to use.public static HealthCheckResponseBuilder named(java.lang.String name)
HealthCheckResponseBuilder
with a name.name
- the check namepublic static HealthCheckResponseBuilder builder()
HealthCheckResponseBuilder
.
Note: The health check response name is required and needs to be set before the response is constructed.public static HealthCheckResponse up(java.lang.String name)
name
- the check namepublic static HealthCheckResponse down(java.lang.String name)
name
- the check namepublic java.lang.String getName()
public HealthCheckResponse.Status getStatus()
public java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>> getData()