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.Status |
| Constructor and Description |
|---|
HealthCheckResponse()
Default constructor
|
HealthCheckResponse(String name,
HealthCheckResponse.Status status,
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.Status |
getStatus() |
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.Status status, Optional<Map<String,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(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.Status getStatus()
Copyright © 2016 – 2021 Eclipse Foundation. All rights reserved.
Use is subject to license terms.