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 
SubProtocolHandlers.
 For internal use only.
- Since:
- 4.1
- Author:
- Andy Wilkinson, Artem Bilan
- See Also:
- WebSocketInboundChannelAdapter,- WebSocketOutboundMessageHandler
- 
Constructor SummaryConstructors Constructor Description SubProtocolHandlerRegistry(List<SubProtocolHandler> protocolHandlers)SubProtocolHandlerRegistry(List<SubProtocolHandler> protocolHandlers, SubProtocolHandler defaultProtocolHandler)SubProtocolHandlerRegistry(SubProtocolHandler defaultProtocolHandler)
- 
Method SummaryModifier and Type Method Description SubProtocolHandlerfindProtocolHandler(WebSocketSession session)List<String>getSubProtocols()Return theListof sub-protocols from providedSubProtocolHandler.StringresolveSessionId(Message<?> message)Resolves thesessionIdfor the givenmessageusing theSubProtocolHandler.resolveSessionId(org.springframework.messaging.Message<?>)algorithm.
- 
Constructor Details- 
SubProtocolHandlerRegistry
- 
SubProtocolHandlerRegistry
- 
SubProtocolHandlerRegistrypublic 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
 
- 
resolveSessionIdResolves thesessionIdfor the givenmessageusing theSubProtocolHandler.resolveSessionId(org.springframework.messaging.Message<?>)algorithm.- Parameters:
- message- The message to resolve the- sessionIdfrom.
- Returns:
- The sessionId or null, if no oneSubProtocolHandlercan't resolve it against providedmessage.
 
- 
getSubProtocolsReturn theListof sub-protocols from providedSubProtocolHandler.- Returns:
- The the Listof supported sub-protocols.
 
 
-