public final class SubProtocolHandlerRegistry extends Object
SubProtocolHandler
s.
For internal use only.
WebSocketInboundChannelAdapter
,
WebSocketOutboundMessageHandler
Constructor and Description |
---|
SubProtocolHandlerRegistry(List<SubProtocolHandler> protocolHandlers) |
SubProtocolHandlerRegistry(List<SubProtocolHandler> protocolHandlers,
SubProtocolHandler defaultProtocolHandler) |
SubProtocolHandlerRegistry(SubProtocolHandler defaultProtocolHandler) |
Modifier and Type | Method and Description |
---|---|
SubProtocolHandler |
findProtocolHandler(WebSocketSession session)
|
List<String> |
getSubProtocols()
Return the
List of sub-protocols from provided SubProtocolHandler . |
String |
resolveSessionId(Message<?> message)
Resolves the
sessionId for the given message using
the SubProtocolHandler.resolveSessionId(org.springframework.messaging.Message<?>) algorithm. |
public SubProtocolHandlerRegistry(List<SubProtocolHandler> protocolHandlers)
public SubProtocolHandlerRegistry(SubProtocolHandler defaultProtocolHandler)
public SubProtocolHandlerRegistry(List<SubProtocolHandler> protocolHandlers, SubProtocolHandler defaultProtocolHandler)
public SubProtocolHandler findProtocolHandler(WebSocketSession session)
session
- The session to resolve the sub-protocol handler forIllegalStateException
- if a protocol handler cannot be resolvedpublic String resolveSessionId(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
.public List<String> getSubProtocols()
List
of sub-protocols from provided SubProtocolHandler
.List
of supported sub-protocols.