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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
protected FullHttpMultiPart
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
-
Constructor Details
-
HttpMultiPartContentAggregator
public HttpMultiPartContentAggregator(int maxContentLength)
-
-
Method Details
-
acceptInboundMessage
- 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:
Exception
-
isStartMessage
- 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:
Exception
-
isContentMessage
- 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:
Exception
-
isLastContentMessage
protected boolean isLastContentMessage(io.netty.handler.codec.http.HttpContent msg) throws 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:
Exception
-
isAggregated
- 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:
Exception
-
isContentLengthInvalid
protected boolean isContentLengthInvalid(io.netty.handler.codec.http.HttpMessage start, int maxContentLength) throws 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:
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 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:
Exception
-
closeAfterContinueResponse
- 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:
Exception
-
ignoreContentAfterContinueResponse
- 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:
Exception
-
beginAggregation
protected FullHttpMultiPart beginAggregation(io.netty.handler.codec.http.HttpMessage start, io.netty.buffer.ByteBuf content) throws 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:
Exception
-
handleOversizedMessage
protected void handleOversizedMessage(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpMessage oversized) throws 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:
Exception
-