public interface HealthCheckHandler extends Handler<RoutingContext>
Modifier and Type | Method and Description |
---|---|
static HealthCheckHandler |
create(Vertx vertx)
Creates an instance of the default implementation of the
HealthCheckHandler . |
static HealthCheckHandler |
create(Vertx vertx,
AuthenticationProvider provider)
Creates an instance of the default implementation of the
HealthCheckHandler . |
static HealthCheckHandler |
createWithHealthChecks(HealthChecks hc)
Creates an instance of the default implementation of the
HealthCheckHandler . |
static HealthCheckHandler |
createWithHealthChecks(HealthChecks hc,
AuthenticationProvider provider)
Creates an instance of the default implementation of the
HealthCheckHandler . |
HealthCheckHandler |
register(String name,
Handler<Promise<Status>> procedure)
Registers a health check procedure.
|
HealthCheckHandler |
register(String name,
long timeout,
Handler<Promise<Status>> procedure)
Registers a health check procedure.
|
HealthCheckHandler |
resultMapper(java.util.function.Function<CheckResult,Future<CheckResult>> resultMapper)
Sets a function which will be invoked before the
CheckResult gets written to clients. |
HealthCheckHandler |
unregister(String name)
Unregisters a procedure.
|
static HealthCheckHandler create(Vertx vertx, AuthenticationProvider provider)
HealthCheckHandler
.
This function creates a new instance of HealthChecks
.vertx
- the Vert.x instance, must not be null
provider
- the Authentication provider used to authenticate the HTTP requeststatic HealthCheckHandler create(Vertx vertx)
HealthCheckHandler
.
This function creates a new instance of HealthChecks
.vertx
- the Vert.x instance, must not be null
static HealthCheckHandler createWithHealthChecks(HealthChecks hc, AuthenticationProvider provider)
HealthCheckHandler
.hc
- the health checks object to use, must not be null
static HealthCheckHandler createWithHealthChecks(HealthChecks hc)
HealthCheckHandler
.hc
- the health checks object to useHealthCheckHandler register(String name, Handler<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. To configure the timeout use register(String, long, Handler)
.
name
- the name of the procedure, must not be null
or emptyprocedure
- the procedure, must not be null
HealthCheckHandler
HealthCheckHandler register(String name, long timeout, Handler<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 timeoutprocedure
- the procedure, must not be null
HealthCheckHandler
HealthCheckHandler unregister(String name)
name
- the name of the procedureHealthCheckHandler
HealthCheckHandler resultMapper(java.util.function.Function<CheckResult,Future<CheckResult>> resultMapper)
CheckResult
gets written to clients.resultMapper
- the Function
used to manipulate the CheckResult
, null
means no result mapper function enabled.HealthCheckHandler
Copyright © 2024 Eclipse. All rights reserved.