Package org.eclipse.microprofile.health
Class HealthCheckResponse
java.lang.Object
org.eclipse.microprofile.health.HealthCheckResponse
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.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionDefault constructorHealthCheckResponse
(String name, HealthCheckResponse.State state, Optional<Map<String, Object>> data) Constructor allowing instantiation from 3rd party framework like MicroProfile Rest client -
Method Summary
Modifier and TypeMethodDescriptionstatic HealthCheckResponseBuilder
builder()
Creates an emptyHealthCheckResponseBuilder
.static HealthCheckResponse
Creates a failed health check with a name.getData()
getName()
getState()
static HealthCheckResponseBuilder
Creates aHealthCheckResponseBuilder
with a name.static void
Used by OSGi environment where the service loader pattern is not supported.static HealthCheckResponse
Creates a successful health check with a name.
-
Constructor Details
-
HealthCheckResponse
public HealthCheckResponse(String name, HealthCheckResponse.State state, Optional<Map<String, Object>> data) Constructor allowing instantiation from 3rd party framework like MicroProfile Rest client- Parameters:
name
- Health Check procedure's namestate
- Health Check procedure's statedata
- additional data for Health Check procedure
-
HealthCheckResponse
public HealthCheckResponse()Default constructor
-
-
Method Details
-
setResponseProvider
Used by OSGi environment where the service loader pattern is not supported.- Parameters:
provider
- the provider instance to use.
-
named
Creates aHealthCheckResponseBuilder
with a name.- Parameters:
name
- the check name- Returns:
- a new health check builder with a name
-
builder
Creates an emptyHealthCheckResponseBuilder
. Note: The health check response name is required and needs to be set before the response is constructed.- Returns:
- a new, empty health check builder
-
up
Creates a successful health check with a name.- Parameters:
name
- the check name- Returns:
- a new sucessful health check response with a name
-
down
Creates a failed health check with a name.- Parameters:
name
- the check name- Returns:
- a new failed health check response with a name
-
getName
-
getState
-
getData
-