Interface Filter

All Known Implementing Classes:
Filters.SimpleFilter

public interface Filter
Represents a Filter, i.e. a route called on every HTTP request or failure (depending on isFailureHandler()). The priority attribute allows sorting the filters. Highest priority are called first.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.vertx.core.Handler<io.vertx.ext.web.RoutingContext>
    The handler called on HTTP request or failure.
    int
     
    default boolean
    Whether to add getHandler() as HTTP request handler (via Route.handler(Handler)) or as failure handler (via Route.failureHandler(Handler)).
  • Method Details

    • getHandler

      io.vertx.core.Handler<io.vertx.ext.web.RoutingContext> getHandler()
      The handler called on HTTP request or failure. It's important that the handler call RoutingContext.next() to invoke the next filter or the user routes.
      Returns:
      the handler
    • getPriority

      int getPriority()
      Returns:
      the priority of the filter.
    • isFailureHandler

      default boolean isFailureHandler()
      Whether to add getHandler() as HTTP request handler (via Route.handler(Handler)) or as failure handler (via Route.failureHandler(Handler)).
      Returns:
      true if filter should be applied on failures rather than HTTP requests