Class PassThruSubProtocolHandler

java.lang.Object
org.springframework.integration.websocket.support.PassThruSubProtocolHandler
All Implemented Interfaces:
org.springframework.web.socket.messaging.SubProtocolHandler

public class PassThruSubProtocolHandler
extends java.lang.Object
implements org.springframework.web.socket.messaging.SubProtocolHandler
The simple 'pass thru' SubProtocolHandler, when there is no interests in the WebSocket sub-protocols. This class just convert Message to the WebSocketMessage on 'send' part and vise versa - on 'receive' part.
Since:
4.1
  • Constructor Summary

    Constructors 
    Constructor Description
    PassThruSubProtocolHandler()  
  • Method Summary

    Modifier and Type Method Description
    void afterSessionEnded​(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus closeStatus, org.springframework.messaging.MessageChannel outputChannel)  
    void afterSessionStarted​(org.springframework.web.socket.WebSocketSession session, org.springframework.messaging.MessageChannel outputChannel)  
    java.util.List<java.lang.String> getSupportedProtocols()  
    void handleMessageFromClient​(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.WebSocketMessage<?> webSocketMessage, org.springframework.messaging.MessageChannel outputChannel)  
    void handleMessageToClient​(org.springframework.web.socket.WebSocketSession session, org.springframework.messaging.Message<?> message)  
    java.lang.String resolveSessionId​(org.springframework.messaging.Message<?> message)  
    void setSupportedProtocols​(java.lang.String... supportedProtocols)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setSupportedProtocols

      public void setSupportedProtocols​(java.lang.String... supportedProtocols)
    • getSupportedProtocols

      public java.util.List<java.lang.String> getSupportedProtocols()
      Specified by:
      getSupportedProtocols in interface org.springframework.web.socket.messaging.SubProtocolHandler
    • handleMessageFromClient

      public void handleMessageFromClient​(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.WebSocketMessage<?> webSocketMessage, org.springframework.messaging.MessageChannel outputChannel)
      Specified by:
      handleMessageFromClient in interface org.springframework.web.socket.messaging.SubProtocolHandler
    • handleMessageToClient

      public void handleMessageToClient​(org.springframework.web.socket.WebSocketSession session, org.springframework.messaging.Message<?> message) throws java.lang.Exception
      Specified by:
      handleMessageToClient in interface org.springframework.web.socket.messaging.SubProtocolHandler
      Throws:
      java.lang.Exception
    • resolveSessionId

      public java.lang.String resolveSessionId​(org.springframework.messaging.Message<?> message)
      Specified by:
      resolveSessionId in interface org.springframework.web.socket.messaging.SubProtocolHandler
    • afterSessionStarted

      public void afterSessionStarted​(org.springframework.web.socket.WebSocketSession session, org.springframework.messaging.MessageChannel outputChannel)
      Specified by:
      afterSessionStarted in interface org.springframework.web.socket.messaging.SubProtocolHandler
    • afterSessionEnded

      public void afterSessionEnded​(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus closeStatus, org.springframework.messaging.MessageChannel outputChannel)
      Specified by:
      afterSessionEnded in interface org.springframework.web.socket.messaging.SubProtocolHandler