Interface HttpMiddleware

All Superinterfaces:
Middleware

public interface HttpMiddleware extends Middleware
A specific middleware for manipulating http requests.
Since:
3.4.0-SNAPSHOT
See Also:
  • Method Details

    • handle

      void handle(MiddlewareCallbackInfo callbackInfo, Exchange exchange)
      Defines the logic this middleware applies to the exchange.

      Note: This method will be invoked before performing the actual route logic.

      Parameters:
      callbackInfo - The callback info that is used to store data between middlewares.
      exchange - The exchange holding the http requests data.
    • handle

      default void handle(MiddlewareCallbackInfo callbackInfo, BaseExchange exchange)
      Defines the logic of the middleware.

      This implementation tries to default all calls to handle(MiddlewareCallbackInfo, Exchange).

      Specified by:
      handle in interface Middleware
      Parameters:
      callbackInfo - The callback info that is used to store data between middlewares.
      exchange - The exchange that holds the data of the request.
    • isApplicable

      default boolean isApplicable(Class<? extends Server> server)
      Checks if the middleware is applicable of handling the specific servers exchange.

      This implementation checks if the server is a web server.

      Specified by:
      isApplicable in interface Middleware
      Parameters:
      server - The server to check.
      Returns:
      true if the middleware can handle the server, false otherwise.