public final class SubProtocolHandlerRegistry
extends java.lang.Object
SubProtocolHandler
s.
For internal use only.
WebSocketInboundChannelAdapter
,
WebSocketOutboundMessageHandler
Constructor and Description |
---|
SubProtocolHandlerRegistry(java.util.List<org.springframework.web.socket.messaging.SubProtocolHandler> protocolHandlers) |
SubProtocolHandlerRegistry(java.util.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 . |
java.util.List<java.lang.String> |
getSubProtocols()
Return the
List of sub-protocols from provided SubProtocolHandler . |
java.lang.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(java.util.List<org.springframework.web.socket.messaging.SubProtocolHandler> protocolHandlers)
public SubProtocolHandlerRegistry(org.springframework.web.socket.messaging.SubProtocolHandler defaultProtocolHandler)
public SubProtocolHandlerRegistry(java.util.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 forjava.lang.IllegalStateException
- if a protocol handler cannot be resolvedpublic java.lang.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
.public java.util.List<java.lang.String> getSubProtocols()
List
of sub-protocols from provided SubProtocolHandler
.List
of supported sub-protocols.