Class HttpResponseEncoder
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
io.netty.handler.codec.MessageToMessageEncoder<Object>
io.netty.handler.codec.http.HttpObjectEncoder<HttpResponse>
io.netty.handler.codec.http.HttpResponseEncoder
- All Implemented Interfaces:
ChannelHandler, ChannelOutboundHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.Sharable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptOutboundMessage(Object msg) Returnstrueif the given message should be handled.protected voidencodeInitialLine(ByteBuf buf, HttpResponse response) protected booleanDetermine whether a message has a content or not.protected voidsanitizeHeadersBeforeEncode(HttpResponse msg, boolean isAlwaysEmpty) Allows to sanitize headers of the message before encoding these.Methods inherited from class HttpObjectEncoder
encode, encodeAscii, encodeHeaders, writeMethods inherited from class ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ChannelHandler
exceptionCaught, handlerAdded, handlerRemoved
-
Constructor Details
-
HttpResponseEncoder
public HttpResponseEncoder()
-
-
Method Details
-
acceptOutboundMessage
Description copied from class:MessageToMessageEncoderReturnstrueif the given message should be handled. Iffalseit will be passed to the nextChannelOutboundHandlerin theChannelPipeline.- Overrides:
acceptOutboundMessagein classHttpObjectEncoder<HttpResponse>- Throws:
Exception
-
encodeInitialLine
- Specified by:
encodeInitialLinein classHttpObjectEncoder<HttpResponse>- Throws:
Exception
-
sanitizeHeadersBeforeEncode
Description copied from class:HttpObjectEncoderAllows to sanitize headers of the message before encoding these.- Overrides:
sanitizeHeadersBeforeEncodein classHttpObjectEncoder<HttpResponse>
-
isContentAlwaysEmpty
Description copied from class:HttpObjectEncoderDetermine whether a message has a content or not. Some message may have headers indicating a content without having an actual content, e.g the response to an HEAD or CONNECT request.- Overrides:
isContentAlwaysEmptyin classHttpObjectEncoder<HttpResponse>- Parameters:
msg- the message to test- Returns:
trueto signal the message has no content
-