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