public class RemoteSession extends java.lang.Object implements Session, DistributedSession
| Modifier and Type | Class and Description | 
|---|---|
| static class  | RemoteSession.DistributedMapKey | 
| Constructor and Description | 
|---|
| RemoteSession(java.lang.String sessionId,
             ClusterContext clusterContext,
             java.util.Map<RemoteSession.DistributedMapKey,java.lang.Object> distributedPropertyMap,
             TyrusEndpointWrapper endpointWrapper,
             Session session)Constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| <T> void | addMessageHandler(java.lang.Class<T> clazz,
                 MessageHandler.Partial<T> handler)This method is not supported on  RemoteSession. | 
| <T> void | addMessageHandler(java.lang.Class<T> clazz,
                 MessageHandler.Whole<T> handler)This method is not supported on  RemoteSession. | 
| void | addMessageHandler(MessageHandler handler)This method is not supported on  RemoteSession. | 
| void | close()Close the current conversation with a normal status code and no reason phrase. | 
| void | close(CloseReason closeReason)Close the current conversation, giving a reason for the closure. | 
| RemoteEndpoint.Async | getAsyncRemote()Get a reference a  RemoteEndpoint.Asyncobject representing the peer of this conversation
 that is able to send messages asynchronously to the peer. | 
| RemoteEndpoint.Basic | getBasicRemote()Get a reference a  RemoteEndpoint.Basicobject representing the peer of this conversation
 that is able to send messages synchronously to the peer. | 
| WebSocketContainer | getContainer()This method is not supported on  RemoteSession. | 
| java.util.Map<java.lang.String,java.lang.Object> | getDistributedProperties()Get distributed properties. | 
| java.lang.String | getId()Get a string containing the unique identifier assigned to this session. | 
| int | getMaxBinaryMessageBufferSize()Get the maximum length of incoming binary messages that this Session can buffer. | 
| long | getMaxIdleTimeout()Get the number of milliseconds before this conversation may be closed by the
 container if it is inactive, i.e. | 
| int | getMaxTextMessageBufferSize()Get the maximum length of incoming text messages that this Session can buffer. | 
| java.util.Set<MessageHandler> | getMessageHandlers()This method is not supported on  RemoteSession. | 
| java.util.List<Extension> | getNegotiatedExtensions()Get the list of extensions currently in use for this conversation. | 
| java.lang.String | getNegotiatedSubprotocol()Get the sub protocol agreed during the websocket handshake for this conversation. | 
| java.util.Set<Session> | getOpenSessions()This method is not supported on  RemoteSession. | 
| java.util.Map<java.lang.String,java.lang.String> | getPathParameters()Get a map of the path parameter names and values used associated with the
 request this session was opened under. | 
| java.lang.String | getProtocolVersion()Get the version of the websocket protocol currently being used. | 
| java.lang.String | getQueryString()Get the query string associated with the request this session
 was opened under. | 
| java.util.Map<java.lang.String,java.util.List<java.lang.String>> | getRequestParameterMap()Get the request parameters associated with the request this session
 was opened under. | 
| java.net.URI | getRequestURI()Get the  URIunder which this session was opened, including
 the query string if there is one. | 
| java.security.Principal | getUserPrincipal()Get the authenticated user for this session or  nullif no user is authenticated for this session. | 
| java.util.Map<java.lang.String,java.lang.Object> | getUserProperties()This method is not supported on  RemoteSession. | 
| boolean | isOpen()Get the information about session state. | 
| boolean | isSecure()Get the information about secure transport. | 
| void | removeMessageHandler(MessageHandler handler)This method is not supported on  RemoteSession. | 
| void | setMaxBinaryMessageBufferSize(int length)This method is not supported on  RemoteSession. | 
| void | setMaxIdleTimeout(long milliseconds)This method is not supported on  RemoteSession. | 
| void | setMaxTextMessageBufferSize(int length)This method is not supported on  RemoteSession. | 
| java.lang.String | toString() | 
public RemoteSession(java.lang.String sessionId,
                     ClusterContext clusterContext,
                     java.util.Map<RemoteSession.DistributedMapKey,java.lang.Object> distributedPropertyMap,
                     TyrusEndpointWrapper endpointWrapper,
                     Session session)
