public class ClusterSession extends Object implements Session
| Modifier and Type | Class and Description |
|---|---|
static class |
ClusterSession.DistributedMapKey |
| Constructor and Description |
|---|
ClusterSession(String sessionId,
ClusterContext clusterContext,
Map<ClusterSession.DistributedMapKey,Object> distributedPropertyMap,
TyrusEndpointWrapper endpointWrapper,
Session session)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMessageHandler(MessageHandler handler)
Not supported (yet?).
|
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()
Return a reference a RemoteEndpoint object representing the peer of this conversation
that is able to send messages asynchronously to the peer.
|
RemoteEndpoint.Basic |
getBasicRemote()
Return a reference a RemoteEndpoint object representing the peer of this conversation
that is able to send messages synchronously to the peer.
|
WebSocketContainer |
getContainer()
Not supported (yet?).
|
String |
getId()
Returns a string containing the unique identifier assigned to this session.
|
int |
getMaxBinaryMessageBufferSize()
The maximum length of incoming binary messages that this Session can buffer.
|
long |
getMaxIdleTimeout()
Return the number of milliseconds before this conversation may be closed by the
container if it is inactive, i.e.
|
int |
getMaxTextMessageBufferSize()
The maximum length of incoming text messages that this Session can buffer.
|
Set<MessageHandler> |
getMessageHandlers()
Not supported (yet?).
|
List<Extension> |
getNegotiatedExtensions()
Return the list of extensions currently in use for this conversation.
|
String |
getNegotiatedSubprotocol()
Return the sub protocol agreed during the websocket handshake for this conversation.
|
Set<Session> |
getOpenSessions()
Not supported.
|
Map<String,String> |
getPathParameters()
Return a map of the path parameter names and values used associated with the
request this session was opened under.
|
String |
getProtocolVersion()
Returns the version of the websocket protocol currently being used.
|
String |
getQueryString()
Return the query string associated with the request this session
was opened under.
|
Map<String,List<String>> |
getRequestParameterMap()
Return the request parameters associated with the request this session
was opened under.
|
URI |
getRequestURI()
Return the URI under which this session was opened, including
the query string if there is one.
|
Principal |
getUserPrincipal()
Return the authenticated user for this Session or
null if no user is authenticated for this session. |
Map<String,Object> |
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.
|
boolean |
isOpen()
Return true if and only if the underlying socket is open.
|
boolean |
isSecure()
Return true if and only if the underlying socket is using a secure transport.
|
void |
removeMessageHandler(MessageHandler handler)
Not supported (yet?).
|
void |
setMaxBinaryMessageBufferSize(int length)
Remote setters are not supported (yet?).
|
void |
setMaxIdleTimeout(long milliseconds)
Remote setters are not supported (yet?).
|
void |
setMaxTextMessageBufferSize(int length)
Remote setters are not supported (yet?).
|
String |
toString() |
public ClusterSession(String sessionId, ClusterContext clusterContext, Map<ClusterSession.DistributedMapKey,Object> distributedPropertyMap, TyrusEndpointWrapper endpointWrapper, Session session)
sessionId - session id.clusterContext - cluster context.endpointWrapper - used just to get encoders/decoders.session - used just to get encoders/decoders.public WebSocketContainer getContainer()
getContainer in interface Sessionpublic void addMessageHandler(MessageHandler handler) throws IllegalStateException
addMessageHandler in interface Sessionhandler - nothing.IllegalStateException - newer.public Set<MessageHandler> getMessageHandlers()
getMessageHandlers in interface Sessionpublic void removeMessageHandler(MessageHandler handler)
removeMessageHandler in interface Sessionhandler - nothing.public String getProtocolVersion()
SessiongetProtocolVersion in interface Sessionpublic String getNegotiatedSubprotocol()
SessiongetNegotiatedSubprotocol in interface Sessionpublic List<Extension> getNegotiatedExtensions()
SessiongetNegotiatedExtensions in interface Sessionpublic boolean isSecure()
Sessionpublic boolean isOpen()
Sessionpublic long getMaxIdleTimeout()
SessiongetMaxIdleTimeout in interface Sessionpublic void setMaxIdleTimeout(long milliseconds)
setMaxIdleTimeout in interface Sessionmilliseconds - nothing.public void setMaxBinaryMessageBufferSize(int length)
setMaxBinaryMessageBufferSize in interface Sessionlength - nothing.public int getMaxBinaryMessageBufferSize()
SessionCloseReason.CloseCodes.TOO_BIG.getMaxBinaryMessageBufferSize in interface Sessionpublic void setMaxTextMessageBufferSize(int length)
setMaxTextMessageBufferSize in interface Sessionlength - nothing.public int getMaxTextMessageBufferSize()
SessionCloseReason.CloseCodes.TOO_BIG.getMaxTextMessageBufferSize in interface Sessionpublic RemoteEndpoint.Async getAsyncRemote()
SessiongetAsyncRemote in interface Sessionpublic RemoteEndpoint.Basic getBasicRemote()
SessiongetBasicRemote in interface Sessionpublic String getId()
Sessionpublic void close()
throws IOException
Sessionclose in interface Closeableclose in interface AutoCloseableclose in interface SessionIOException - if there was a connection error closing the connection.public void close(CloseReason closeReason) throws IOException
SessionCloseReason.CloseCodes.NO_STATUS_CODE.close in interface SessioncloseReason - the reason for the closure.IOException - if there was a connection error closing the connectionpublic URI getRequestURI()
SessiongetRequestURI in interface Sessionpublic Map<String,List<String>> getRequestParameterMap()
SessiongetRequestParameterMap in interface Sessionpublic String getQueryString()
SessiongetQueryString in interface Sessionpublic Map<String,String> getPathParameters()
SessiongetPathParameters in interface Sessionpublic Map<String,Object> getUserProperties()
SessiongetUserProperties in interface Sessionpublic Principal getUserPrincipal()
Sessionnull if no user is authenticated for this session.getUserPrincipal in interface Sessionpublic Set<Session> getOpenSessions()
getOpenSessions in interface SessionCopyright © 2012-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.