Package com.networknt.handler
Interface Interceptor
-
- All Superinterfaces:
io.undertow.server.HttpHandler,LightHttpHandler,MiddlewareHandler
- All Known Subinterfaces:
RequestInterceptor,ResponseInterceptor
public interface Interceptor extends MiddlewareHandler
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONTENT_TYPE_MISMATCHstatic charJSON_ARRAY_OBJECT_STARTING_CHARstatic charJSON_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 Default Methods Modifier and Type Method Description default Optional<String>findMatchingPrefix(String url, List<String> prefixes)default booleanisFormData(String contentType)Checks to see if the request is multipart/form-data or x-www-form-urlencoded.default booleanisJsonData(String contentType)Checks to see if the request is application/json.default booleanisXmlData(String contentType)Checks to see if the request is text/xml, text/plain, or application/xml.default booleanparseJsonArrayObject(io.undertow.server.HttpServerExchange ex, io.undertow.util.AttachmentKey<Object> key, String str)default booleanparseJsonMapObject(io.undertow.server.HttpServerExchange ex, io.undertow.util.AttachmentKey<Object> key, String str)default booleanshouldAttachBody(io.undertow.util.HeaderMap headers)Check to see if the current request/response is compatible to have body data extracted.-
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
-
CONTENT_TYPE_MISMATCH
static final String CONTENT_TYPE_MISMATCH
- See Also:
- Constant Field Values
-
JSON_MAP_OBJECT_STARTING_CHAR
static final char JSON_MAP_OBJECT_STARTING_CHAR
- See Also:
- Constant Field Values
-
JSON_ARRAY_OBJECT_STARTING_CHAR
static final char JSON_ARRAY_OBJECT_STARTING_CHAR
- See Also:
- Constant Field Values
-
-
Method Detail
-
isXmlData
default boolean isXmlData(String contentType)
Checks to see if the request is text/xml, text/plain, or application/xml.- Parameters:
contentType- - Content-Type header from exchange- Returns:
- - true/false
-
isFormData
default boolean isFormData(String contentType)
Checks to see if the request is multipart/form-data or x-www-form-urlencoded.- Parameters:
contentType- - Content-Type header from exchange- Returns:
- - true/false
-
isJsonData
default boolean isJsonData(String contentType)
Checks to see if the request is application/json.- Parameters:
contentType- - Content-Type header from exchange.- Returns:
- - true/false
-
shouldAttachBody
default boolean shouldAttachBody(io.undertow.util.HeaderMap headers)
Check to see if the current request/response is compatible to have body data extracted.- Parameters:
headers- - http headers (request/response headers)- Returns:
- - return true if we should run the body parser.
-
parseJsonMapObject
default boolean parseJsonMapObject(io.undertow.server.HttpServerExchange ex, io.undertow.util.AttachmentKey<Object> key, String str)
-
parseJsonArrayObject
default boolean parseJsonArrayObject(io.undertow.server.HttpServerExchange ex, io.undertow.util.AttachmentKey<Object> key, String str)
-
-