public final class HealthCheckHelper extends Object
HealthCheck
's.
The helper will lookup the HealthCheckRegistry
from CamelContext
and gather all the registered
HealthCheck
s and invoke them and gather their responses.
The helper allows to filter out unwanted health checks using HealthCheckFilter
or to invoke only readiness or
liveness checks.Modifier and Type | Method and Description |
---|---|
static String |
getGroup(HealthCheck check)
Get the group of the given check or an empty string if the group is not set.
|
static Collection<HealthCheck.Result> |
invoke(CamelContext camelContext)
Invokes the checks and returns a collection of results.
|
static Collection<HealthCheck.Result> |
invoke(CamelContext camelContext,
Function<HealthCheck,Map<String,Object>> optionsSupplier)
Invokes the checks and returns a collection of results.
|
static Collection<HealthCheck.Result> |
invoke(CamelContext camelContext,
Function<HealthCheck,Map<String,Object>> optionsSupplier,
HealthCheckFilter filter)
Invokes the checks and returns a collection of results.
|
static Collection<HealthCheck.Result> |
invoke(CamelContext camelContext,
HealthCheckFilter filter)
Invokes the checks and returns a collection of results.
|
static Optional<HealthCheck.Result> |
invoke(CamelContext camelContext,
String id,
Map<String,Object> options)
Invoke a check by id.
|
static Collection<HealthCheck.Result> |
invokeLiveness(CamelContext camelContext)
Invokes the liveness checks and returns a collection of results.
|
static Collection<HealthCheck.Result> |
invokeReadiness(CamelContext camelContext)
Invokes the readiness checks and returns a collection of results.
|
static Optional<HealthCheck.Result> |
query(CamelContext camelContext,
String id,
Map<String,Object> options)
Query the status of a check by id.
|
public static String getGroup(HealthCheck check)
check
- the health checkHasGroup.getGroup()
or an empty string if it is null
public static Collection<HealthCheck.Result> invoke(CamelContext camelContext)
public static Collection<HealthCheck.Result> invokeReadiness(CamelContext camelContext)
public static Collection<HealthCheck.Result> invokeLiveness(CamelContext camelContext)
public static Collection<HealthCheck.Result> invoke(CamelContext camelContext, Function<HealthCheck,Map<String,Object>> optionsSupplier)
public static Collection<HealthCheck.Result> invoke(CamelContext camelContext, HealthCheckFilter filter)
public static Collection<HealthCheck.Result> invoke(CamelContext camelContext, Function<HealthCheck,Map<String,Object>> optionsSupplier, HealthCheckFilter filter)
camelContext
- the camel context.optionsSupplier
- a supplier for options.filter
- filter to exclude some checks.public static Optional<HealthCheck.Result> query(CamelContext camelContext, String id, Map<String,Object> options)
HealthCheck
.camelContext
- the camel context.id
- the check id.options
- the check options.HealthCheck.Result
.public static Optional<HealthCheck.Result> invoke(CamelContext camelContext, String id, Map<String,Object> options)
camelContext
- the camel context.id
- the check id.options
- the check options.HealthCheck.Result
.Apache Camel