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 fragmentedWebSocketFrame
they 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 WebSocketFrame
beginAggregation(WebSocketFrame start, io.netty.buffer.ByteBuf content)
protected boolean
closeAfterContinueResponse(Object msg)
protected boolean
ignoreContentAfterContinueResponse(Object msg)
protected boolean
isAggregated(WebSocketFrame msg)
protected boolean
isContentLengthInvalid(WebSocketFrame start, int maxContentLength)
protected boolean
isContentMessage(WebSocketFrame msg)
protected boolean
isLastContentMessage(ContinuationWebSocketFrame msg)
protected boolean
isStartMessage(WebSocketFrame msg)
protected Object
newContinueResponse(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, setMaxCumulationBufferComponents
-
-
-
-
Method Detail
-
isStartMessage
protected boolean isStartMessage(WebSocketFrame msg) throws Exception
- Specified by:
isStartMessage
in classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
- Throws:
Exception
-
isContentMessage
protected boolean isContentMessage(WebSocketFrame msg) throws Exception
- Specified by:
isContentMessage
in classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
- Throws:
Exception
-
isLastContentMessage
protected boolean isLastContentMessage(ContinuationWebSocketFrame msg) throws Exception
- Specified by:
isLastContentMessage
in classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
- Throws:
Exception
-
isAggregated
protected boolean isAggregated(WebSocketFrame msg) throws Exception
- Specified by:
isAggregated
in classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
- Throws:
Exception
-
isContentLengthInvalid
protected boolean isContentLengthInvalid(WebSocketFrame start, int maxContentLength)
- Specified by:
isContentLengthInvalid
in classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
newContinueResponse
protected Object newContinueResponse(WebSocketFrame start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline)
- Specified by:
newContinueResponse
in classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
closeAfterContinueResponse
protected boolean closeAfterContinueResponse(Object msg) throws Exception
- Specified by:
closeAfterContinueResponse
in classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
- Throws:
Exception
-
ignoreContentAfterContinueResponse
protected boolean ignoreContentAfterContinueResponse(Object msg) throws Exception
- Specified by:
ignoreContentAfterContinueResponse
in 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:
beginAggregation
in classio.netty.handler.codec.MessageAggregator<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
- Throws:
Exception
-
-