Package org.drasyl.handler.stream
Class ChunkedMessageAggregator
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.MessageToMessageDecoder<I>
io.netty.handler.codec.MessageAggregator<MessageChunk,MessageChunk,MessageChunk,ReassembledMessage>
org.drasyl.handler.stream.ChunkedMessageAggregator
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
public class ChunkedMessageAggregator
extends io.netty.handler.codec.MessageAggregator<MessageChunk,MessageChunk,MessageChunk,ReassembledMessage>
Aggregates
MessageChunk
s to a ReassembledMessage
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ReassembledMessage
beginAggregation
(MessageChunk start, io.netty.buffer.ByteBuf content) protected boolean
protected boolean
protected boolean
isAggregated
(MessageChunk msg) protected boolean
isContentLengthInvalid
(MessageChunk start, int maxContentLength) protected boolean
protected boolean
protected boolean
protected Object
newContinueResponse
(MessageChunk start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline) Methods inherited from class io.netty.handler.codec.MessageAggregator
acceptInboundMessage, aggregate, channelInactive, channelReadComplete, ctx, decode, finishAggregation, handleOversizedMessage, 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
-
ChunkedMessageAggregator
public ChunkedMessageAggregator(int maxContentLength) Creates a new instance.- Parameters:
maxContentLength
- the maximum length of the aggregated message. If the length of the aggregated content exceeds this value,#handleOversizedMessage(ChannelHandlerContext, MessageChunk)
will be called.
-
-
Method Details
-
isStartMessage
- Specified by:
isStartMessage
in classio.netty.handler.codec.MessageAggregator<MessageChunk,
MessageChunk, MessageChunk, ReassembledMessage>
-
isContentMessage
- Specified by:
isContentMessage
in classio.netty.handler.codec.MessageAggregator<MessageChunk,
MessageChunk, MessageChunk, ReassembledMessage>
-
isLastContentMessage
- Specified by:
isLastContentMessage
in classio.netty.handler.codec.MessageAggregator<MessageChunk,
MessageChunk, MessageChunk, ReassembledMessage>
-
isAggregated
- Specified by:
isAggregated
in classio.netty.handler.codec.MessageAggregator<MessageChunk,
MessageChunk, MessageChunk, ReassembledMessage>
-
isContentLengthInvalid
- Specified by:
isContentLengthInvalid
in classio.netty.handler.codec.MessageAggregator<MessageChunk,
MessageChunk, MessageChunk, ReassembledMessage>
-
newContinueResponse
protected Object newContinueResponse(MessageChunk start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline) - Specified by:
newContinueResponse
in classio.netty.handler.codec.MessageAggregator<MessageChunk,
MessageChunk, MessageChunk, ReassembledMessage>
-
closeAfterContinueResponse
- Specified by:
closeAfterContinueResponse
in classio.netty.handler.codec.MessageAggregator<MessageChunk,
MessageChunk, MessageChunk, ReassembledMessage>
-
ignoreContentAfterContinueResponse
- Specified by:
ignoreContentAfterContinueResponse
in classio.netty.handler.codec.MessageAggregator<MessageChunk,
MessageChunk, MessageChunk, ReassembledMessage>
-
beginAggregation
- Specified by:
beginAggregation
in classio.netty.handler.codec.MessageAggregator<MessageChunk,
MessageChunk, MessageChunk, ReassembledMessage>
-