Top Description Fields Constructors Methods
org.eclipse.jetty.ee10.websocket.jakarta.common

public Class JakartaWebSocketSession

extends Object
implements Session
Class Inheritance
All Implemented Interfaces
jakarta.websocket.Session, java.io.Closeable, java.lang.AutoCloseable
Imports
java.net.URI, java.security.Principal, java.time.Duration, java.util.Collections, .HashMap, .List, .Map, .Objects, .Set, .UUID, java.util.stream.Collectors, jakarta.websocket.CloseReason, .EndpointConfig, .Extension, .MessageHandler, .RemoteEndpoint.Async, .RemoteEndpoint.Basic, .Session, .WebSocketContainer, org.eclipse.jetty.ee10.websocket.jakarta.common.decoders.AvailableDecoders, org.eclipse.jetty.ee10.websocket.jakarta.common.encoders.AvailableEncoders, org.eclipse.jetty.util.Callback, org.eclipse.jetty.websocket.core.CoreSession, .ExtensionConfig, org.eclipse.jetty.websocket.core.util.ReflectUtils, org.slf4j.Logger, .LoggerFactory

Client Session for the JSR.

Field Summary

Modifier and TypeField 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<Extension>
private final Map<String, String>
private final String
private final Map<String, Object>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public <T> void
addMessageHandler(Class<T>
type of the message processed by message handler to be registered.
clazz
,
MessageHandler.Partial<T>
partial message handler to be added.
handler
)

Implements jakarta.websocket.Session.addMessageHandler.

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<T>
whole message handler to be added.
handler
)

Implements jakarta.websocket.Session.addMessageHandler.

Register to handle to incoming messages in this conversation.

public void
addMessageHandler(MessageHandler
the MessageHandler to be added.
handler
)

Implements jakarta.websocket.Session.addMessageHandler.

Register to handle to incoming messages in this conversation.

public void
close()

Implements jakarta.websocket.Session.close.

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.websocket.Session.close.

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.Async
getAsyncRemote()

Implements jakarta.websocket.Session.getAsyncRemote.

Return a reference a RemoteEndpoint object representing the peer of this conversation that is able to send messages asynchronously to the peer.

public RemoteEndpoint.Basic
getBasicRemote()

Implements jakarta.websocket.Session.getBasicRemote.

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.websocket.Session.getContainer.

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.websocket.Session.getId.

Returns a string containing the unique identifier assigned to this session.

public int
getMaxBinaryMessageBufferSize()

Implements jakarta.websocket.Session.getMaxBinaryMessageBufferSize.

The maximum length of incoming binary messages that this Session can buffer.

public long
getMaxIdleTimeout()

Implements jakarta.websocket.Session.getMaxIdleTimeout.

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.websocket.Session.getMaxTextMessageBufferSize.

The maximum length of incoming text messages that this Session can buffer.

public Set<MessageHandler>
getMessageHandlers()

Implements jakarta.websocket.Session.getMessageHandlers.

Return an unmodifiable copy of the set of MessageHandlers for this Session.

public List<Extension>
getNegotiatedExtensions()

Implements jakarta.websocket.Session.getNegotiatedExtensions.

Return the list of extensions currently in use for this conversation.

public String
getNegotiatedSubprotocol()

Implements jakarta.websocket.Session.getNegotiatedSubprotocol.

Return the sub protocol agreed during the websocket handshake for this conversation.

public Set<Session>
getOpenSessions()

Implements jakarta.websocket.Session.getOpenSessions.

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<String, String>
getPathParameters()

Implements jakarta.websocket.Session.getPathParameters.

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.websocket.Session.getProtocolVersion.

Returns the version of the websocket protocol currently being used.

public String
getQueryString()

Implements jakarta.websocket.Session.getQueryString.

Return the query string associated with the request this session was opened under.

public Map<String, List<String>>
getRequestParameterMap()

Implements jakarta.websocket.Session.getRequestParameterMap.

Return the request parameters associated with the request this session was opened under.

public URI
getRequestURI()

Implements jakarta.websocket.Session.getRequestURI.

Return the complete URI under which this session was opened, from protocol to query string (if present).

public Principal
getUserPrincipal()

Implements jakarta.websocket.Session.getUserPrincipal.

Return the authenticated user for this Session or null if no user is authenticated for this session.

public Map<String, Object>
getUserProperties()

Implements jakarta.websocket.Session.getUserProperties.

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.websocket.Session.isOpen.

Return true if and only if the underlying socket is open.

public boolean
isSecure()

Implements jakarta.websocket.Session.isSecure.

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.websocket.Session.removeMessageHandler.

Remove the given MessageHandler from the set belonging to this session.

