|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.tyrus.platform.SessionImpl
public class SessionImpl
Implementation of the WebSocketConversation.
| Method Summary | |
|---|---|
void |
addEncoder(Encoder encoder)
|
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. |
CloseReason |
getCloseStatus()
If this session is no longer active, returns the reason for closure. |
Long |
getId()
Return a unique ID for this session. |
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 |
getMessageHandlers()
Return an unmodifiable copy of the set of MessageHandlers for this Session. |
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. |
String |
getProtocolVersion()
Web Socket protocol version used. |
RemoteEndpoint |
getRemote()
Return a reference to the RemoteEndpoint object representing the other end of this conversation. |
RemoteEndpoint |
getRemote(Class c)
Return a reference to the RemoteEndpoint that can send messages in the form of objects of class c. |
URI |
getRequestURI()
Return the URI that this session was opened under. |
javax.servlet.http.HttpSession |
getSession()
Return a reference to the HttpSession that the web socket handshake that started this conversation was part of, if applicable. |
long |
getTimeout()
Return the number of seconds 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 |
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 seconds 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 javax.servlet.http.HttpSession getSession()
Session
getSession in interface Sessionpublic String getNegotiatedSubprotocol()
Session
getNegotiatedSubprotocol in interface Sessionpublic RemoteEndpoint getRemote()
Session
getRemote in interface Sessionpublic RemoteEndpoint getRemote(Class c)
Session
getRemote in interface Sessionpublic Long getId()
public 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 SessionIOExceptionpublic String toString()
toString in class Objectpublic CloseReason getCloseStatus()
Session
getCloseStatus in interface Sessionpublic void setTimeout(long seconds)
Session
setTimeout in interface Sessionpublic void setMaximumMessageSize(long maximumMessageSize)
Session
setMaximumMessageSize in interface Sessionpublic long getMaximumMessageSize()
Session
getMaximumMessageSize in interface Sessionpublic List<Extension> getNegotiatedExtensions()
Session
getNegotiatedExtensions in interface Sessionpublic boolean isSecure()
Session
isSecure in interface Sessionpublic long getInactiveTime()
Session
getInactiveTime in interface Sessionpublic void addEncoder(Encoder encoder)
addEncoder in interface Sessionpublic void addMessageHandler(MessageHandler listener)
Session
addMessageHandler in interface Sessionpublic Set getMessageHandlers()
Session
getMessageHandlers in interface Sessionpublic void removeMessageHandler(MessageHandler listener)
Session
removeMessageHandler in interface Sessionpublic URI getRequestURI()
Session
getRequestURI in interface Session
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||