public interface HealthCheckService extends Service, CamelContextAware
HealthCheckRegistry
according to a schedule.| Modifier and Type | Method and Description |
|---|---|
void |
addStateChangeListener(BiConsumer<HealthCheck.State,HealthCheck> consumer)
Add a listener to invoke when the state of a check change.
|
default Optional<HealthCheck.Result> |
call(String id) |
Optional<HealthCheck.Result> |
call(String id,
Map<String,Object> options)
Invokes the check identified by the given
id with the given
options. |
Collection<HealthCheck.Result> |
getResults()
Return a list of the known checks status.
|
void |
notify(HealthCheck check,
HealthCheck.Result result)
Notify the service that a check has changed status.
|
void |
removeStateChangeListener(BiConsumer<HealthCheck.State,HealthCheck> consumer)
Remove the state change listener.
|
void |
setHealthCheckOptions(String id,
Map<String,Object> options)
Sets the options to be used when invoking the check identified by the
given id.
|
default <T extends HealthCheckService> |
unwrap(Class<T> clazz)
Access the underlying concrete HealthCheckService implementation to
provide access to further features.
|
getCamelContext, setCamelContextvoid addStateChangeListener(BiConsumer<HealthCheck.State,HealthCheck> consumer)
consumer - the event listener.void removeStateChangeListener(BiConsumer<HealthCheck.State,HealthCheck> consumer)
consumer - the event listener to remove.void setHealthCheckOptions(String id, Map<String,Object> options)
id - the health check id.options - the health check options.default Optional<HealthCheck.Result> call(String id)
id - the health check id.Optional.empty() if the id is unknown.#call(String, Map)}Optional<HealthCheck.Result> call(String id, Map<String,Object> options)
id with the given
options.id - the health check id.options - the health check options.Optional.empty() if the id is unknown.void notify(HealthCheck check, HealthCheck.Result result)
check - the health check.result - the health check result.Collection<HealthCheck.Result> getResults()
default <T extends HealthCheckService> T unwrap(Class<T> clazz)
clazz - the proprietary class or interface of the underlying concrete HealthCheckService.Apache Camel