|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.tyrus.SessionImpl<T>
public class SessionImpl<T>
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[]> |
getParameterMap()
Return the request parameters associated with the request this session was opened under. |
Map<String,String> |
getPathParameters()
|
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. |
RemoteEndpoint<T> |
getRemoteL(Class<T> aClass)
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. |
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 |
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 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 Session<T>public String getNegotiatedSubprotocol()
Session
getNegotiatedSubprotocol in interface Session<T>public RemoteEndpoint getRemote()
Session
getRemote in interface Session<T>public RemoteEndpoint<T> getRemoteL(Class<T> aClass)
Session
getRemoteL in interface Session<T>aClass - the class of the RemoteEndpoint.
public boolean isActive()
Session
isActive in interface Session<T>public long getTimeout()
Session
getTimeout in interface Session<T>
public void close()
throws IOException
Session
close in interface Session<T>IOException
public void close(CloseReason closeReason)
throws IOException
close in interface Session<T>closeReason - the reason for the closure.
IOExceptionpublic String toString()
toString in class Objectpublic void setTimeout(long seconds)
Session
setTimeout in interface Session<T>seconds - the number of seconds.public void setMaximumMessageSize(long maximumMessageSize)
Session
setMaximumMessageSize in interface Session<T>public long getMaximumMessageSize()
Session
getMaximumMessageSize in interface Session<T>public List<String> getNegotiatedExtensions()
Session
getNegotiatedExtensions in interface Session<T>public boolean isSecure()
Session
isSecure in interface Session<T>public long getInactiveTime()
Session
getInactiveTime in interface Session<T>public ClientContainer getContainer()
Session
getContainer in interface Session<T>public void setEncoders(List<Encoder> encoders)
Session
setEncoders in interface Session<T>encoders - the list of encoders.public void addMessageHandler(MessageHandler listener)
Session
addMessageHandler in interface Session<T>public Set<MessageHandler> getMessageHandlers()
Session
getMessageHandlers in interface Session<T>public void removeMessageHandler(MessageHandler listener)
Session
removeMessageHandler in interface Session<T>listener - the handler to be removed.
public URI getRequestURI()
Session
getRequestURI in interface Session<T>public Map<String,String[]> getParameterMap()
Session
getParameterMap in interface Session<T>public Map<String,String> getPathParameters()
public String getQueryString()
Session
getQueryString in interface Session<T>public Map<String,Object> getProperties()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||