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
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • Constructor Summary

    Constructors
    Constructor
    Description
    BasicHttpObjectAggregator(int maxContentLength)
    Creates a new instance.
    BasicHttpObjectAggregator(int maxContentLength, boolean closeOnExpectationFailed)
    Creates a new instance.
  • Method Summary

    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 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

    Methods inherited from class io.netty.handler.codec.MessageToMessageDecoder

    channelRead

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 then true means 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:
      newContinueResponse in class io.netty.handler.codec.http.HttpObjectAggregator
    • handleOversizedMessage

      protected void handleOversizedMessage(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpMessage oversized) throws Exception
      Overrides:
      handleOversizedMessage in class io.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:
      beginAggregation in class io.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:
      aggregate in class io.netty.handler.codec.http.HttpObjectAggregator
      Throws:
      Exception