| Modifier and Type | Method and Description |
|---|---|
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 |
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.
|
Map<String,String[]> |
getParameterMap()
Return the request parameters associated with the request this session
was opened under.
|
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() |
protected void |
updateLastConnectionActivity() |
public String getProtocolVersion()
getProtocolVersion in interface Session<T>public String getNegotiatedSubprotocol()
SessiongetNegotiatedSubprotocol in interface Session<T>public RemoteEndpoint getRemote()
Sessionpublic RemoteEndpoint<T> getRemoteL(Class<T> aClass)
SessiongetRemoteL in interface Session<T>aClass - the class of the RemoteEndpoint.public Long getId()
public boolean isActive()
Sessionpublic long getTimeout()
SessiongetTimeout in interface Session<T>public void close()
throws IOException
Sessionclose in interface Session<T>IOExceptionpublic void close(CloseReason closeReason) throws IOException
close in interface Session<T>closeReason - the reason for the closure.IOExceptionpublic void setTimeout(long seconds)
SessionsetTimeout in interface Session<T>seconds - the number of seconds.public void setMaximumMessageSize(long maximumMessageSize)
SessionsetMaximumMessageSize in interface Session<T>public long getMaximumMessageSize()
SessiongetMaximumMessageSize in interface Session<T>public List<Extension> getNegotiatedExtensions()
SessiongetNegotiatedExtensions in interface Session<T>public boolean isSecure()
Sessionpublic long getInactiveTime()
SessiongetInactiveTime in interface Session<T>public ClientContainer getContainer()
SessiongetContainer in interface Session<T>public void setEncoders(List<Encoder> encoders)
SessionsetEncoders in interface Session<T>encoders - the list of encoders.public void addMessageHandler(MessageHandler listener)
SessionaddMessageHandler in interface Session<T>public Set getMessageHandlers()
SessiongetMessageHandlers in interface Session<T>public void removeMessageHandler(MessageHandler listener)
SessionremoveMessageHandler in interface Session<T>listener - the handler to be removed.
public URI getRequestURI()
SessiongetRequestURI in interface Session<T>public Map<String,String[]> getParameterMap()
SessiongetParameterMap in interface Session<T>public String getQueryString()
SessiongetQueryString in interface Session<T>protected void updateLastConnectionActivity()
Copyright © 2012. All Rights Reserved.