Module io.netty5.codec.http
Class WebSocketFrameAggregator
- java.lang.Object
-
- io.netty5.channel.ChannelHandlerAdapter
-
- io.netty5.handler.codec.MessageToMessageDecoder<I>
-
- io.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
- io.netty5.handler.codec.http.websocketx.WebSocketFrameAggregator
-
- All Implemented Interfaces:
io.netty5.channel.ChannelHandler
public class WebSocketFrameAggregator extends io.netty5.handler.codec.MessageAggregatorNew<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 void
aggregate(io.netty5.buffer.api.BufferAllocator allocator, WebSocketFrame aggregated, ContinuationWebSocketFrame content)
protected WebSocketFrame
beginAggregation(io.netty5.buffer.api.BufferAllocator allocator, WebSocketFrame start)
protected boolean
closeAfterContinueResponse(Object msg)
protected boolean
ignoreContentAfterContinueResponse(Object msg)
protected boolean
isAggregated(Object msg)
protected boolean
isContentLengthInvalid(WebSocketFrame start, int maxContentLength)
protected boolean
isLastContentMessage(ContinuationWebSocketFrame msg)
protected int
lengthForAggregation(WebSocketFrame msg)
protected int
lengthForContent(ContinuationWebSocketFrame msg)
protected Object
newContinueResponse(WebSocketFrame start, int maxContentLength, io.netty5.channel.ChannelPipeline pipeline)
protected ContinuationWebSocketFrame
tryContentMessage(Object msg)
protected WebSocketFrame
tryStartMessage(Object msg)
-
Methods inherited from class io.netty5.handler.codec.MessageAggregatorNew
acceptInboundMessage, channelInactive, channelReadComplete, ctx, decode, finishAggregation, handleOversizedMessage, handlerAdded, handlerRemoved, maxContentLength
-
-
-
-
Method Detail
-
tryStartMessage
protected WebSocketFrame tryStartMessage(Object msg)
- Specified by:
tryStartMessage
in classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
tryContentMessage
protected ContinuationWebSocketFrame tryContentMessage(Object msg)
- Specified by:
tryContentMessage
in classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
isLastContentMessage
protected boolean isLastContentMessage(ContinuationWebSocketFrame msg)
- Specified by:
isLastContentMessage
in classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
isAggregated
protected boolean isAggregated(Object msg) throws Exception
- Specified by:
isAggregated
in classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
- Throws:
Exception
-
isContentLengthInvalid
protected boolean isContentLengthInvalid(WebSocketFrame start, int maxContentLength)
- Specified by:
isContentLengthInvalid
in classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
newContinueResponse
protected Object newContinueResponse(WebSocketFrame start, int maxContentLength, io.netty5.channel.ChannelPipeline pipeline)
- Specified by:
newContinueResponse
in classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
closeAfterContinueResponse
protected boolean closeAfterContinueResponse(Object msg) throws Exception
- Specified by:
closeAfterContinueResponse
in classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
- Throws:
Exception
-
ignoreContentAfterContinueResponse
protected boolean ignoreContentAfterContinueResponse(Object msg) throws Exception
- Specified by:
ignoreContentAfterContinueResponse
in classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
- Throws:
Exception
-
lengthForContent
protected int lengthForContent(ContinuationWebSocketFrame msg)
- Specified by:
lengthForContent
in classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
lengthForAggregation
protected int lengthForAggregation(WebSocketFrame msg)
- Specified by:
lengthForAggregation
in classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
beginAggregation
protected WebSocketFrame beginAggregation(io.netty5.buffer.api.BufferAllocator allocator, WebSocketFrame start)
- Specified by:
beginAggregation
in classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
aggregate
protected void aggregate(io.netty5.buffer.api.BufferAllocator allocator, WebSocketFrame aggregated, ContinuationWebSocketFrame content) throws Exception
- Specified by:
aggregate
in classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
- Throws:
Exception
-
-