public void
setMaxBinaryMessageBufferSize(int
the length in bytes
length
)

Implements jakarta.websocket.Session.setMaxBinaryMessageBufferSize.

Maximum size of a whole BINARY message that this implementation can buffer.

public void
setMaxIdleTimeout(long
the number of milliseconds.
milliseconds
)

Implements jakarta.websocket.Session.setMaxIdleTimeout.

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.websocket.Session.setMaxTextMessageBufferSize.

Maximum size of a whole TEXT message that this implementation can buffer.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

asyncRemoteback to summary
private JakartaWebSocketAsyncRemote asyncRemote
availableDecodersback to summary
private final AvailableDecoders availableDecoders
availableEncodersback to summary
private final AvailableEncoders availableEncoders
basicRemoteback to summary
private JakartaWebSocketBasicRemote basicRemote
containerback to summary
private final JakartaWebSocketContainer container
coreSessionback to summary
private final CoreSession coreSession
frameHandlerback to summary
private final JakartaWebSocketFrameHandler frameHandler
LOGback to summary
private static final Logger LOG
negotiatedExtensionsback to summary
private List<Extension> negotiatedExtensions
pathParametersback to summary
private final Map<String, String> pathParameters
sessionIdback to summary
private final String sessionId
userPropertiesback to summary
private final Map<String, Object> userProperties

Constructor Detail

JakartaWebSocketSessionback to summary
public JakartaWebSocketSession(JakartaWebSocketContainer container, CoreSession coreSession, JakartaWebSocketFrameHandler frameHandler, EndpointConfig endpointConfig)

Method Detail

abortback to summary
public void abort()
addMessageHandlerback to summary
public <T> void addMessageHandler(Class<T> clazz, MessageHandler.Partial<T> handler)

Implements jakarta.websocket.Session.addMessageHandler.

Doc from jakarta.websocket.Session.addMessageHandler.

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 MessageHandler.Whole and MessageHandler.Partial. Adding more than one of any one type will result in a runtime exception.

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.

Parameters
<T>
type of message that the given handler is intended for.
clazz:Class<T>

type of the message processed by message handler to be registered.

handler:MessageHandler.Partial<T>

partial message handler to be added.

Annotations
@Override
Since
JSR356 v1.1
See Also
Session#addMessageHandler(Class, MessageHandler.Partial)
addMessageHandlerback to summary
public <T> void addMessageHandler(Class<T> clazz, MessageHandler.Whole<T> handler)

Implements jakarta.websocket.Session.addMessageHandler.

Doc from jakarta.websocket.Session.addMessageHandler.

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 MessageHandler.Whole and MessageHandler.Partial. Adding more than one of any one type will result in a runtime exception.

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.

Parameters
<T>
type of message that the given handler is intended for.
clazz:Class<T>

type of the message processed by message handler to be registered.

handler:MessageHandler.Whole<T>

whole message handler to be added.

Annotations
@Override
Since
JSR356 v1.1
See Also
Session#addMessageHandler(Class, MessageHandler.Whole)
addMessageHandlerback to summary
public void addMessageHandler(MessageHandler handler) throws IllegalStateException

Implements jakarta.websocket.Session.addMessageHandler.

Doc from jakarta.websocket.Session.addMessageHandler.

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 MessageHandler.Whole and MessageHandler.Partial. Adding more than one of any one type will result in a runtime exception.

This method is not safe to use unless you are providing an anonymous class derived directly from jakarta.websocket.MessageHandler.Whole or jakarta.websocket.MessageHandler.Partial. In all other cases (Lambda Expressions, more complex inheritance or generic type arrangements), one of the following methods have to be used: addMessageHandler(Class, jakarta.websocket.MessageHandler.Whole) or addMessageHandler(Class, jakarta.websocket.MessageHandler.Partial).

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.

Parameters
handler:MessageHandler

the MessageHandler to be added.

Annotations
@SuppressWarnings:unchecked, rawtypes
@Override
Exceptions
IllegalStateException:
if there is already a MessageHandler registered for the same native websocket message type as this handler.
Since
JSR356 v1.0
See Also
Session#addMessageHandler(MessageHandler)
closeback to summary
public void close()

Implements jakarta.websocket.Session.close.

Doc from jakarta.websocket.Session.close.

Close the current conversation with a normal status code and no reason phrase.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#close()
closeback to summary
public void close(CloseReason closeReason)

Implements jakarta.websocket.Session.close.

Doc from jakarta.websocket.Session.close.

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 CloseReason.CloseCodes#NO_STATUS_CODE.

Parameters
closeReason:CloseReason

the reason for the closure.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#close(CloseReason)
filterReturnTypeback 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.

