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
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
HealthCheckService.ProgressListener
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description io.vavr.control.Either<String,CompletionStage<Health>>
performAsyncHealthCheck(Context context, HealthCheckService.ProgressListener listener, List<String> tags)
Performs variousHealthCheck
s asynchronously and returns aCompletableFuture
which contains theHealth
representing eachHealthCheck
sResponse
.
-
-
-
Method Detail
-
performAsyncHealthCheck
io.vavr.control.Either<String,CompletionStage<Health>> performAsyncHealthCheck(Context context, HealthCheckService.ProgressListener listener, List<String> tags)
Performs variousHealthCheck
s asynchronously and returns aCompletableFuture
which contains theHealth
representing eachHealthCheck
sResponse
. It is up to the implementation 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 objectlistener
- gets informed about health check progress. May be null. In case theEither
contains an error no listener callbacks are called at all. If theEither
contains a all listener callbacks are guaranteed to be called before that completion stage completes.tags
- selects the single health checks that are included in the overall check; every health check that has any of the given tags is included.- Returns:
- Either an error message if no matching health checks could be determined or a
CompletableFuture
to retrieve theHealth
from.
-
-