public final class SubProtocolHandlerRegistry extends Object
SubProtocolHandler
s.
For internal use only.
WebSocketInboundChannelAdapter
,
WebSocketOutboundMessageHandler
Constructor and Description |
---|
SubProtocolHandlerRegistry(List<org.springframework.web.socket.messaging.SubProtocolHandler> protocolHandlers) |
SubProtocolHandlerRegistry(List<org.springframework.web.socket.messaging.SubProtocolHandler> protocolHandlers,
org.springframework.web.socket.messaging.SubProtocolHandler defaultProtocolHandler) |
SubProtocolHandlerRegistry(org.springframework.web.socket.messaging.SubProtocolHandler defaultProtocolHandler) |
Modifier and Type | Method and Description |
---|---|
org.springframework.web.socket.messaging.SubProtocolHandler |
findProtocolHandler(org.springframework.web.socket.WebSocketSession session)
Resolves the
SubProtocolHandler for the given session using
its accepted sub-protocol . |
List<String> |
getSubProtocols()
Return the
List of sub-protocols from provided SubProtocolHandler . |
String |
resolveSessionId(org.springframework.messaging.Message<?> message)
Resolves the
sessionId for the given message using
the SubProtocolHandler.resolveSessionId(org.springframework.messaging.Message<?>) algorithm. |
public SubProtocolHandlerRegistry(List<org.springframework.web.socket.messaging.SubProtocolHandler> protocolHandlers)
public SubProtocolHandlerRegistry(org.springframework.web.socket.messaging.SubProtocolHandler defaultProtocolHandler)
public SubProtocolHandlerRegistry(List<org.springframework.web.socket.messaging.SubProtocolHandler> protocolHandlers, org.springframework.web.socket.messaging.SubProtocolHandler defaultProtocolHandler)
public org.springframework.web.socket.messaging.SubProtocolHandler findProtocolHandler(org.springframework.web.socket.WebSocketSession session)
SubProtocolHandler
for the given session
using
its accepted sub-protocol
.session
- The session to resolve the sub-protocol handler forIllegalStateException
- if a protocol handler cannot be resolvedpublic String resolveSessionId(org.springframework.messaging.Message<?> message)
sessionId
for the given message
using
the SubProtocolHandler.resolveSessionId(org.springframework.messaging.Message<?>)
algorithm.message
- The message to resolve the sessionId
from.null
, if no one SubProtocolHandler
can't resolve it against provided message
.