Package io.vertx.mutiny.ext.healthchecks
Class HealthCheckHandler
java.lang.Object
io.vertx.mutiny.ext.healthchecks.HealthCheckHandler
- All Implemented Interfaces:
MutinyDelegate
,io.vertx.core.Handler<RoutingContext>
,Consumer<RoutingContext>
public class HealthCheckHandler
extends Object
implements MutinyDelegate, io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>
A Vert.x Web handler on which you register health check procedure. It computes the outcome status (`UP` or `DOWN`)
. When the handler process a HTTP request, it computes the global outcome and build a HTTP response as follows:
- 204 - status is `UP` but no procedures installed (no payload)
- 200 - status is `UP`, the payload contains the result of the installed procedures
- 503 - status is `DOWN`, the payload contains the result of the installed procedures
- 500 - status is `DOWN`, the payload contains the result of the installed procedures, one of the procedure has failed
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHealthCheckHandler
(io.vertx.ext.healthchecks.HealthCheckHandler delegate) HealthCheckHandler
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(RoutingContext item) static HealthCheckHandler
static HealthCheckHandler
create
(Vertx vertx, AuthenticationProvider provider) static HealthCheckHandler
static HealthCheckHandler
createWithHealthChecks
(HealthChecks hc, AuthenticationProvider provider) boolean
io.vertx.ext.healthchecks.HealthCheckHandler
void
handle
(RoutingContext arg0) int
hashCode()
static HealthCheckHandler
newInstance
(io.vertx.ext.healthchecks.HealthCheckHandler arg) register
(String name, long timeout, io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.Status> procedure) resultMapper
(Function<io.vertx.ext.healthchecks.CheckResult, io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.CheckResult>> resultMapper) toString()
unregister
(String name)
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
HealthCheckHandler
public HealthCheckHandler(io.vertx.ext.healthchecks.HealthCheckHandler delegate) -
HealthCheckHandler
-
-
Method Details
-
getDelegate
public io.vertx.ext.healthchecks.HealthCheckHandler getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
handle
- Specified by:
handle
in interfaceio.vertx.core.Handler<RoutingContext>
-
create
- Parameters:
vertx
- the Vert.x instance, must not benull
provider
- the Authentication provider used to authenticate the HTTP request- Returns:
- the created instance
-
create
- Parameters:
vertx
- the Vert.x instance, must not benull
- Returns:
- the created instance
-
createWithHealthChecks
public static HealthCheckHandler createWithHealthChecks(HealthChecks hc, AuthenticationProvider provider) - Parameters:
hc
- the health checks object to use, must not benull
provider
-- Returns:
- the created instance
-
createWithHealthChecks
- Parameters:
hc
- the health checks object to use- Returns:
- the created instance
-
register
public HealthCheckHandler register(String name, io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.Status> procedure) - Parameters:
name
- the name of the procedure, must not benull
or emptyprocedure
- the procedure, must not benull
- Returns:
-
register
public HealthCheckHandler register(String name, long timeout, io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.Status> procedure) - Parameters:
name
- the name of the procedure, must not benull
or emptytimeout
- the procedure timeoutprocedure
- the procedure, must not benull
- Returns:
-
unregister
- Parameters:
name
- the name of the procedure- Returns:
- the current
HealthCheckHandler
-
resultMapper
public HealthCheckHandler resultMapper(Function<io.vertx.ext.healthchecks.CheckResult, io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.CheckResult>> resultMapper) - Parameters:
resultMapper
- the used to manipulate theCheckResult
,null
means no result mapper function enabled.- Returns:
- the current
HealthCheckHandler
-
accept
- Specified by:
accept
in interfaceConsumer<RoutingContext>
-
newInstance
-