Class SubProtocolHandlerRegistry
java.lang.Object
org.springframework.integration.websocket.support.SubProtocolHandlerRegistry
public final class SubProtocolHandlerRegistry extends Object
The utility class to encapsulate search algorithms for a set of provided
SubProtocolHandler
s.
For internal use only.
- Since:
- 4.1
- Author:
- Andy Wilkinson, Artem Bilan
- See Also:
WebSocketInboundChannelAdapter
,WebSocketOutboundMessageHandler
-
Constructor Summary
Constructors Constructor Description SubProtocolHandlerRegistry(List<SubProtocolHandler> protocolHandlers)
SubProtocolHandlerRegistry(List<SubProtocolHandler> protocolHandlers, SubProtocolHandler defaultProtocolHandler)
SubProtocolHandlerRegistry(SubProtocolHandler defaultProtocolHandler)
-
Method Summary
Modifier and Type Method Description SubProtocolHandler
findProtocolHandler(WebSocketSession session)
List<String>
getSubProtocols()
Return theList
of sub-protocols from providedSubProtocolHandler
.String
resolveSessionId(Message<?> message)
Resolves thesessionId
for the givenmessage
using theSubProtocolHandler.resolveSessionId(org.springframework.messaging.Message<?>)
algorithm.
-
Constructor Details
-
SubProtocolHandlerRegistry
-
SubProtocolHandlerRegistry
-
SubProtocolHandlerRegistry
public SubProtocolHandlerRegistry(List<SubProtocolHandler> protocolHandlers, SubProtocolHandler defaultProtocolHandler)
-
-
Method Details
-
findProtocolHandler
- Parameters:
session
- The session to resolve the sub-protocol handler for- Returns:
- The sub-protocol handler
- Throws:
IllegalStateException
- if a protocol handler cannot be resolved
-
resolveSessionId
Resolves thesessionId
for the givenmessage
using theSubProtocolHandler.resolveSessionId(org.springframework.messaging.Message<?>)
algorithm.- Parameters:
message
- The message to resolve thesessionId
from.- Returns:
- The sessionId or
null
, if no oneSubProtocolHandler
can't resolve it against providedmessage
.
-
getSubProtocols
Return theList
of sub-protocols from providedSubProtocolHandler
.- Returns:
- The the
List
of supported sub-protocols.
-