Class BasicHttpObjectAggregator
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.codec.MessageToMessageDecoder<I>
-
- io.netty.handler.codec.MessageAggregator<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpContent,io.netty.handler.codec.http.FullHttpMessage>
-
- io.netty.handler.codec.http.HttpObjectAggregator
-
- com.linkedin.alpini.netty4.handlers.BasicHttpObjectAggregator
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
- Direct Known Subclasses:
BasicHttpNonMultiPartAggregator
public class BasicHttpObjectAggregator extends io.netty.handler.codec.http.HttpObjectAggregator
-
-
Constructor Summary
Constructors Constructor Description BasicHttpObjectAggregator(int maxContentLength)
Creates a new instance.BasicHttpObjectAggregator(int maxContentLength, boolean closeOnExpectationFailed)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
aggregate(io.netty.handler.codec.http.FullHttpMessage aggregated, io.netty.handler.codec.http.HttpContent content)
protected io.netty.handler.codec.http.FullHttpMessage
beginAggregation(io.netty.handler.codec.http.HttpMessage start, io.netty.buffer.ByteBuf content)
protected void
handleOversizedMessage(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpMessage oversized)
protected java.lang.Object
newContinueResponse(io.netty.handler.codec.http.HttpMessage start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline)
-
Methods inherited from class io.netty.handler.codec.http.HttpObjectAggregator
closeAfterContinueResponse, finishAggregation, ignoreContentAfterContinueResponse, isAggregated, isContentLengthInvalid, isContentMessage, isLastContentMessage, isStartMessage
-
Methods inherited from class io.netty.handler.codec.MessageAggregator
acceptInboundMessage, channelInactive, channelReadComplete, ctx, decode, handlerAdded, handlerRemoved, isHandlingOversizedMessage, maxContentLength, maxCumulationBufferComponents, setMaxCumulationBufferComponents
-
-
-
-
Constructor Detail
-
BasicHttpObjectAggregator
public BasicHttpObjectAggregator(int maxContentLength)
Creates a new instance.- Parameters:
maxContentLength
- the maximum length of the aggregated content in bytes. If the length of the aggregated content exceeds this value,handleOversizedMessage(io.netty.channel.ChannelHandlerContext, HttpMessage)
will be called.
-
BasicHttpObjectAggregator
public BasicHttpObjectAggregator(int maxContentLength, boolean closeOnExpectationFailed)
Creates a new instance.- Parameters:
maxContentLength
- the maximum length of the aggregated content in bytes. If the length of the aggregated content exceeds this value,handleOversizedMessage(io.netty.channel.ChannelHandlerContext, HttpMessage)
will be called.closeOnExpectationFailed
- If a 100-continue response is detected but the content length is too large thentrue
means close the connection. otherwise the connection will remain open and data will be
-
-
Method Detail
-
newContinueResponse
protected java.lang.Object newContinueResponse(io.netty.handler.codec.http.HttpMessage start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline)
- Overrides:
newContinueResponse
in classio.netty.handler.codec.http.HttpObjectAggregator
-
handleOversizedMessage
protected void handleOversizedMessage(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpMessage oversized) throws java.lang.Exception
- Overrides:
handleOversizedMessage
in classio.netty.handler.codec.http.HttpObjectAggregator
- Throws:
java.lang.Exception
-
beginAggregation
protected io.netty.handler.codec.http.FullHttpMessage beginAggregation(io.netty.handler.codec.http.HttpMessage start, io.netty.buffer.ByteBuf content) throws java.lang.Exception
- Overrides:
beginAggregation
in classio.netty.handler.codec.http.HttpObjectAggregator
- Throws:
java.lang.Exception
-
aggregate
protected void aggregate(io.netty.handler.codec.http.FullHttpMessage aggregated, io.netty.handler.codec.http.HttpContent content) throws java.lang.Exception
- Overrides:
aggregate
in classio.netty.handler.codec.http.HttpObjectAggregator
- Throws:
java.lang.Exception
-
-