Class SubProtocolHandlerRegistry
java.lang.Object
org.springframework.integration.websocket.support.SubProtocolHandlerRegistry
The utility class to encapsulate search algorithms for a set of provided
SubProtocolHandlers.
For internal use only.
- Since:
- 4.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSubProtocolHandlerRegistry(List<org.springframework.web.socket.messaging.SubProtocolHandler> protocolHandlers) SubProtocolHandlerRegistry(List<org.springframework.web.socket.messaging.SubProtocolHandler> protocolHandlers, org.springframework.web.socket.messaging.SubProtocolHandler defaultProtocolHandler) SubProtocolHandlerRegistry(org.springframework.web.socket.messaging.SubProtocolHandler defaultProtocolHandler) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.socket.messaging.SubProtocolHandlerfindProtocolHandler(org.springframework.web.socket.WebSocketSession session) Resolves theSubProtocolHandlerfor the givensessionusing itsaccepted sub-protocol.Return theListof sub-protocols from providedSubProtocolHandler.resolveSessionId(org.springframework.messaging.Message<?> message) Resolves thesessionIdfor the givenmessageusing theSubProtocolHandler.resolveSessionId(org.springframework.messaging.Message<?>)algorithm.
-
Constructor Details
-
SubProtocolHandlerRegistry
public SubProtocolHandlerRegistry(List<org.springframework.web.socket.messaging.SubProtocolHandler> protocolHandlers) -
SubProtocolHandlerRegistry
public SubProtocolHandlerRegistry(org.springframework.web.socket.messaging.SubProtocolHandler defaultProtocolHandler) -
SubProtocolHandlerRegistry
public SubProtocolHandlerRegistry(List<org.springframework.web.socket.messaging.SubProtocolHandler> protocolHandlers, org.springframework.web.socket.messaging.SubProtocolHandler defaultProtocolHandler)
-
-
Method Details
-
findProtocolHandler
public org.springframework.web.socket.messaging.SubProtocolHandler findProtocolHandler(org.springframework.web.socket.WebSocketSession session) Resolves theSubProtocolHandlerfor the givensessionusing itsaccepted sub-protocol.- 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 thesessionIdfor the givenmessageusing theSubProtocolHandler.resolveSessionId(org.springframework.messaging.Message<?>)algorithm.- Parameters:
message- The message to resolve thesessionIdfrom.- Returns:
- The sessionId or
null, if no oneSubProtocolHandlercan't resolve it against providedmessage.
-
getSubProtocols
Return theListof sub-protocols from providedSubProtocolHandler.- Returns:
- The the
Listof supported sub-protocols.
-