public class HealthCheckResponse extends 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.State |
| Constructor and Description |
|---|
HealthCheckResponse()
Default constructor
|
HealthCheckResponse(String name,
HealthCheckResponse.State state,
Optional<Map<String,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(String name)
Creates a failed health check with a name.
|
Optional<Map<String,Object>> |
getData() |
String |
getName() |
HealthCheckResponse.State |
getState() |
static HealthCheckResponseBuilder |
named(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(String name)
Creates a successful health check with a name.
|
public HealthCheckResponse(String name, HealthCheckResponse.State state, Optional<Map<String,Object>> data)
name - Health Check procedure's namestate - Health Check procedure's statedata - additional data for Health Check procedurepublic HealthCheckResponse()
public static void setResponseProvider(HealthCheckResponseProvider provider)
provider - the provider instance to use.public static HealthCheckResponseBuilder named(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(String name)
name - the check namepublic static HealthCheckResponse down(String name)
name - the check namepublic String getName()
public HealthCheckResponse.State getState()
Copyright © 2020 Eclipse Foundation. All rights reserved.