|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.tyrus.SessionImpl
public class SessionImpl
Implementation of the WebSocketConversation.
| Method Summary | |
|---|---|
void |
addMessageHandler(MessageHandler listener)
Register to handle to incoming messages in this conversation. |
void |
close()
Close the current conversation with a normal status code and no reason phrase. |
void |
close(CloseReason closeReason)
Closes the underlying connection this session is based upon. |
ClientContainer |
getContainer()
Return the container that this session is part of. |
long |
getInactiveTime()
Return the number of seconds since the underlying connection had any activity. |
long |
getMaximumMessageSize()
The maximum total length of messages, text or binary, that this Session can handle. |
Set<MessageHandler> |
getMessageHandlers()
Return an unmodifiable copy of the set of MessageHandlers for this Session. |
List<String> |
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. |
Map<String,String> |
getPathParameters()
Return a map of the path parameter names and values used if the server endpoint was deployed with a URI-template and the client connected with a particular matching URL. |
Map<String,Object> |
getProperties()
|
String |
getProtocolVersion()
Web Socket protocol version used. |
String |
getQueryString()
Return the query string associated with the request this session was opened under. |
RemoteEndpoint |
getRemote()
Return a reference to the RemoteEndpoint object representing the other end of this conversation. |
Map<String,String[]> |
getRequestParameterMap()
Return the request parameters associated with the request this session was opened under. |
URI |
getRequestURI()
Return the URI that this session was opened under. |
long |
getTimeout()
Return the number of milliseconds before this conversation will be closed by the container if it is inactive, ie no messages are either sent or received in that time. |
boolean |
isActive()
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 listener)
Remove the given MessageHandler from the set belonging to this session. |
void |
setEncoders(List<Encoder> encoders)
Sets the list of encoders to be used in this session in order of preference. |
void |
setMaximumMessageSize(long maximumMessageSize)
Sets the maximum total length of messages, text or binary, that this Session can handle. |
void |
setTimeout(long seconds)
Set the number of milliseconds before this conversation will be closed by the container if it is inactive, ie no messages are either sent or received. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public String getProtocolVersion()
getProtocolVersion in interface Sessionpublic String getNegotiatedSubprotocol()
Session
getNegotiatedSubprotocol in interface Sessionpublic RemoteEndpoint getRemote()
Session
getRemote in interface Sessionpublic boolean isActive()
Session
isActive in interface Sessionpublic long getTimeout()
Session
getTimeout in interface Session
public void close()
throws IOException
Session
close in interface SessionIOException
public void close(CloseReason closeReason)
throws IOException
close in interface SessioncloseReason - the reason for the closure.
IOExceptionpublic String toString()
toString in class Objectpublic void setTimeout(long seconds)
Session
setTimeout in interface Sessionseconds - the number of milliseconds.public void setMaximumMessageSize(long maximumMessageSize)
Session
setMaximumMessageSize in interface SessionmaximumMessageSize - the maximum lengthpublic long getMaximumMessageSize()
Session
getMaximumMessageSize in interface Sessionpublic List<String> getNegotiatedExtensions()
Session
getNegotiatedExtensions in interface Sessionpublic boolean isSecure()
Session
isSecure in interface Sessionpublic long getInactiveTime()
Session
getInactiveTime in interface Sessionpublic ClientContainer getContainer()
Session
getContainer in interface Sessionpublic void setEncoders(List<Encoder> encoders)
Session
setEncoders in interface Sessionencoders - the list of encoders.public void addMessageHandler(MessageHandler listener)
Session
addMessageHandler in interface Sessionlistener - the MessageHandler to be added.public Set<MessageHandler> getMessageHandlers()
Session
getMessageHandlers in interface Sessionpublic void removeMessageHandler(MessageHandler listener)
Session
removeMessageHandler in interface Sessionlistener - the handler to be removed.
public URI getRequestURI()
Session
getRequestURI in interface Sessionpublic Map<String,String[]> getRequestParameterMap()
Session
getRequestParameterMap in interface Sessionpublic Map<String,String> getPathParameters()
Session
getPathParameters in interface Sessionpublic String getQueryString()
Session
getQueryString in interface Sessionpublic Map<String,Object> getProperties()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||