Package com.networknt.encode
Class ResponseEncodeHandler
java.lang.Object
com.networknt.encode.ResponseEncodeHandler
- All Implemented Interfaces:
com.networknt.handler.LightHttpHandler,com.networknt.handler.MiddlewareHandler,io.undertow.server.HttpHandler
public class ResponseEncodeHandler
extends Object
implements com.networknt.handler.MiddlewareHandler
This is a middleware handler that you can wire in to the response chain to gzip large content
body in order to speed up the delivery and reduce the bandwidth usage.
- Author:
- Steve Hu
-
Field Summary
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 -
Method Summary
Modifier and TypeMethodDescriptionio.undertow.server.HttpHandlergetNext()voidhandleRequest(io.undertow.server.HttpServerExchange exchange) booleancom.networknt.handler.MiddlewareHandlersetNext(io.undertow.server.HttpHandler next) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.networknt.handler.LightHttpHandler
setExchangeStatus, setExchangeStatus, setExchangeStatusMethods inherited from interface com.networknt.handler.MiddlewareHandler
addHandlerMDCContext
-
Constructor Details
-
ResponseEncodeHandler
public ResponseEncodeHandler() -
ResponseEncodeHandler
-
-
Method Details
-
getNext
public io.undertow.server.HttpHandler getNext()- Specified by:
getNextin interfacecom.networknt.handler.MiddlewareHandler
-
setNext
public com.networknt.handler.MiddlewareHandler setNext(io.undertow.server.HttpHandler next) - Specified by:
setNextin interfacecom.networknt.handler.MiddlewareHandler
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfacecom.networknt.handler.MiddlewareHandler
-
handleRequest
- Specified by:
handleRequestin interfaceio.undertow.server.HttpHandler- Throws:
Exception
-