Package com.networknt.handler
Interface ResponseInterceptor
-
- All Superinterfaces:
io.undertow.server.HttpHandler,Interceptor,LightHttpHandler,MiddlewareHandler
public interface ResponseInterceptor extends Interceptor
This handler is special middleware handler, and it is used to inject response interceptors in the request/response chain to modify/transform the response before calling the next middleware handler.
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUDIT_INFOstatic StringMETHODstatic StringPATCHstatic StringPATH_PARAMETERSstatic StringPOSTstatic StringPUTstatic StringQUERY_PARAMETERSstatic StringREMOVEstatic StringREQUEST_BODYstatic StringREQUEST_HEADERSstatic StringREQUEST_PATHstatic StringREQUEST_URIstatic StringREQUEST_URLstatic StringRESPONSE_BODYstatic StringRESPONSE_HEADERSstatic StringRESPONSE_TRANSFORMstatic StringSTARTUP_HOOK_NOT_LOADEDstatic StringSTATUS_CODEstatic StringUPDATE-
Fields inherited from interface com.networknt.handler.Interceptor
CONTENT_TYPE_MISMATCH, JSON_ARRAY_OBJECT_STARTING_CHAR, JSON_MAP_OBJECT_STARTING_CHAR
-
Fields inherited from interface com.networknt.handler.LightHttpHandler
AUDIT_CONFIG_NAME, AUDIT_ON_ERROR, AUDIT_STACK_TRACE, auditConfig, auditOnError, auditStackTrace, config, CONFIG_NAME, ERROR_NOT_DEFINED, logger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default io.undertow.connector.PooledByteBuffer[]getBuffer(io.undertow.server.HttpServerExchange exchange)A default interface method to get the buffer from the exchange attachment for response body.default booleanisAsync()Indicate if the interceptor handler will be executed in synchronous or asynchronous.booleanisRequiredContent()This is an indicator to load modifiable sink conduit to allow the response body to be updated.-
Methods inherited from interface com.networknt.handler.Interceptor
isFormData, isJsonData, isXmlData, parseJsonArrayObject, parseJsonMapObject, shouldAttachBody
-
Methods inherited from interface com.networknt.handler.LightHttpHandler
setExchangeStatus, setExchangeStatus, setExchangeStatus
-
Methods inherited from interface com.networknt.handler.MiddlewareHandler
addHandlerMDCContext, getNext, isEnabled, register, reload, setNext
-
-
-
-
Field Detail
-
RESPONSE_HEADERS
static final String RESPONSE_HEADERS
- See Also:
- Constant Field Values
-
REQUEST_HEADERS
static final String REQUEST_HEADERS
- See Also:
- Constant Field Values
-
RESPONSE_BODY
static final String RESPONSE_BODY
- See Also:
- Constant Field Values
-
REMOVE
static final String REMOVE
- See Also:
- Constant Field Values
-
UPDATE
static final String UPDATE
- See Also:
- Constant Field Values
-
QUERY_PARAMETERS
static final String QUERY_PARAMETERS
- See Also:
- Constant Field Values
-
PATH_PARAMETERS
static final String PATH_PARAMETERS
- See Also:
- Constant Field Values
-
METHOD
static final String METHOD
- See Also:
- Constant Field Values
-
REQUEST_URL
static final String REQUEST_URL
- See Also:
- Constant Field Values
-
REQUEST_URI
static final String REQUEST_URI
- See Also:
- Constant Field Values
-
REQUEST_PATH
static final String REQUEST_PATH
- See Also:
- Constant Field Values
-
POST
static final String POST
- See Also:
- Constant Field Values
-
PUT
static final String PUT
- See Also:
- Constant Field Values
-
PATCH
static final String PATCH
- See Also:
- Constant Field Values
-
REQUEST_BODY
static final String REQUEST_BODY
- See Also:
- Constant Field Values
-
AUDIT_INFO
static final String AUDIT_INFO
- See Also:
- Constant Field Values
-
STATUS_CODE
static final String STATUS_CODE
- See Also:
- Constant Field Values
-
STARTUP_HOOK_NOT_LOADED
static final String STARTUP_HOOK_NOT_LOADED
- See Also:
- Constant Field Values
-
RESPONSE_TRANSFORM
static final String RESPONSE_TRANSFORM
- See Also:
- Constant Field Values
-
-
Method Detail
-
isRequiredContent
boolean isRequiredContent()
This is an indicator to load modifiable sink conduit to allow the response body to be updated. It is true if the interceptor wants to update the response body.- Returns:
- boolean indicator
-
isAsync
default boolean isAsync()
Indicate if the interceptor handler will be executed in synchronous or asynchronous. By default, it is executed asynchronously.- Returns:
- boolean indicator
-
getBuffer
default io.undertow.connector.PooledByteBuffer[] getBuffer(io.undertow.server.HttpServerExchange exchange)
A default interface method to get the buffer from the exchange attachment for response body.- Parameters:
exchange- HttpServerExchange- Returns:
- PooledByteBuffer[] array
-
-