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
public class BasicHttpObjectAggregator
extends io.netty.handler.codec.http.HttpObjectAggregator
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
ConstructorsConstructorDescriptionBasicHttpObjectAggregator(int maxContentLength) Creates a new instance.BasicHttpObjectAggregator(int maxContentLength, boolean closeOnExpectationFailed) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaggregate(io.netty.handler.codec.http.FullHttpMessage aggregated, io.netty.handler.codec.http.HttpContent content) protected io.netty.handler.codec.http.FullHttpMessagebeginAggregation(io.netty.handler.codec.http.HttpMessage start, io.netty.buffer.ByteBuf content) protected voidhandleOversizedMessage(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpMessage oversized) protected ObjectnewContinueResponse(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, isStartMessageMethods inherited from class io.netty.handler.codec.MessageAggregator
acceptInboundMessage, channelInactive, channelReadComplete, ctx, decode, handlerAdded, handlerRemoved, isHandlingOversizedMessage, maxContentLength, maxCumulationBufferComponents, setMaxCumulationBufferComponentsMethods inherited from class io.netty.handler.codec.MessageToMessageDecoder
channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Constructor Details
-
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 thentruemeans close the connection. otherwise the connection will remain open and data will be
-
-
Method Details
-
newContinueResponse
protected Object newContinueResponse(io.netty.handler.codec.http.HttpMessage start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline) - Overrides:
newContinueResponsein classio.netty.handler.codec.http.HttpObjectAggregator
-
handleOversizedMessage
protected void handleOversizedMessage(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpMessage oversized) throws Exception - Overrides:
handleOversizedMessagein classio.netty.handler.codec.http.HttpObjectAggregator- Throws:
Exception
-
beginAggregation
protected io.netty.handler.codec.http.FullHttpMessage beginAggregation(io.netty.handler.codec.http.HttpMessage start, io.netty.buffer.ByteBuf content) throws Exception - Overrides:
beginAggregationin classio.netty.handler.codec.http.HttpObjectAggregator- Throws:
Exception
-
aggregate
protected void aggregate(io.netty.handler.codec.http.FullHttpMessage aggregated, io.netty.handler.codec.http.HttpContent content) throws Exception - Overrides:
aggregatein classio.netty.handler.codec.http.HttpObjectAggregator- Throws:
Exception
-