Interface HealthChecks
- Author:
- Clement Escoffier
-
Method Summary
Modifier and TypeMethodDescriptionInvokes the registered procedures.checkStatus(String name) Invokes the registered procedure with the given name and sub-procedures.static HealthChecksCreates a new instance of the default implementation ofHealthChecks.invoke(Handler<JsonObject> resultHandler) Invokes the registered procedures and computes the outcome.Invokes the registered procedure with the given name and sub-procedures.Registers a health check procedure.Registers a health check procedure.unregister(String name) Unregisters a procedure.
-
Method Details
-
create
Creates a new instance of the default implementation ofHealthChecks.- Parameters:
vertx- the instance of Vert.x, must not benull- Returns:
- the created instance
-
register
Registers a health check procedure.The procedure is a
Handlertaking aPromiseofStatusas parameter. Procedures are asynchronous, and must complete or fail the givenPromise. If the future object is failed, the procedure outcome is considered as `DOWN`. If the future is completed without any object, the procedure outcome is considered as `UP`. If the future is completed with a (not-null)Status, the procedure outcome is the received status.This method uses a 1s timeout. Use
register(String, long, Handler)to configure the timeout.- Parameters:
name- the name of the procedure, must not benullor emptyprocedure- the procedure, must not benull- Returns:
- the current
HealthChecks
-
register
Registers a health check procedure.The procedure is a
Handlertaking aPromiseofStatusas parameter. Procedures are asynchronous, and must complete or fail the givenPromise. If the future object is failed, the procedure outcome is considered as `DOWN`. If the future is completed without any object, the procedure outcome is considered as `UP`. If the future is completed with a (not-null)Status, the procedure outcome is the received status.- Parameters:
name- the name of the procedure, must not benullor emptytimeout- the procedure timeout in millisecondsprocedure- the procedure, must not benull- Returns:
- the current
HealthChecks
-
unregister
Unregisters a procedure.- Parameters:
name- the name of the procedure- Returns:
- the current
HealthChecks
-
invoke
Invokes the registered procedures and computes the outcome.- Parameters:
resultHandler- the result handler, must not benull. The handler received the computedJsonObject.- Returns:
- the current
HealthChecks
-
invoke
Invokes the registered procedure with the given name and sub-procedures. It computes the overall outcome.- Returns:
- a future notified with a failure if the procedure with the given name cannot be found or invoked.
-
checkStatus
Future<CheckResult> checkStatus()Invokes the registered procedures.- Returns:
- a future notified with the computed
CheckResult.
-
checkStatus
Invokes the registered procedure with the given name and sub-procedures.- Returns:
- a future notified with a failure if the procedure with the given name cannot be found or invoked.
-