public class PassThruSubProtocolHandler extends Object implements SubProtocolHandler
SubProtocolHandler
, when there is no interests in the
WebSocket sub-protocols.
This class just convert Message
to the WebSocketMessage
on 'send' part and vise versa - on 'receive' part.Constructor and Description |
---|
PassThruSubProtocolHandler() |
Modifier and Type | Method and Description |
---|---|
void |
afterSessionEnded(WebSocketSession session,
CloseStatus closeStatus,
MessageChannel outputChannel) |
void |
afterSessionStarted(WebSocketSession session,
MessageChannel outputChannel) |
List<String> |
getSupportedProtocols() |
void |
handleMessageFromClient(WebSocketSession session,
WebSocketMessage<?> webSocketMessage,
MessageChannel outputChannel) |
void |
handleMessageToClient(WebSocketSession session,
Message<?> message) |
String |
resolveSessionId(Message<?> message) |
void |
setSupportedProtocols(String... supportedProtocols) |
public void setSupportedProtocols(String... supportedProtocols)
public List<String> getSupportedProtocols()
getSupportedProtocols
in interface SubProtocolHandler
public void handleMessageFromClient(WebSocketSession session, WebSocketMessage<?> webSocketMessage, MessageChannel outputChannel)
handleMessageFromClient
in interface SubProtocolHandler
public void handleMessageToClient(WebSocketSession session, Message<?> message) throws Exception
handleMessageToClient
in interface SubProtocolHandler
Exception
public String resolveSessionId(Message<?> message)
resolveSessionId
in interface SubProtocolHandler
public void afterSessionStarted(WebSocketSession session, MessageChannel outputChannel)
afterSessionStarted
in interface SubProtocolHandler
public void afterSessionEnded(WebSocketSession session, CloseStatus closeStatus, MessageChannel outputChannel)
afterSessionEnded
in interface SubProtocolHandler