public interface HealthChecks
| Modifier and Type | Method and Description |
|---|---|
io.vertx.core.Future<CheckResult> |
checkStatus()
Like
checkStatus(Handler) but returns a Future of the asynchronous result |
void |
checkStatus(io.vertx.core.Handler<io.vertx.core.AsyncResult<CheckResult>> resultHandler)
Invokes the registered procedures.
|
io.vertx.core.Future<CheckResult> |
checkStatus(String name)
Like
checkStatus(String, Handler) but returns a Future of the asynchronous result |
void |
checkStatus(String name,
io.vertx.core.Handler<io.vertx.core.AsyncResult<CheckResult>> resultHandler)
Invokes the registered procedure with the given name and sub-procedures.
|
static HealthChecks |
create(io.vertx.core.Vertx vertx)
Creates a new instance of the default implementation of
HealthChecks. |
HealthChecks |
invoke(io.vertx.core.Handler<io.vertx.core.json.JsonObject> resultHandler)
Invokes the registered procedures and computes the outcome.
|
io.vertx.core.Future<io.vertx.core.json.JsonObject> |
invoke(String name)
Like
invoke(String, Handler) but with a future of the result. |
HealthChecks |
invoke(String name,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.json.JsonObject>> resultHandler)
Invokes the registered procedure with the given name and sub-procedures.
|
HealthChecks |
register(String name,
io.vertx.core.Handler<io.vertx.core.Promise<Status>> procedure)
Registers a health check procedure.
|
HealthChecks |
register(String name,
long timeout,
io.vertx.core.Handler<io.vertx.core.Promise<Status>> procedure)
Registers a health check procedure.
|
HealthChecks |
unregister(String name)
Unregisters a procedure.
|
static HealthChecks create(io.vertx.core.Vertx vertx)
HealthChecks.vertx - the instance of Vert.x, must not be nullHealthChecks register(String name, io.vertx.core.Handler<io.vertx.core.Promise<Status>> procedure)
The procedure is a Handler taking a Promise of Status as parameter.
Procedures are asynchronous, and must complete or fail the given Promise.
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.
name - the name of the procedure, must not be null or emptyprocedure - the procedure, must not be nullHealthChecksHealthChecks register(String name, long timeout, io.vertx.core.Handler<io.vertx.core.Promise<Status>> procedure)
The procedure is a Handler taking a Promise of Status as parameter.
Procedures are asynchronous, and must complete or fail the given Promise.
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.
name - the name of the procedure, must not be null or emptytimeout - the procedure timeout in millisecondsprocedure - the procedure, must not be nullHealthChecksHealthChecks unregister(String name)
name - the name of the procedureHealthChecksHealthChecks invoke(io.vertx.core.Handler<io.vertx.core.json.JsonObject> resultHandler)
resultHandler - the result handler, must not be null. The handler received the computed
JsonObject.HealthChecksHealthChecks invoke(String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.json.JsonObject>> resultHandler)
resultHandler - the result handler, must not be null. The handler received an
AsyncResult marked as failed if the procedure with the given name cannot
be found or invoked.HealthChecksio.vertx.core.Future<io.vertx.core.json.JsonObject> invoke(String name)
invoke(String, Handler) but with a future of the result.void checkStatus(io.vertx.core.Handler<io.vertx.core.AsyncResult<CheckResult>> resultHandler)
resultHandler - the result handler, must not be null. The handler received the computed
CheckResult.io.vertx.core.Future<CheckResult> checkStatus()
checkStatus(Handler) but returns a Future of the asynchronous resultvoid checkStatus(String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<CheckResult>> resultHandler)
resultHandler - the result handler, must not be null. The handler received an
AsyncResult marked as failed if the procedure with the given name cannot
be found or invoked.io.vertx.core.Future<CheckResult> checkStatus(String name)
checkStatus(String, Handler) but returns a Future of the asynchronous resultCopyright © 2021 Eclipse. All rights reserved.