Interface HttpMiddleware
- All Superinterfaces:
Middleware
A specific
middleware for manipulating http
requests.- Since:
- 3.4.0-SNAPSHOT
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidhandle(MiddlewareCallbackInfo callbackInfo, BaseExchange exchange) Defines the logic of the middleware.voidhandle(MiddlewareCallbackInfo callbackInfo, Exchange exchange) Defines the logic this middleware applies to theexchange.default booleanisApplicable(Class<? extends Server> server) Checks if themiddlewareis applicable of handling the specificserversexchange.Methods inherited from interface de.craftsblock.craftsnet.api.middlewares.Middleware
isApplicable
-
Method Details
-
handle
Defines the logic this middleware applies to theexchange.Note: This method will be invoked before performing the actual route logic.
- Parameters:
callbackInfo- Thecallback infothat is used to store data between middlewares.exchange- The exchange holding the http requests data.
-
handle
Defines the logic of the middleware.This implementation tries to default all calls to
handle(MiddlewareCallbackInfo, Exchange).- Specified by:
handlein interfaceMiddleware- Parameters:
callbackInfo- Thecallback infothat is used to store data between middlewares.exchange- Theexchangethat holds the data of the request.
-
isApplicable
Checks if themiddlewareis applicable of handling the specificserversexchange.This implementation checks if the server is a
web server.- Specified by:
isApplicablein interfaceMiddleware- Parameters:
server- Theserverto check.- Returns:
trueif the middleware can handle the server,falseotherwise.
-