Class BasicHttpContentEncoder
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.ChannelDuplexHandler
-
- io.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpObject>
-
- com.linkedin.alpini.netty4.handlers.BasicHttpContentEncoder
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
public abstract class BasicHttpContentEncoder extends io.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpObject>A replacement for the Netty HttpContentEncoder which can handle use in client and server pipelines. Created by acurtis on 6/26/17.
-
-
Constructor Summary
Constructors Constructor Description BasicHttpContentEncoder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanacceptOutboundMessage(java.lang.Object msg)protected abstract io.netty.handler.codec.http.HttpContentEncoder.ResultbeginEncode(io.netty.handler.codec.http.HttpMessage headers, java.lang.String acceptEncoding)Prepare to encode the HTTP message content.voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx)protected voiddecode(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpObject msg, java.util.List<java.lang.Object> out)protected voiddecodeTime(long nanos)protected voidencode(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpObject msg, java.util.List<java.lang.Object> out)protected voidencodeTime(long nanos)voidhandlerRemoved(io.netty.channel.ChannelHandlerContext ctx)protected java.lang.CharSequencerequestEncoding(io.netty.handler.codec.http.HttpRequest request)protected java.lang.CharSequencerequestEncoding0(io.netty.handler.codec.http.HttpRequest request)-
Methods inherited from class io.netty.handler.codec.MessageToMessageCodec
acceptInboundMessage, channelRead, write
-
Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharable
-
-
-
-
Method Detail
-
acceptOutboundMessage
public boolean acceptOutboundMessage(java.lang.Object msg) throws java.lang.Exception- Overrides:
acceptOutboundMessagein classio.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpObject>- Throws:
java.lang.Exception
-
requestEncoding
protected java.lang.CharSequence requestEncoding(io.netty.handler.codec.http.HttpRequest request)
-
requestEncoding0
protected java.lang.CharSequence requestEncoding0(io.netty.handler.codec.http.HttpRequest request)
-
encodeTime
protected void encodeTime(long nanos)
-
decodeTime
protected void decodeTime(long nanos)
-
decode
protected void decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpObject msg, java.util.List<java.lang.Object> out) throws java.lang.Exception- Specified by:
decodein classio.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpObject>- Throws:
java.lang.Exception
-
encode
protected void encode(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpObject msg, java.util.List<java.lang.Object> out) throws java.lang.Exception- Specified by:
encodein classio.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpObject>- Throws:
java.lang.Exception
-
beginEncode
protected abstract io.netty.handler.codec.http.HttpContentEncoder.Result beginEncode(io.netty.handler.codec.http.HttpMessage headers, java.lang.String acceptEncoding) throws java.lang.ExceptionPrepare to encode the HTTP message content.- Parameters:
headers- the headersacceptEncoding- the value of the"Accept-Encoding"header- Returns:
- the result of preparation, which is composed of the determined
target content encoding and a new
EmbeddedChannelthat encodes the content into the target content encoding.nullifacceptEncodingis unsupported or rejected and thus the content should be handled as-is (i.e. no encoding). - Throws:
java.lang.Exception
-
handlerRemoved
public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception- Specified by:
handlerRemovedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerRemovedin classio.netty.channel.ChannelHandlerAdapter- Throws:
java.lang.Exception
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception- Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
-