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
original
non 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 void
accept(RoutingContext item)
static HealthCheckHandler
create(Vertx vertx)
static HealthCheckHandler
create(Vertx vertx, AuthenticationProvider provider)
static HealthCheckHandler
createWithHealthChecks(HealthChecks hc)
static HealthCheckHandler
createWithHealthChecks(HealthChecks hc, AuthenticationProvider provider)
boolean
equals(Object o)
io.vertx.ext.healthchecks.HealthCheckHandler
getDelegate()
void
handle(RoutingContext arg0)
int
hashCode()
static HealthCheckHandler
newInstance(io.vertx.ext.healthchecks.HealthCheckHandler arg)
HealthCheckHandler
register(String name, long timeout, io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.Status> procedure)
HealthCheckHandler
register(String name, io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.Status> procedure)
String
toString()
HealthCheckHandler
unregister(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:
handle
in interfaceio.vertx.core.Handler<RoutingContext>
-
create
public static HealthCheckHandler create(Vertx vertx, AuthenticationProvider provider)
- Parameters:
vertx
- the Vert.x instance, must not benull
provider
- 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 benull
provider
-- 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 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
public HealthCheckHandler unregister(String name)
- Parameters:
name
- the name of the procedure- Returns:
- the current
HealthCheckHandler
-
accept
public void accept(RoutingContext item)
- Specified by:
accept
in interfaceConsumer<RoutingContext>
-
newInstance
public static HealthCheckHandler newInstance(io.vertx.ext.healthchecks.HealthCheckHandler arg)
-
-