Class NettyWebSocketSessionSupport<T>
- java.lang.Object
- org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession<T>
- org.springframework.web.reactive.socket.adapter.NettyWebSocketSessionSupport<T>
- Type Parameters:
T- the native delegate type
- All Implemented Interfaces:
WebSocketSession
- Direct Known Subclasses:
ReactorNettyWebSocketSession
public abstract class NettyWebSocketSessionSupport<T> extends AbstractWebSocketSession<T>
Base class for Netty-basedWebSocketSessionadapters that provides convenience methods to convert NettyWebSocketFramesto and fromWebSocketMessages.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_FRAME_MAX_SIZEThe default max size for inbound WebSocket frames.Fields inherited from class org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession
logger
Constructor Summary
Constructors Modifier Constructor Description protectedNettyWebSocketSessionSupport(T delegate, HandshakeInfo info, NettyDataBufferFactory factory)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NettyDataBufferFactorybufferFactory()Return aDataBufferFactory to create message payloads.protected io.netty.handler.codec.http.websocketx.WebSocketFrametoFrame(WebSocketMessage message)protected WebSocketMessagetoMessage(io.netty.handler.codec.http.websocketx.WebSocketFrame frame)Methods inherited from class org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession
binaryMessage, getAttributes, getDelegate, getHandshakeInfo, getId, getLogPrefix, pingMessage, pongMessage, receive, send, textMessage, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.reactive.socket.WebSocketSession
close, close
Field Detail
DEFAULT_FRAME_MAX_SIZE
public static final int DEFAULT_FRAME_MAX_SIZE
The default max size for inbound WebSocket frames.- See Also:
- Constant Field Values
Constructor Detail
NettyWebSocketSessionSupport
protected NettyWebSocketSessionSupport(T delegate, HandshakeInfo info, NettyDataBufferFactory factory)
Method Detail
bufferFactory
public NettyDataBufferFactory bufferFactory()
Description copied from interface:WebSocketSessionReturn aDataBufferFactory to create message payloads.- Specified by:
bufferFactoryin interfaceWebSocketSession- Overrides:
bufferFactoryin classAbstractWebSocketSession<T>- Returns:
- the buffer factory for the session
toMessage
protected WebSocketMessage toMessage(io.netty.handler.codec.http.websocketx.WebSocketFrame frame)
toFrame
protected io.netty.handler.codec.http.websocketx.WebSocketFrame toFrame(WebSocketMessage message)