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 fragmentedWebSocketFramethey will just get forwarded to the next handler in the pipeline.
-
-
Constructor Summary
Constructors Constructor Description WebSocketFrameAggregator(int maxContentLength)Creates a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected WebSocketFramebeginAggregation(WebSocketFrame start, io.netty.buffer.ByteBuf content)protected booleancloseAfterContinueResponse(Object msg)protected booleanignoreContentAfterContinueResponse(Object msg)protected booleanisAggregated(WebSocketFrame msg)protected booleanisContentLengthInvalid(WebSocketFrame start, int maxContentLength)protected booleanisContentMessage(WebSocketFrame msg)protected booleanisLastContentMessage(ContinuationWebSocketFrame msg)protected booleanisStartMessage(WebSocketFrame msg)protected 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, releaseCurrentMessage, setMaxCumulationBufferComponents
-
-
-
-
Method Detail
-
isStartMessage
protected boolean isStartMessage(WebSocketFrame msg) throws Exception
- Specified by:
isStartMessagein classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>- Throws:
Exception
-
isContentMessage
protected boolean isContentMessage(WebSocketFrame msg) throws Exception
- Specified by:
isContentMessagein classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>- Throws:
Exception
-
isLastContentMessage
protected boolean isLastContentMessage(ContinuationWebSocketFrame msg) throws Exception
- Specified by:
isLastContentMessagein classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>- Throws:
Exception
-
isAggregated
protected boolean isAggregated(WebSocketFrame msg) throws Exception
- Specified by:
isAggregatedin classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>- Throws:
Exception
-
isContentLengthInvalid
protected boolean isContentLengthInvalid(WebSocketFrame start, int maxContentLength)
- 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
protected boolean closeAfterContinueResponse(Object msg) throws Exception
- Specified by:
closeAfterContinueResponsein classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>- Throws:
Exception
-
ignoreContentAfterContinueResponse
protected boolean ignoreContentAfterContinueResponse(Object msg) throws Exception
- 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
-
-