Class StandardWebSocketSession

java.lang.Object
org.springframework.web.socket.adapter.AbstractWebSocketSession<Session>
org.springframework.web.socket.adapter.standard.StandardWebSocketSession
All Implemented Interfaces:
Closeable, AutoCloseable, NativeWebSocketSession, WebSocketSession

public class StandardWebSocketSession extends AbstractWebSocketSession<Session>
A WebSocketSession for use with the standard WebSocket for Java API.
Since:
4.0
Author:
Rossen Stoyanchev
  • Constructor Details

    • StandardWebSocketSession

      public StandardWebSocketSession(@Nullable org.springframework.http.HttpHeaders headers, @Nullable Map<String,Object> attributes, @Nullable InetSocketAddress localAddress, @Nullable InetSocketAddress remoteAddress)
      Constructor for a standard WebSocket session.
      Parameters:
      headers - the headers of the handshake request
      attributes - the attributes from the HTTP handshake to associate with the WebSocket session; the provided attributes are copied, the original map is not used.
      localAddress - the address on which the request was received
      remoteAddress - the address of the remote client
    • StandardWebSocketSession

      public StandardWebSocketSession(@Nullable org.springframework.http.HttpHeaders headers, @Nullable Map<String,Object> attributes, @Nullable InetSocketAddress localAddress, @Nullable InetSocketAddress remoteAddress, @Nullable Principal user)
      Constructor that associates a user with the WebSocket session.
      Parameters:
      headers - the headers of the handshake request
      attributes - the attributes from the HTTP handshake to associate with the WebSocket session
      localAddress - the address on which the request was received
      remoteAddress - the address of the remote client
      user - the user associated with the session; if null we'll fall back on the user available in the underlying WebSocket session
  • Method Details