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.
-
-
Constructor Summary
Constructors Constructor Description HttpMultiPartContentAggregator(int maxContentLength)
-
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
-
-
-
-
Method Detail
-
acceptInboundMessage
public boolean acceptInboundMessage(java.lang.Object msg) throws java.lang.Exception
- Overrides:
acceptInboundMessage
in classio.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 classio.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 classio.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 classio.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 classio.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 classio.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 classio.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 classio.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 classio.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 classio.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 classio.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
-
-