public abstract class HealthStatus extends Object
Constructor and Description |
---|
HealthStatus() |
Modifier and Type | Method and Description |
---|---|
static HealthStatus |
create(int status,
String message)
Create an instance with the given message and status code.
|
static HealthStatus |
create(int status,
String message,
Throwable exception)
Create an instance with the given message, status code, and exception.
|
abstract Optional<Throwable> |
getException()
Returns the health check exception, or
Optional.empty() if no exception occurred. |
abstract String |
getMessage()
Returns a description of the status of the dependency (eg.
|
abstract int |
getStatus()
Returns the HTTP status code returned by the dependency, as seen from the location of the
health check resource (eg.
|
public static HealthStatus create(int status, String message)
public static HealthStatus create(int status, String message, Throwable exception)
public abstract String getMessage()
public abstract int getStatus()
For dependencies without an HTTP health check, this should simulate what such a health check would return - e.g. 200 for healthy, 503 for unavailable.
public abstract Optional<Throwable> getException()
Optional.empty()
if no exception occurred.Copyright © 2020 Cerner Innovation, Inc.. All rights reserved.