Parameters
obj:Object

the return object

Annotations
@SuppressWarnings:unused
getAsyncRemoteback to summary
public RemoteEndpoint.Async getAsyncRemote()

Implements jakarta.websocket.Session.getAsyncRemote.

Doc from jakarta.websocket.Session.getAsyncRemote.

Return a reference a RemoteEndpoint object representing the peer of this conversation that is able to send messages asynchronously to the peer.

Returns:RemoteEndpoint.Async

the remote endpoint.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getAsyncRemote()
getBasicRemoteback to summary
public RemoteEndpoint.Basic getBasicRemote()

Implements jakarta.websocket.Session.getBasicRemote.

Doc from jakarta.websocket.Session.getBasicRemote.

Return a reference a RemoteEndpoint object representing the peer of this conversation that is able to send messages synchronously to the peer.

Returns:RemoteEndpoint.Basic

the remote endpoint.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getBasicRemote()
getBlockingTimeoutback to summary
private long getBlockingTimeout()
getContainerback to summary
public WebSocketContainer getContainer()

Implements jakarta.websocket.Session.getContainer.

Doc from jakarta.websocket.Session.getContainer.

Return the container that this session is part of.

Returns:WebSocketContainer

the container.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getContainer()
getContainerImplback to summary
public JakartaWebSocketContainer getContainerImpl()
getCoreSessionback to summary
public CoreSession getCoreSession()
getDecodersback to summary
public AvailableDecoders getDecoders()
getEncodersback to summary
public AvailableEncoders getEncoders()
getEndpointback to summary
public Object getEndpoint()
getFrameHandlerback to summary
public JakartaWebSocketFrameHandler getFrameHandler()
getIdback to summary
public String getId()

Implements jakarta.websocket.Session.getId.

Doc from jakarta.websocket.Session.getId.

Returns a string containing the unique identifier assigned to this session. The identifier is assigned by the web socket implementation and is implementation dependent.

Returns:String

the unique identifier for this session instance.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getId()
getMaxBinaryMessageBufferSizeback to summary
public int getMaxBinaryMessageBufferSize()

Implements jakarta.websocket.Session.getMaxBinaryMessageBufferSize.

Doc from jakarta.websocket.Session.getMaxBinaryMessageBufferSize.

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 CloseReason.CloseCodes#TOO_BIG.

Returns:int

the maximum binary message size that can be buffered.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getMaxBinaryMessageBufferSize()
getMaxIdleTimeoutback to summary
public long getMaxIdleTimeout()

Implements jakarta.websocket.Session.getMaxIdleTimeout.

Doc from jakarta.websocket.Session.getMaxIdleTimeout.

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.

Returns:long

the timeout in milliseconds.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getMaxIdleTimeout()
getMaxTextMessageBufferSizeback to summary
public int getMaxTextMessageBufferSize()

Implements jakarta.websocket.Session.getMaxTextMessageBufferSize.

Doc from jakarta.websocket.Session.getMaxTextMessageBufferSize.

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 CloseReason.CloseCodes#TOO_BIG.

Returns:int

the maximum text message size that can be buffered.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getMaxTextMessageBufferSize()
getMessageHandlersback to summary
public Set<MessageHandler> getMessageHandlers()

Implements jakarta.websocket.Session.getMessageHandlers.

Doc from jakarta.websocket.Session.getMessageHandlers.

Return an unmodifiable copy of the set of MessageHandlers for this Session.

Returns:Set<MessageHandler>

the set of message handlers.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getMessageHandlers()
getNegotiatedExtensionsback to summary
public List<Extension> getNegotiatedExtensions()

Implements jakarta.websocket.Session.getNegotiatedExtensions.

Doc from jakarta.websocket.Session.getNegotiatedExtensions.

Return the list of extensions currently in use for this conversation.

Returns:List<Extension>

the negotiated extensions.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getNegotiatedExtensions()
getNegotiatedSubprotocolback to summary
public String getNegotiatedSubprotocol()

Implements jakarta.websocket.Session.getNegotiatedSubprotocol.

Doc from jakarta.websocket.Session.getNegotiatedSubprotocol.

Return the sub protocol agreed during the websocket handshake for this conversation.

Returns:String

the negotiated subprotocol, or the empty string if there isn't one.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getNegotiatedSubprotocol()
getOpenSessionsback to summary
public Set<Session> getOpenSessions()

Implements jakarta.websocket.Session.getOpenSessions.

Doc from jakarta.websocket.Session.getOpenSessions.

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.

Returns:Set<Session>

the set of sessions, open at the time of return.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getOpenSessions()
getPathParametersback to summary
public Map<String, String> getPathParameters()

Implements jakarta.websocket.Session.getPathParameters.

