Package org.opennms.core.health.api
Interface HealthCheckService
-
- All Known Implementing Classes:
DefaultHealthCheckService
public interface HealthCheckService
TheHealthCheckService
performs variousHealthCheck
s and returns the result of each check wrapped by theHealth
object.- Author:
- mvrueden
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<Health>
performAsyncHealthCheck(Context context, java.util.function.Consumer<HealthCheck> onStartConsumer, java.util.function.Consumer<Response> onFinishConsumer, java.util.List<java.lang.String> tags)
Performs variousHealthCheck
s asynchronously and returns aCompletableFuture
which contains theHealth
representing eachHealthCheck
sResponse
.
-
-
-
Method Detail
-
performAsyncHealthCheck
java.util.concurrent.CompletableFuture<Health> performAsyncHealthCheck(Context context, java.util.function.Consumer<HealthCheck> onStartConsumer, java.util.function.Consumer<Response> onFinishConsumer, java.util.List<java.lang.String> tags)
Performs variousHealthCheck
s asynchronously and returns aCompletableFuture
which contains theHealth
representing eachHealthCheck
sResponse
. It is up to the implementator to respect timeouts and handle exceptions accordingly, when these situations arise when callingHealthCheck.perform(Context)
. Callback methods can be provided to print information before and after aHealthCheck
is invoked. When providing aonFinishConsumer
please note, that this is invoked even if theHealthCheck.perform(Context)
execution failed or timed out and therefore may not represent the value when callingHealthCheck.perform(Context)
directly.- Parameters:
context
- The context objectonStartConsumer
- Callback method which is invoked before theHealthCheck.perform(Context)
method is invoked. May be null.onFinishConsumer
- Callback method which is invoked after theHealthCheck.perform(Context)
method is invoked. May be null.- Returns:
- The
CompletableFuture
to retrieve theHealth
from.
-
-