Class WebSocketFrameAggregator
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.MessageToMessageDecoder<I>
io.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
io.netty.handler.codec.http.websocketx.WebSocketFrameAggregator
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
public class WebSocketFrameAggregator
extends io.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
Handler that aggregate fragmented WebSocketFrame's.
Be aware if PING/PONG/CLOSE frames are send in the middle of a fragmented
WebSocketFrame they will
just get forwarded to the next handler in the pipeline.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected WebSocketFramebeginAggregation(WebSocketFrame start, io.netty.buffer.ByteBuf content) protected booleanprotected booleanprotected booleanprotected booleanisContentLengthInvalid(WebSocketFrame start, int maxContentLength) protected booleanprotected booleanprotected booleanprotected ObjectnewContinueResponse(WebSocketFrame 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, setMaxCumulationBufferComponentsMethods inherited from class io.netty.handler.codec.MessageToMessageDecoder
channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Constructor Details
-
WebSocketFrameAggregator
public WebSocketFrameAggregator(int maxContentLength) Creates a new instance- Parameters:
maxContentLength- If the size of the aggregated frame exceeds this value, aTooLongFrameExceptionis thrown.
-
-
Method Details
-
isStartMessage
- Specified by:
isStartMessagein classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame, ContinuationWebSocketFrame, WebSocketFrame> - Throws:
Exception
-
isContentMessage
- Specified by:
isContentMessagein classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame, ContinuationWebSocketFrame, WebSocketFrame> - Throws:
Exception
-
isLastContentMessage
- Specified by:
isLastContentMessagein classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame, ContinuationWebSocketFrame, WebSocketFrame> - Throws:
Exception
-
isAggregated
- Specified by:
isAggregatedin classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame, ContinuationWebSocketFrame, WebSocketFrame> - Throws:
Exception
-
isContentLengthInvalid
- Specified by:
isContentLengthInvalidin classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame, ContinuationWebSocketFrame, WebSocketFrame>
-
newContinueResponse
protected Object newContinueResponse(WebSocketFrame start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline) - Specified by:
newContinueResponsein classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame, ContinuationWebSocketFrame, WebSocketFrame>
-
closeAfterContinueResponse
- Specified by:
closeAfterContinueResponsein classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame, ContinuationWebSocketFrame, WebSocketFrame> - Throws:
Exception
-
ignoreContentAfterContinueResponse
- Specified by:
ignoreContentAfterContinueResponsein classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame, ContinuationWebSocketFrame, WebSocketFrame> - Throws:
Exception
-
beginAggregation
protected WebSocketFrame beginAggregation(WebSocketFrame start, io.netty.buffer.ByteBuf content) throws Exception - Specified by:
beginAggregationin classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame, ContinuationWebSocketFrame, WebSocketFrame> - Throws:
Exception
-