Doc from jakarta.websocket.Session.getPathParameters.

Return a map of the path parameter names and values used associated with the request this session was opened under.

Returns:Map<String, String>

the unmodifiable map of path parameters. The key of the map is the parameter name, the values in the map are the parameter values.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getPathParameters()
getProtocolVersionback to summary
public String getProtocolVersion()

Implements jakarta.websocket.Session.getProtocolVersion.

Doc from jakarta.websocket.Session.getProtocolVersion.

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".

Returns:String

the protocol version.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getProtocolVersion()
getQueryStringback to summary
public String getQueryString()

Implements jakarta.websocket.Session.getQueryString.

Doc from jakarta.websocket.Session.getQueryString.

Return the query string associated with the request this session was opened under.

Returns:String

the query string

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getQueryString()
getRequestParameterMapback to summary
public Map<String, List<String>> getRequestParameterMap()

Implements jakarta.websocket.Session.getRequestParameterMap.

Doc from jakarta.websocket.Session.getRequestParameterMap.

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.

Returns:Map<String, List<String>>

the unmodifiable map of the request parameters.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getRequestParameterMap()
getRequestURIback to summary
public URI getRequestURI()

Implements jakarta.websocket.Session.getRequestURI.

Doc from jakarta.websocket.Session.getRequestURI.

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 ws or wss as appropriate. It is the URI associated with the HTTP request that received the 101 Switching Protocols response that is used as the basis for this value - not an earlier, redirected request - if any.

Returns:URI

the request URI.

Annotations
@Override
Since
JSR356 v1.0
See Also
)
getUserPrincipalback to summary
public Principal getUserPrincipal()

Implements jakarta.websocket.Session.getUserPrincipal.

Doc from jakarta.websocket.Session.getUserPrincipal.

Return the authenticated user for this Session or null if no user is authenticated for this session.

Returns:Principal

the user principal.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getUserPrincipal()
getUserPropertiesback to summary
public Map<String, Object> getUserProperties()

Implements jakarta.websocket.Session.getUserProperties.

Doc from jakarta.websocket.Session.getUserProperties.

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 jakarta.websocket.server.ServerEndpointConfig#getUserProperties() at the point the jakarta.websocket.server.ServerEndpointConfig.Configurator#modifyHandshake() method exits.

For client sessions, the initial contents of this Map must be a shallow copy of the user properties map returned from ClientEndpointConfig#getUserProperties() for the ClientEndpointConfig passed to WebSocketContainer#connectToServer(Class, ClientEndpointConfig, URI) or WebSocketContainer#connectToServer(Endpoint, ClientEndpointConfig, URI).

Returns:Map<String, Object>

an editable Map of application data.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#getUserProperties()
isOpenback to summary
public boolean isOpen()

Implements jakarta.websocket.Session.isOpen.

Doc from jakarta.websocket.Session.isOpen.

Return true if and only if the underlying socket is open.

Returns:boolean

whether the session is active.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#isOpen()
isSecureback to summary
public boolean isSecure()

Implements jakarta.websocket.Session.isSecure.

Doc from jakarta.websocket.Session.isSecure.

Return true if and only if the underlying socket is using a secure transport.

Returns:boolean

whether its using a secure transport.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#isSecure()
removeMessageHandlerback to summary
public void removeMessageHandler(MessageHandler handler)

Implements jakarta.websocket.Session.removeMessageHandler.

Doc from jakarta.websocket.Session.removeMessageHandler.

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.

Parameters
handler:MessageHandler

the handler to be removed.

Annotations
@Override
setMaxBinaryMessageBufferSizeback to summary
public void setMaxBinaryMessageBufferSize(int length)

Implements jakarta.websocket.Session.setMaxBinaryMessageBufferSize.

Maximum size of a whole BINARY message that this implementation can buffer.

Parameters
length:int

the length in bytes

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#setMaxBinaryMessageBufferSize(int)
setMaxIdleTimeoutback to summary
public void setMaxIdleTimeout(long milliseconds)

Implements jakarta.websocket.Session.setMaxIdleTimeout.

Doc from jakarta.websocket.Session.setMaxIdleTimeout.

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.

Parameters
milliseconds:long

the number of milliseconds.

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#setMaxIdleTimeout(long)
setMaxTextMessageBufferSizeback to summary
public void setMaxTextMessageBufferSize(int length)

Implements jakarta.websocket.Session.setMaxTextMessageBufferSize.

Maximum size of a whole TEXT message that this implementation can buffer.

Parameters
length:int

the length in bytes

Annotations
@Override
Since
JSR356 v1.0
See Also
Session#setMaxTextMessageBufferSize(int)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override