| Modifier and Type | Field and Description |
|---|---|
| private JakartaWebSocketAsyncRemote | |
| private final AvailableDecoders | |
| private final AvailableEncoders | |
| private JakartaWebSocketBasicRemote | |
| private final JakartaWebSocketContainer | |
| private final CoreSession | |
| private final JakartaWebSocketFrameHandler | |
| private static final Logger | |
| private List | |
| private final Map | |
| private final String | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | JakartaWebSocketSession(JakartaWebSocketContainer container, CoreSession coreSession, JakartaWebSocketFrameHandler frameHandler, EndpointConfig endpointConfig)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public <T> void | addMessageHandler(Class<T>
type of the message processed by message handler to be registered. clazz, MessageHandler.partial message handler to be added. handlerImplements jakarta. Register to handle to incoming messages in this conversation. |
| public <T> void | addMessageHandler(Class<T>
type of the message processed by message handler to be registered. clazz, MessageHandler.whole message handler to be added. handlerImplements jakarta. Register to handle to incoming messages in this conversation. |
| public void | addMessageHandler(MessageHandler
the MessageHandler to be added. handler)Implements jakarta. Register to handle to incoming messages in this conversation. |
| public void | close()
Implements jakarta. Close the current conversation with a normal status code and no reason phrase. |
| public void | close(CloseReason
the reason for the closure. closeReason)Implements jakarta. Close the current conversation, giving a reason for the closure. |
| public void | filterReturnType(Object
the return object obj)Access for MethodHandle implementations to filter the return value of user provided TEXT/BINARY based message handling methods. |
| public RemoteEndpoint. | getAsyncRemote()
Implements jakarta. Return a reference a RemoteEndpoint object representing the peer of this conversation that is able to send messages asynchronously to the peer. |
| public RemoteEndpoint. | getBasicRemote()
Implements jakarta. Return a reference a RemoteEndpoint object representing the peer of this conversation that is able to send messages synchronously to the peer. |
| private long | |
| public WebSocketContainer | getContainer()
Implements jakarta. Return the container that this session is part of. |
| public JakartaWebSocketContainer | |
| public CoreSession | |
| public AvailableDecoders | |
| public AvailableEncoders | |
| public Object | |
| public JakartaWebSocketFrameHandler | |
| public String | getId()
Implements jakarta. Returns a string containing the unique identifier assigned to this session. |
| public int | getMaxBinaryMessageBufferSize()
Implements jakarta. The maximum length of incoming binary messages that this Session can buffer. |
| public long | getMaxIdleTimeout()
Implements jakarta. Return the number of milliseconds before this session will be closed by the container if it is inactive, i.e. no messages are either sent or received in that time. |
| public int | getMaxTextMessageBufferSize()
Implements jakarta. The maximum length of incoming text messages that this Session can buffer. |
| public Set | getMessageHandlers()
Implements jakarta. Return an unmodifiable copy of the set of MessageHandlers for this Session. |
| public List | getNegotiatedExtensions()
Implements jakarta. Return the list of extensions currently in use for this conversation. |
| public String | getNegotiatedSubprotocol()
Implements jakarta. Return the sub protocol agreed during the websocket handshake for this conversation. |
| public Set | getOpenSessions()
Implements jakarta. Return a copy of the Set of all the open web socket sessions that represent connections to the same endpoint to which this session represents a connection. |
| public Map | getPathParameters()
Implements jakarta. Return a map of the path parameter names and values used associated with the request this session was opened under. |
| public String | getProtocolVersion()
Implements jakarta. Returns the version of the websocket protocol currently being used. |
| public String | getQueryString()
Implements jakarta. Return the query string associated with the request this session was opened under. |
| public Map | getRequestParameterMap()
Implements jakarta. Return the request parameters associated with the request this session was opened under. |
| public URI | getRequestURI()
Implements jakarta. Return the complete URI under which this session was opened, from protocol to query string (if present). |
| public Principal | getUserPrincipal()
Implements jakarta. Return the authenticated user for this Session or |
| public Map | getUserProperties()
Implements jakarta. While the session is open, this method returns a Map that the developer may use to store application specific information relating to this session instance. |
| public boolean | isOpen()
Implements jakarta. Return true if and only if the underlying socket is open. |
| public boolean | isSecure()
Implements jakarta. Return true if and only if the underlying socket is using a secure transport. |
| public void | removeMessageHandler(MessageHandler
the handler to be removed. handler)Implements jakarta. Remove the given MessageHandler from the set belonging to this session. |
| public void | setMaxBinaryMessageBufferSize(int
the length in bytes length)Implements jakarta. Maximum size of a whole BINARY message that this implementation can buffer. |
| public void | setMaxIdleTimeout(long
the number of milliseconds. milliseconds)Implements jakarta. Set the number of milliseconds before this session will be closed by the container if it is inactive, i.e. no messages are either sent or received in that time. |
| public void | setMaxTextMessageBufferSize(int
the length in bytes length)Implements jakarta. Maximum size of a whole TEXT message that this implementation can buffer. |
| public String |
| asyncRemote | back to summary |
|---|---|
| private JakartaWebSocketAsyncRemote asyncRemote | |
| availableDecoders | back to summary |
|---|---|
| private final AvailableDecoders availableDecoders | |
| availableEncoders | back to summary |
|---|---|
| private final AvailableEncoders availableEncoders | |
| basicRemote | back to summary |
|---|---|
| private JakartaWebSocketBasicRemote basicRemote | |
| container | back to summary |
|---|---|
| private final JakartaWebSocketContainer container | |
| coreSession | back to summary |
|---|---|
| private final CoreSession coreSession | |
| frameHandler | back to summary |
|---|---|
| private final JakartaWebSocketFrameHandler frameHandler | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| negotiatedExtensions | back to summary |
|---|---|
| private List<Extension> negotiatedExtensions | |
| pathParameters | back to summary |
|---|---|
| private final Map<String, String> pathParameters | |
| sessionId | back to summary |
|---|---|
| private final String sessionId | |
| userProperties | back to summary |
|---|---|
| private final Map<String, Object> userProperties | |
| JakartaWebSocketSession | back to summary |
|---|---|
| public JakartaWebSocketSession(JakartaWebSocketContainer container, CoreSession coreSession, JakartaWebSocketFrameHandler frameHandler, EndpointConfig endpointConfig) | |
| abort | back to summary |
|---|---|
| public void abort() | |
| addMessageHandler | back to summary |
|---|---|
| public <T> void addMessageHandler(Class<T> clazz, MessageHandler. Implements jakarta. Doc from jakarta. Register to handle to incoming messages in this conversation. A maximum of one message handler per native
websocket message type (text, binary, pong) may be added to each Session. I.e. a maximum of one message handler
to handle incoming text messages a maximum of one message handler for handling incoming binary messages, and a
maximum of one for handling incoming pong messages. For further details of which message handlers handle which of
the native websocket message types please see Once the container has identified a MessageHandler for a message, the MessageHandler is used for the entirety of the message irrespective of any subsequent changes to the MessageHandlers configured for the Session.
| |
| addMessageHandler | back to summary |
|---|---|
| public <T> void addMessageHandler(Class<T> clazz, MessageHandler. Implements jakarta. Doc from jakarta. Register to handle to incoming messages in this conversation. A maximum of one message handler per native
websocket message type (text, binary, pong) may be added to each Session. I.e. a maximum of one message handler
to handle incoming text messages a maximum of one message handler for handling incoming binary messages, and a
maximum of one for handling incoming pong messages. For further details of which message handlers handle which of
the native websocket message types please see Once the container has identified a MessageHandler for a message, the MessageHandler is used for the entirety of the message irrespective of any subsequent changes to the MessageHandlers configured for the Session.
| |
| addMessageHandler | back to summary |
|---|---|
| public void addMessageHandler(MessageHandler handler) throws IllegalStateException Implements jakarta. Doc from jakarta. Register to handle to incoming messages in this conversation. A maximum of one message handler per native
websocket message type (text, binary, pong) may be added to each Session. I.e. a maximum of one message handler
to handle incoming text messages a maximum of one message handler for handling incoming binary messages, and a
maximum of one for handling incoming pong messages. For further details of which message handlers handle which of
the native websocket message types please see
This method is not safe to use unless you are providing an anonymous class derived directly from
Once the container has identified a MessageHandler for a message, the MessageHandler is used for the entirety of the message irrespective of any subsequent changes to the MessageHandlers configured for the Session.
| |
| close | back to summary |
|---|---|
| public void close() Implements jakarta. Doc from jakarta. Close the current conversation with a normal status code and no reason phrase.
| |
| close | back to summary |
|---|---|
| public void close(CloseReason closeReason) Implements jakarta. Doc from jakarta. Close the current conversation, giving a reason for the closure. The close call causes the implementation to
attempt notify the client of the close as soon as it can. This may cause the sending of unsent messages
immediately prior to the close notification. After the close notification has been sent the implementation
notifies the endpoint's onClose method. Note the websocket specification defines the acceptable uses of status
codes and reason phrases. If the application cannot determine a suitable close code to use for the closeReason,
it is recommended to use
| |
| filterReturnType | back to summary |
|---|---|
| public void filterReturnType(Object obj) Access for MethodHandle implementations to filter the return value of user provided TEXT/BINARY based message handling methods.
| |
| getAsyncRemote | back to summary |
|---|---|
| public RemoteEndpoint. Implements jakarta. Doc from jakarta. Return a reference a RemoteEndpoint object representing the peer of this conversation that is able to send messages asynchronously to the peer.
| |
| getBasicRemote | back to summary |
|---|---|
| public RemoteEndpoint. Implements jakarta. Doc from jakarta. Return a reference a RemoteEndpoint object representing the peer of this conversation that is able to send messages synchronously to the peer.
| |
| getBlockingTimeout | back to summary |
|---|---|
| private long getBlockingTimeout() | |
| getContainer | back to summary |
|---|---|
| public WebSocketContainer getContainer() Implements jakarta. Doc from jakarta. Return the container that this session is part of.
| |
| getContainerImpl | back to summary |
|---|---|
| public JakartaWebSocketContainer getContainerImpl() | |
| getCoreSession | back to summary |
|---|---|
| public CoreSession getCoreSession() | |
| getDecoders | back to summary |
|---|---|
| public AvailableDecoders getDecoders() | |
| getEncoders | back to summary |
|---|---|
| public AvailableEncoders getEncoders() | |
| getEndpoint | back to summary |
|---|---|
| public Object getEndpoint() | |
| getFrameHandler | back to summary |
|---|---|
| public JakartaWebSocketFrameHandler getFrameHandler() | |
| getId | back to summary |
|---|---|
| public String getId() Implements jakarta. Doc from jakarta. Returns a string containing the unique identifier assigned to this session. The identifier is assigned by the web socket implementation and is implementation dependent.
| |
| getMaxBinaryMessageBufferSize | back to summary |
|---|---|
| public int getMaxBinaryMessageBufferSize() Implements jakarta. Doc from jakarta. The maximum length of incoming binary messages that this Session can buffer. If the implementation receives a
binary message that it cannot buffer because it is too large, it must close the session with a close code of
| |
| getMaxIdleTimeout | back to summary |
|---|---|
| public long getMaxIdleTimeout() Implements jakarta. Doc from jakarta. Return the number of milliseconds before this session will be closed by the container if it is inactive, i.e. no messages are either sent or received in that time. A value that is zero or negative indicates that this timeout will not be used.
| |
| getMaxTextMessageBufferSize | back to summary |
|---|---|
| public int getMaxTextMessageBufferSize() Implements jakarta. Doc from jakarta. The maximum length of incoming text messages that this Session can buffer. If the implementation receives a text
message that it cannot buffer because it is too large, it must close the session with a close code of
| |
| getMessageHandlers | back to summary |
|---|---|
| public Set Implements jakarta. Doc from jakarta. Return an unmodifiable copy of the set of MessageHandlers for this Session.
| |
| getNegotiatedExtensions | back to summary |
|---|---|
| public List Implements jakarta. Doc from jakarta. Return the list of extensions currently in use for this conversation.
| |
| getNegotiatedSubprotocol | back to summary |
|---|---|
| public String getNegotiatedSubprotocol() Implements jakarta. Doc from jakarta. Return the sub protocol agreed during the websocket handshake for this conversation.
| |
| getOpenSessions | back to summary |
|---|---|
| public Set Implements jakarta. Doc from jakarta. Return a copy of the Set of all the open web socket sessions that represent connections to the same endpoint to which this session represents a connection. The Set includes the session this method is called on. These sessions may not still be open at any point after the return of this method. For example, iterating over the set at a later time may yield one or more closed sessions. Developers should use session.isOpen() to check.
| |
| getPathParameters | back to summary |
|---|---|
| public Map Implements jakarta. Doc from jakarta. Return a map of the path parameter names and values used associated with the request this session was opened under.
| |
| getProtocolVersion | back to summary |
|---|---|
| public String getProtocolVersion() Implements jakarta. Doc from jakarta. Returns the version of the websocket protocol currently being used. This is taken as the value of the Sec-WebSocket-Version header used in the opening handshake. i.e. "13".
| |
| getQueryString | back to summary |
|---|---|
| public String getQueryString() Implements jakarta. Doc from jakarta. Return the query string associated with the request this session was opened under.
| |
| getRequestParameterMap | back to summary |
|---|---|
| public Map Implements jakarta. Doc from jakarta. Return the request parameters associated with the request this session was opened under. The request parameters will have been part of the HTTP upgrade request which is limited by RFC 6455 to only use the HTTP GET method. Therefore, the parameters in the returned Map will be a representation of the parameters contained in the query string. | |
| getRequestURI | back to summary |
|---|---|
| public URI getRequestURI() Implements jakarta. Doc from jakarta. Return the complete URI under which this session was opened, from protocol to query string (if present). The URI
should be identical to the complete URI used for the HTTP request that was upgraded to WebSocket apart from the
protocol which should be changed to | |
| getUserPrincipal | back to summary |
|---|---|
| public Principal getUserPrincipal() Implements jakarta. Doc from jakarta. Return the authenticated user for this Session or
| |
| getUserProperties | back to summary |
|---|---|
| public Map Implements jakarta. Doc from jakarta. While the session is open, this method returns a Map that the developer may use to store application specific information relating to this session instance. The developer may retrieve information from this Map at any time between the opening of the session and during the onClose() method. But outside that time, any information stored using this Map may no longer be kept by the container. Web socket applications running on distributed implementations of the web container should make any application specific objects stored here java.io.Serializable, or the object may not be recreated after a failover.
For server sessions, the initial contents of this Map must be a shallow copy of the user properties map returned
from
For client sessions, the initial contents of this Map must be a shallow copy of the user properties map returned
from
| |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements jakarta. Doc from jakarta. Return true if and only if the underlying socket is open.
| |
| isSecure | back to summary |
|---|---|
| public boolean isSecure() Implements jakarta. Doc from jakarta. Return true if and only if the underlying socket is using a secure transport.
| |
| removeMessageHandler | back to summary |
|---|---|
| public void removeMessageHandler(MessageHandler handler) Implements jakarta. Doc from jakarta. Remove the given MessageHandler from the set belonging to this session. This method may block if the given handler is processing a message until it is no longer in use. Once the container has identified a MessageHandler for a message, the MessageHandler is used for the entirety of the message irrespective of any subsequent changes to the MessageHandlers configured for the Session.
| |
| setMaxBinaryMessageBufferSize | back to summary |
|---|---|
| public void setMaxBinaryMessageBufferSize(int length) Implements jakarta. Maximum size of a whole BINARY message that this implementation can buffer.
| |
| setMaxIdleTimeout | back to summary |
|---|---|
| public void setMaxIdleTimeout(long milliseconds) Implements jakarta. Doc from jakarta. Set the number of milliseconds before this session will be closed by the container if it is inactive, i.e. no messages are either sent or received in that time. A value that is zero or negative indicates that this timeout will not be used.
| |
| setMaxTextMessageBufferSize | back to summary |
|---|---|
| public void setMaxTextMessageBufferSize(int length) Implements jakarta. Maximum size of a whole TEXT message that this implementation can buffer.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |