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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean acceptInboundMessage​(java.lang.Object msg)  
      protected FullHttpMultiPart beginAggregation​(io.netty.handler.codec.http.HttpMessage start, io.netty.buffer.ByteBuf content)  
      protected boolean closeAfterContinueResponse​(java.lang.Object msg)  
      protected void handleOversizedMessage​(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpMessage oversized)  
      protected boolean ignoreContentAfterContinueResponse​(java.lang.Object msg)  
      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 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.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 Detail

      • HttpMultiPartContentAggregator

        public HttpMultiPartContentAggregator​(int maxContentLength)
    • Method Detail

      • acceptInboundMessage

        public boolean acceptInboundMessage​(java.lang.Object msg)
                                     throws java.lang.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:
        java.lang.Exception
      • isStartMessage

        protected boolean isStartMessage​(io.netty.handler.codec.http.HttpObject msg)
                                  throws java.lang.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:
        java.lang.Exception
      • isContentMessage

        protected boolean isContentMessage​(io.netty.handler.codec.http.HttpObject msg)
                                    throws java.lang.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:
        java.lang.Exception
      • isLastContentMessage

        protected boolean isLastContentMessage​(io.netty.handler.codec.http.HttpContent msg)
                                        throws java.lang.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:
        java.lang.Exception
      • isAggregated

        protected boolean isAggregated​(io.netty.handler.codec.http.HttpObject msg)
                                throws java.lang.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:
        java.lang.Exception
      • isContentLengthInvalid

        protected boolean isContentLengthInvalid​(io.netty.handler.codec.http.HttpMessage start,
                                                 int maxContentLength)
                                          throws java.lang.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:
        java.lang.Exception
      • newContinueResponse

        protected java.lang.Object newContinueResponse​(io.netty.handler.codec.http.HttpMessage start,
                                                       int maxContentLength,
                                                       io.netty.channel.ChannelPipeline pipeline)
                                                throws java.lang.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:
        java.lang.Exception
      • closeAfterContinueResponse

        protected boolean closeAfterContinueResponse​(java.lang.Object msg)
                                              throws java.lang.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:
        java.lang.Exception
      • ignoreContentAfterContinueResponse

        protected boolean ignoreContentAfterContinueResponse​(java.lang.Object msg)
                                                      throws java.lang.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:
        java.lang.Exception
      • beginAggregation

        protected FullHttpMultiPart beginAggregation​(io.netty.handler.codec.http.HttpMessage start,
                                                     io.netty.buffer.ByteBuf content)
                                              throws java.lang.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:
        java.lang.Exception
      • handleOversizedMessage

        protected void handleOversizedMessage​(io.netty.channel.ChannelHandlerContext ctx,
                                              io.netty.handler.codec.http.HttpMessage oversized)
                                       throws java.lang.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:
        java.lang.Exception