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 TypeMethodDescriptionvoidaccept(RoutingContext item) static HealthCheckHandlerstatic HealthCheckHandlercreate(Vertx vertx, AuthenticationProvider provider) static HealthCheckHandlerstatic HealthCheckHandlercreateWithHealthChecks(HealthChecks hc, AuthenticationProvider provider) booleanio.vertx.ext.healthchecks.HealthCheckHandlervoidhandle(RoutingContext arg0) inthashCode()static HealthCheckHandlernewInstance(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:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
handle
- Specified by:
handlein interfaceio.vertx.core.Handler<RoutingContext>
-
create
- Parameters:
vertx- the Vert.x instance, must not benullprovider- 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 benullprovider-- 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 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
- 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
- Specified by:
acceptin interfaceConsumer<RoutingContext>
-
newInstance
-