Class Filters
java.lang.Object
io.quarkus.vertx.http.runtime.filters.Filters
Object allowing the register filters, i.e. handler called on every HTTP request.
This object is intended to be used as follows:
public void init(@Observes Filters filters) {
filters.register(rc -> {
// Do something before the next filter or route
rc.next();
// Do something after
}, 10);
}
The handler is the filter code. It must call RoutingContext.next()
to invoke the next filter or route.
The priority is used to sort the filters. Highest priorities are called first.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Simple implementation of filter. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionregister
(io.vertx.core.Handler<io.vertx.ext.web.RoutingContext> handler, int priority) Registers a new filter.
-
Constructor Details
-
Filters
public Filters()
-
-
Method Details
-
register
public Filters register(io.vertx.core.Handler<io.vertx.ext.web.RoutingContext> handler, int priority) Registers a new filter.- Parameters:
handler
- the filter function, must not benull
priority
- the priority, must not be negative- Returns:
- this object to chain registration.
-
getFilters
- Returns:
- the list of currently registered filters.
-