org.springframework.web.socket.adapter

## Interface NativeWebSocketSession

- All Superinterfaces:
    WebSocketSession
  All Known Implementing Classes:
    AbstractWebSocketSession, JettyWebSocketSession, StandardWebSocketSession, WebSocketServerSockJsSession

      public interface NativeWebSocketSession
      extends WebSocketSession

  A `WebSocketSession` that exposes the underlying, native WebSocketSession through a getter.
  Since:
    4.0
  Author:
    Rossen Stoyanchev

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getNativeSession()` Return the underlying native WebSocketSession, if available.
    `<T> T` | `getNativeSession(Class<T> requiredType)` Return the underlying native WebSocketSession, if available.

    - ### Methods inherited from interface org.springframework.web.socket.WebSocketSession

      `close, close, getAcceptedProtocol, getAttributes, getBinaryMessageSizeLimit, getExtensions, getHandshakeHeaders, getId, getLocalAddress, getPrincipal, getRemoteAddress, getTextMessageSizeLimit, getUri, isOpen, sendMessage, setBinaryMessageSizeLimit, setTextMessageSizeLimit`

- - ### Method Detail

    - #### getNativeSession

          Object getNativeSession()

      Return the underlying native WebSocketSession, if available.
      Returns:
        the native session or `null`

    - #### getNativeSession

          <T> T getNativeSession(Class<T> requiredType)

      Return the underlying native WebSocketSession, if available.
      Parameters:
        `requiredType` - the required type of the session
      Returns:
        the native session of the required type or `null`