Class HttpMultiPartContentAggregator

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,FullHttpMultiPart>
com.linkedin.alpini.netty4.handlers.HttpMultiPartContentAggregator
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

public class HttpMultiPartContentAggregator extends io.netty.handler.codec.MessageAggregator<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpContent,FullHttpMultiPart>
This _only_ knows how to aggregate HttpMultiPart messages and "bad things"(tm) will occur when it encounters other types of messages. Created by acurtis on 3/22/17.
  • Nested Class Summary

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

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

    Constructors
    Constructor
    Description
    HttpMultiPartContentAggregator(int maxContentLength)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    beginAggregation(io.netty.handler.codec.http.HttpMessage start, io.netty.buffer.ByteBuf content)
     
    protected boolean
     
    protected void
    handleOversizedMessage(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpMessage oversized)
     
    protected boolean
     
    protected boolean
    isAggregated(io.netty.handler.codec.http.HttpObject msg)
     
    protected boolean
    isContentLengthInvalid(io.netty.handler.codec.http.HttpMessage start, int maxContentLength)
     
    protected boolean
    isContentMessage(io.netty.handler.codec.http.HttpObject msg)
     
    protected boolean
    isLastContentMessage(io.netty.handler.codec.http.HttpContent msg)
     
    protected boolean
    isStartMessage(io.netty.handler.codec.http.HttpObject msg)
     
    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.MessageAggregator

    aggregate, channelInactive, channelReadComplete, ctx, decode, finishAggregation, 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

    • HttpMultiPartContentAggregator

      public HttpMultiPartContentAggregator(int maxContentLength)
  • Method Details

    • acceptInboundMessage

      public boolean acceptInboundMessage(Object msg) throws Exception
      Overrides:
      acceptInboundMessage in class io.netty.handler.codec.MessageAggregator<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpContent,FullHttpMultiPart>
      Throws:
      Exception
    • isStartMessage

      protected boolean isStartMessage(io.netty.handler.codec.http.HttpObject msg) throws Exception
      Specified by:
      isStartMessage in class io.netty.handler.codec.MessageAggregator<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpContent,FullHttpMultiPart>
      Throws:
      Exception
    • isContentMessage

      protected boolean isContentMessage(io.netty.handler.codec.http.HttpObject msg) throws Exception
      Specified by:
      isContentMessage in class io.netty.handler.codec.MessageAggregator<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpContent,FullHttpMultiPart>
      Throws:
      Exception
    • isLastContentMessage

      protected boolean isLastContentMessage(io.netty.handler.codec.http.HttpContent msg) throws Exception
      Specified by:
      isLastContentMessage in class io.netty.handler.codec.MessageAggregator<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpContent,FullHttpMultiPart>
      Throws:
      Exception
    • isAggregated

      protected boolean isAggregated(io.netty.handler.codec.http.HttpObject msg) throws Exception
      Specified by:
      isAggregated in class io.netty.handler.codec.MessageAggregator<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpContent,FullHttpMultiPart>
      Throws:
      Exception
    • isContentLengthInvalid

      protected boolean isContentLengthInvalid(io.netty.handler.codec.http.HttpMessage start, int maxContentLength) throws Exception
      Specified by:
      isContentLengthInvalid in class io.netty.handler.codec.MessageAggregator<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpContent,FullHttpMultiPart>
      Throws:
      Exception
    • newContinueResponse

      protected Object newContinueResponse(io.netty.handler.codec.http.HttpMessage start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline) throws Exception
      Specified by:
      newContinueResponse in class io.netty.handler.codec.MessageAggregator<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpContent,FullHttpMultiPart>
      Throws:
      Exception
    • closeAfterContinueResponse

      protected boolean closeAfterContinueResponse(Object msg) throws Exception
      Specified by:
      closeAfterContinueResponse in class io.netty.handler.codec.MessageAggregator<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpContent,FullHttpMultiPart>
      Throws:
      Exception
    • ignoreContentAfterContinueResponse

      protected boolean ignoreContentAfterContinueResponse(Object msg) throws Exception
      Specified by:
      ignoreContentAfterContinueResponse in class io.netty.handler.codec.MessageAggregator<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpContent,FullHttpMultiPart>
      Throws:
      Exception
    • beginAggregation

      protected FullHttpMultiPart beginAggregation(io.netty.handler.codec.http.HttpMessage start, io.netty.buffer.ByteBuf content) throws Exception
      Specified by:
      beginAggregation in class io.netty.handler.codec.MessageAggregator<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpContent,FullHttpMultiPart>
      Throws:
      Exception
    • 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.MessageAggregator<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpMessage,io.netty.handler.codec.http.HttpContent,FullHttpMultiPart>
      Throws:
      Exception