List of usage examples for org.springframework.web.socket.messaging SubProtocolHandler resolveSessionId
@Nullable String resolveSessionId(Message<?> message);
From source file:org.springframework.integration.websocket.support.SubProtocolHandlerRegistry.java
/** * Resolves the {@code sessionId} for the given {@code message} using * the {@link SubProtocolHandler#resolveSessionId} algorithm. * @param message The message to resolve the {@code sessionId} from. * @return The sessionId or {@code null}, if no one {@link SubProtocolHandler} * can't resolve it against provided {@code message}. *///from w w w . j av a 2s .com public String resolveSessionId(Message<?> message) { for (SubProtocolHandler handler : this.protocolHandlers.values()) { String sessionId = handler.resolveSessionId(message); if (sessionId != null) { return sessionId; } } if (this.defaultProtocolHandler != null) { String sessionId = this.defaultProtocolHandler.resolveSessionId(message); if (sessionId != null) { return sessionId; } } return null; }
From source file:org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.java
@Nullable private String resolveSessionId(Message<?> message) { for (SubProtocolHandler handler : this.protocolHandlerLookup.values()) { String sessionId = handler.resolveSessionId(message); if (sessionId != null) { return sessionId; }/*from ww w .j a v a 2 s . co m*/ } if (this.defaultProtocolHandler != null) { String sessionId = this.defaultProtocolHandler.resolveSessionId(message); if (sessionId != null) { return sessionId; } } return null; }