Class Filters
- java.lang.Object
-
- io.quarkus.vertx.http.runtime.filters.Filters
-
public class Filters extends Object
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
Nested Classes Modifier and Type Class Description static class
Filters.SimpleFilter
Simple implementation of filter.
-
Constructor Summary
Constructors Constructor Description Filters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Filter>
getFilters()
Filters
register(io.vertx.core.Handler<io.vertx.ext.web.RoutingContext> handler, int priority)
Registers a new filter.
-
-
-
Method Detail
-
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.
-
-