Package io.vertx.mutiny.ext.healthchecks
Class HealthCheckHandler
- java.lang.Object
-
- io.vertx.mutiny.ext.healthchecks.HealthCheckHandler
-
- All Implemented Interfaces:
io.vertx.core.Handler<RoutingContext>,Consumer<RoutingContext>
public class HealthCheckHandler extends Object implements 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
originalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<HealthCheckHandler>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description HealthCheckHandler(io.vertx.ext.healthchecks.HealthCheckHandler delegate)HealthCheckHandler(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(RoutingContext item)static HealthCheckHandlercreate(Vertx vertx)static HealthCheckHandlercreate(Vertx vertx, AuthenticationProvider provider)static HealthCheckHandlercreateWithHealthChecks(HealthChecks hc)static HealthCheckHandlercreateWithHealthChecks(HealthChecks hc, AuthenticationProvider provider)booleanequals(Object o)io.vertx.ext.healthchecks.HealthCheckHandlergetDelegate()voidhandle(RoutingContext arg0)inthashCode()static HealthCheckHandlernewInstance(io.vertx.ext.healthchecks.HealthCheckHandler arg)HealthCheckHandlerregister(String name, long timeout, io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.Status> procedure)HealthCheckHandlerregister(String name, io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.Status> procedure)HealthCheckHandlerresultMapper(Function<io.vertx.ext.healthchecks.CheckResult,io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.CheckResult>> resultMapper)StringtoString()HealthCheckHandlerunregister(String name)
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<HealthCheckHandler> __TYPE_ARG
-
-
Constructor Detail
-
HealthCheckHandler
public HealthCheckHandler(io.vertx.ext.healthchecks.HealthCheckHandler delegate)
-
HealthCheckHandler
public HealthCheckHandler(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.healthchecks.HealthCheckHandler getDelegate()
-
handle
public void handle(RoutingContext arg0)
- Specified by:
handlein interfaceio.vertx.core.Handler<RoutingContext>
-
create
public static HealthCheckHandler create(Vertx vertx, AuthenticationProvider provider)
- Parameters:
vertx- the Vert.x instance, must not benullprovider- the Authentication provider used to authenticate the HTTP request- Returns:
- the created instance
-
create
public static HealthCheckHandler create(Vertx vertx)
- 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 benullprovider-- Returns:
- the created instance
-
createWithHealthChecks
public static HealthCheckHandler createWithHealthChecks(HealthChecks hc)
- 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 benullor 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 benullor emptytimeout- the procedure timeoutprocedure- the procedure, must not benull- Returns:
-
unregister
public HealthCheckHandler unregister(String name)
- 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,nullmeans no result mapper function enabled.- Returns:
- the current
HealthCheckHandler
-
accept
public void accept(RoutingContext item)
- Specified by:
acceptin interfaceConsumer<RoutingContext>
-
newInstance
public static HealthCheckHandler newInstance(io.vertx.ext.healthchecks.HealthCheckHandler arg)
-
-