Package com.networknt.handler
Class RequestInterceptorInjectionHandler
- java.lang.Object
-
- com.networknt.handler.RequestInterceptorInjectionHandler
-
- All Implemented Interfaces:
LightHttpHandler,MiddlewareHandler,io.undertow.server.HttpHandler
public class RequestInterceptorInjectionHandler extends Object implements MiddlewareHandler
This is the middleware used in the request/response chain to inject the implementations of RequestInterceptorHandler interface to modify the request metadata and body. You can have multiple interceptors per application; however, we do provide a generic implementation in request-transform module to transform the request based on the rule engine rules.- Author:
- Kalev Gonvick
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_BUFFERS-
Fields inherited from interface com.networknt.handler.LightHttpHandler
AUDIT_CONFIG_NAME, AUDIT_ON_ERROR, AUDIT_STACK_TRACE, auditConfig, auditOnError, auditStackTrace, CONFIG_NAME, ERROR_NOT_DEFINED, logger
-
-
Constructor Summary
Constructors Constructor Description RequestInterceptorInjectionHandler()RequestInterceptorInjectionHandler(RequestInjectionConfig cfg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.undertow.server.HttpHandlergetNext()Get the next handler in the chainvoidhandleRequest(io.undertow.server.HttpServerExchange httpServerExchange)booleanisEnabled()Indicate if this handler is enabled or not.voidregister()Register this handler to the handler registration.voidreload()Reload config values in case the config values changed by config server.MiddlewareHandlersetNext(io.undertow.server.HttpHandler next)Set the next handler in the chain-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.networknt.handler.LightHttpHandler
setExchangeStatus, setExchangeStatus, setExchangeStatus
-
-
-
-
Field Detail
-
MAX_BUFFERS
public static final int MAX_BUFFERS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RequestInterceptorInjectionHandler
public RequestInterceptorInjectionHandler()
-
RequestInterceptorInjectionHandler
public RequestInterceptorInjectionHandler(RequestInjectionConfig cfg)
-
-
Method Detail
-
getNext
public io.undertow.server.HttpHandler getNext()
Description copied from interface:MiddlewareHandlerGet the next handler in the chain- Specified by:
getNextin interfaceMiddlewareHandler- Returns:
- HttpHandler
-
setNext
public MiddlewareHandler setNext(io.undertow.server.HttpHandler next)
Description copied from interface:MiddlewareHandlerSet the next handler in the chain- Specified by:
setNextin interfaceMiddlewareHandler- Parameters:
next- HttpHandler- Returns:
- MiddlewareHandler
-
isEnabled
public boolean isEnabled()
Description copied from interface:MiddlewareHandlerIndicate if this handler is enabled or not.- Specified by:
isEnabledin interfaceMiddlewareHandler- Returns:
- boolean true if enabled
-
reload
public void reload()
Description copied from interface:MiddlewareHandlerReload config values in case the config values changed by config server.- Specified by:
reloadin interfaceMiddlewareHandler
-
register
public void register()
Description copied from interface:MiddlewareHandlerRegister this handler to the handler registration.- Specified by:
registerin interfaceMiddlewareHandler
-
-