public class Session extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTR_SESSION |
| Modifier | Constructor and Description |
|---|---|
protected |
Session(javax.servlet.ServletContext servletContext,
org.springframework.web.socket.WebSocketSession socket)
Create a session, with references to its servlet context and web socket.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
_init(String pageId)
Initialize the session.
|
boolean |
addSessionListener(ISessionListener listener)
Register a session listener.
|
protected void |
destroy()
Destroy the session.
|
long |
getCreationTime()
Returns the session's time of creation.
|
String |
getId()
Returns the session's id, which is the same as the underlying web socket id.
|
long |
getLastActivity()
Returns the time of last activity for the session.
|
Page |
getPage()
Returns the page associated with the session.
|
javax.servlet.ServletContext |
getServletContext()
Returns the servlet context associated with the session.
|
org.springframework.web.socket.WebSocketSession |
getSocket()
Returns the web socket associated with the session.
|
Synchronizer |
getSynchronizer()
Returns the synchronizer associated with the session.
|
protected void |
notifySessionListeners(ClientInvocation invocation)
Notify all session listeners of a client invocation event.
|
protected void |
notifySessionListeners(ClientRequest request)
Notify all session listeners of a client request event.
|
void |
ping(String data)
Send a ping to the client.
|
boolean |
removeSessionListener(ISessionListener listener)
Unregister a session listener.
|
void |
updateLastActivity()
Updates the session's last activity.
|
public static final String ATTR_SESSION
protected Session(javax.servlet.ServletContext servletContext,
org.springframework.web.socket.WebSocketSession socket)
servletContext - The servlet context.socket - The web socket.protected void destroy()
public String getId()
public long getCreationTime()
public long getLastActivity()
public void updateLastActivity()
public javax.servlet.ServletContext getServletContext()
public org.springframework.web.socket.WebSocketSession getSocket()
public Synchronizer getSynchronizer()
public Page getPage()
public boolean addSessionListener(ISessionListener listener)
listener - Session listener to register.public boolean removeSessionListener(ISessionListener listener)
listener - Session listener to unregister.protected void notifySessionListeners(ClientRequest request)
request - The client request.protected void notifySessionListeners(ClientInvocation invocation)
invocation - The client invocation.public void ping(String data)
data - Data to send with the ping.protected boolean _init(String pageId)
pageId - The page id.Copyright © 2017 Regenstrief Center for Biomedical Informatics. All rights reserved.