Class JakartaWebSocketSession

java.lang.Object
org.eclipse.jetty.websocket.jakarta.common.JakartaWebSocketSession
All Implemented Interfaces:
jakarta.websocket.Session, Closeable, AutoCloseable

public class JakartaWebSocketSession extends Object implements jakarta.websocket.Session
Client Session for the JSR.
  • Constructor Details

  • Method Details

    • getCoreSession

      public CoreSession getCoreSession()
    • addMessageHandler

      public <T> void addMessageHandler(Class<T> clazz, jakarta.websocket.MessageHandler.Partial<T> handler)
      Specified by:
      addMessageHandler in interface jakarta.websocket.Session
      Since:
      JSR356 v1.1
      See Also:
      • Session.addMessageHandler(Class, MessageHandler.Partial)
    • addMessageHandler

      public <T> void addMessageHandler(Class<T> clazz, jakarta.websocket.MessageHandler.Whole<T> handler)
      Specified by:
      addMessageHandler in interface jakarta.websocket.Session
      Since:
      JSR356 v1.1
      See Also:
      • Session.addMessageHandler(Class, MessageHandler.Whole)
    • addMessageHandler

      public void addMessageHandler(jakarta.websocket.MessageHandler handler) throws IllegalStateException
      Specified by:
      addMessageHandler in interface jakarta.websocket.Session
      Throws:
      IllegalStateException
      Since:
      JSR356 v1.0
      See Also:
      • Session.addMessageHandler(MessageHandler)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.close()
    • close

      public void close(jakarta.websocket.CloseReason closeReason)
      Specified by:
      close in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.close(CloseReason)
    • filterReturnType

      public void filterReturnType(Object obj)
      Access for MethodHandle implementations to filter the return value of user provided TEXT/BINARY based message handling methods.
      Parameters:
      obj - the return object
    • getAsyncRemote

      public jakarta.websocket.RemoteEndpoint.Async getAsyncRemote()
      Specified by:
      getAsyncRemote in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getAsyncRemote()
    • getBasicRemote

      public jakarta.websocket.RemoteEndpoint.Basic getBasicRemote()
      Specified by:
      getBasicRemote in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getBasicRemote()
    • getContainer

      public jakarta.websocket.WebSocketContainer getContainer()
      Specified by:
      getContainer in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getContainer()
    • getContainerImpl

      public JakartaWebSocketContainer getContainerImpl()
    • getDecoders

      public AvailableDecoders getDecoders()
    • getEncoders

      public AvailableEncoders getEncoders()
    • getEndpoint

      public Object getEndpoint()
    • getFrameHandler

      public JakartaWebSocketFrameHandler getFrameHandler()
    • abort

      public void abort()
    • getId

      public String getId()
      Specified by:
      getId in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getId()
    • getMaxBinaryMessageBufferSize

      public int getMaxBinaryMessageBufferSize()
      Specified by:
      getMaxBinaryMessageBufferSize in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getMaxBinaryMessageBufferSize()
    • setMaxBinaryMessageBufferSize

      public void setMaxBinaryMessageBufferSize(int length)
      Maximum size of a whole BINARY message that this implementation can buffer.
      Specified by:
      setMaxBinaryMessageBufferSize in interface jakarta.websocket.Session
      Parameters:
      length - the length in bytes
      Since:
      JSR356 v1.0
      See Also:
      • Session.setMaxBinaryMessageBufferSize(int)
    • getMaxIdleTimeout

      public long getMaxIdleTimeout()
      Specified by:
      getMaxIdleTimeout in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getMaxIdleTimeout()
    • setMaxIdleTimeout

      public void setMaxIdleTimeout(long milliseconds)
      Specified by:
      setMaxIdleTimeout in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.setMaxIdleTimeout(long)
    • getMaxTextMessageBufferSize

      public int getMaxTextMessageBufferSize()
      Specified by:
      getMaxTextMessageBufferSize in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getMaxTextMessageBufferSize()
    • setMaxTextMessageBufferSize

      public void setMaxTextMessageBufferSize(int length)
      Maximum size of a whole TEXT message that this implementation can buffer.
      Specified by:
      setMaxTextMessageBufferSize in interface jakarta.websocket.Session
      Parameters:
      length - the length in bytes
      Since:
      JSR356 v1.0
      See Also:
      • Session.setMaxTextMessageBufferSize(int)
    • getMessageHandlers

      public Set<jakarta.websocket.MessageHandler> getMessageHandlers()
      Specified by:
      getMessageHandlers in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getMessageHandlers()
    • getNegotiatedExtensions

      public List<jakarta.websocket.Extension> getNegotiatedExtensions()
      Specified by:
      getNegotiatedExtensions in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getNegotiatedExtensions()
    • getNegotiatedSubprotocol

      public String getNegotiatedSubprotocol()
      Specified by:
      getNegotiatedSubprotocol in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getNegotiatedSubprotocol()
    • getOpenSessions

      public Set<jakarta.websocket.Session> getOpenSessions()
      Specified by:
      getOpenSessions in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getOpenSessions()
    • getPathParameters

      public Map<String,String> getPathParameters()
      Specified by:
      getPathParameters in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getPathParameters()
    • getProtocolVersion

      public String getProtocolVersion()
      Specified by:
      getProtocolVersion in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getProtocolVersion()
    • getQueryString

      public String getQueryString()
      Specified by:
      getQueryString in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getQueryString()
    • getRequestParameterMap

      public Map<String,List<String>> getRequestParameterMap()
      Specified by:
      getRequestParameterMap in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getRequestParameterMap()
    • getRequestURI

      public URI getRequestURI()
      Specified by:
      getRequestURI in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • )
    • getUserPrincipal

      public Principal getUserPrincipal()
      Specified by:
      getUserPrincipal in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getUserPrincipal()
    • getUserProperties

      public Map<String,Object> getUserProperties()
      Specified by:
      getUserProperties in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.getUserProperties()
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.isOpen()
    • isSecure

      public boolean isSecure()
      Specified by:
      isSecure in interface jakarta.websocket.Session
      Since:
      JSR356 v1.0
      See Also:
      • Session.isSecure()
    • removeMessageHandler

      public void removeMessageHandler(jakarta.websocket.MessageHandler handler)
      Specified by:
      removeMessageHandler in interface jakarta.websocket.Session
    • toString

      public String toString()
      Overrides:
      toString in class Object