public class MongoSessionService extends AbstractSessionService implements LifecycleListener
SessionData.| Modifier and Type | Field and Description |
|---|---|
static String |
FIELD_DATA |
static String |
FIELD_END_TIME |
static String |
FIELD_ID |
static String |
FIELD_START_TIME |
| Constructor and Description |
|---|
MongoSessionService(com.mongodb.DB db,
String collection)
Construct an instance providing the DB and collection name to use
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
clear()
Clears all recorded data
|
protected SessionData |
findSessionData(String sessionId)
Find session data for the given ID
|
long |
getActiveSessionsCount()
Returns a number of active sessions, i.e.
|
long |
getAllSessionsCount()
Returns a number of sessions, active or otherwise
|
long |
getCompletedSessionsCount()
Returns a number of completed sessions, i.e.
|
protected String |
newSession(SessionData sessionData)
Persist session data.
|
void |
start() |
void |
stop() |
protected boolean |
updateSessionData(String sessionId,
com.mongodb.DBObject data)
Update session's client-provided data matching the ID.
|
protected void |
updateSessionEndTime(String sessionId,
long endTime)
Update session end time.
|
endSession, getSessionData, getSessionElapsedTime, getSessionEndTime, getSessionStartTime, setSessionData, startSessionpublic static final String FIELD_ID
public static final String FIELD_DATA
public static final String FIELD_START_TIME
public static final String FIELD_END_TIME
public MongoSessionService(com.mongodb.DB db,
String collection)
public void start()
start in interface LifecycleListenerpublic void stop()
stop in interface LifecycleListenerprotected String newSession(SessionData sessionData)
AbstractSessionServicenewSession in class AbstractSessionServiceprotected SessionData findSessionData(String sessionId)
AbstractSessionServicefindSessionData in class AbstractSessionServiceprotected void updateSessionEndTime(String sessionId, long endTime)
AbstractSessionServiceupdateSessionEndTime in class AbstractSessionServiceprotected boolean updateSessionData(String sessionId, com.mongodb.DBObject data)
AbstractSessionServiceupdateSessionData in class AbstractSessionServicepublic long getActiveSessionsCount()
SessionServicegetActiveSessionsCount in interface SessionServicepublic long getCompletedSessionsCount()
SessionServicegetCompletedSessionsCount in interface SessionServicepublic long getAllSessionsCount()
SessionServicegetAllSessionsCount in interface SessionServicepublic boolean clear()
SessionServiceclear in interface SessionServiceCopyright © 2005–2018 Alfresco Software. All rights reserved.