sessionId - session id.clusterContext - cluster context.distributedPropertyMap - distributed property map.endpointWrapper - used just to get encoders/decoders.session - used just to get encoders/decoders.public java.lang.String getProtocolVersion()
getProtocolVersion in interface Sessionpublic java.lang.String getNegotiatedSubprotocol()
getNegotiatedSubprotocol in interface Sessionpublic java.util.List<Extension> getNegotiatedExtensions()
getNegotiatedExtensions in interface Sessionpublic boolean isSecure()
public boolean isOpen()
public long getMaxIdleTimeout()
getMaxIdleTimeout in interface Sessionpublic int getMaxBinaryMessageBufferSize()
CloseReason.CloseCodes#TOO_BIG.getMaxBinaryMessageBufferSize in interface Sessionpublic int getMaxTextMessageBufferSize()
CloseReason.CloseCodes#TOO_BIG.getMaxTextMessageBufferSize in interface Sessionpublic RemoteEndpoint.Async getAsyncRemote()
RemoteEndpoint.Async object representing the peer of this conversation
 that is able to send messages asynchronously to the peer.getAsyncRemote in interface Sessionpublic RemoteEndpoint.Basic getBasicRemote()
RemoteEndpoint.Basic object representing the peer of this conversation
 that is able to send messages synchronously to the peer.getBasicRemote in interface Sessionpublic java.lang.String getId()
public void close()
           throws java.io.IOException
public void close(CloseReason closeReason) throws java.io.IOException
CloseReason.CloseCodes#NO_STATUS_CODE.public java.net.URI getRequestURI()
URI under which this session was opened, including
 the query string if there is one.getRequestURI in interface Sessionpublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> getRequestParameterMap()
getRequestParameterMap in interface Sessionpublic java.lang.String getQueryString()
getQueryString in interface Sessionpublic java.util.Map<java.lang.String,java.lang.String> getPathParameters()
getPathParameters in interface Sessionpublic java.util.Map<java.lang.String,java.lang.Object> getUserProperties()
RemoteSession. Each invocation will throw an UnsupportedOperationException.getUserProperties in interface SessiongetDistributedProperties()public java.util.Map<java.lang.String,java.lang.Object> getDistributedProperties()
DistributedSession
 Values put into this map must be Serializable or serializable by other, implementation-dependent
 alternative.
 
 Content of this map is synchronized among all cluster nodes, so putting an entry on any of the nodes will be
 visible on all other nodes which have reference to current session (in form of TyrusSession or RemoteSession).
 
 Please note that when not running in the distributed environment, this map behaves similarly to Session.getUserProperties(), so no serialization or deserialization is performed when values are read from or stored to
 the returned map.
getDistributedProperties in interface DistributedSessionTyrusSession, 
RemoteSessionpublic java.security.Principal getUserPrincipal()
null if no user is authenticated for this session.getUserPrincipal in interface Sessionpublic java.lang.String toString()
toString in class java.lang.Objectpublic WebSocketContainer getContainer()
RemoteSession. Each invocation will throw an UnsupportedOperationException.getContainer in interface Sessionpublic void addMessageHandler(MessageHandler handler) throws java.lang.IllegalStateException
RemoteSession. Each invocation will throw an UnsupportedOperationException.addMessageHandler in interface Sessionhandler - nothing.java.lang.IllegalStateException - if there is already a MessageHandler registered for the same native websocket
                               message type as this handler.public <T> void addMessageHandler(java.lang.Class<T> clazz,
                                  MessageHandler.Whole<T> handler)
RemoteSession. Each invocation will throw an UnsupportedOperationException.addMessageHandler in interface SessionT - type of message that the given handler is intended for.clazz - nothing.handler - nothing.public <T> void addMessageHandler(java.lang.Class<T> clazz,
                                  MessageHandler.Partial<T> handler)
RemoteSession. Each invocation will throw an UnsupportedOperationException.addMessageHandler in interface SessionT - type of message that the given handler is intended for.clazz - nothing.handler - nothing.public java.util.Set<MessageHandler> getMessageHandlers()
RemoteSession. Each invocation will throw an UnsupportedOperationException.getMessageHandlers in interface Sessionpublic void removeMessageHandler(MessageHandler handler)
RemoteSession. Each invocation will throw an UnsupportedOperationException.removeMessageHandler in interface Sessionhandler - nothing.public void setMaxIdleTimeout(long milliseconds)
RemoteSession. Each invocation will throw an UnsupportedOperationException.setMaxIdleTimeout in interface Sessionmilliseconds - nothing.public void setMaxBinaryMessageBufferSize(int length)
RemoteSession. Each invocation will throw an UnsupportedOperationException.setMaxBinaryMessageBufferSize in interface Sessionlength - nothing.public void setMaxTextMessageBufferSize(int length)
RemoteSession. Each invocation will throw an UnsupportedOperationException.setMaxTextMessageBufferSize in interface Sessionlength - nothing.public java.util.Set<Session> getOpenSessions()
RemoteSession. Each invocation will throw an UnsupportedOperationException.getOpenSessions in interface SessionCopyright © 2012–2025 Oracle Corporation. All rights reserved.