Package helma.framework.core
Class SessionManager
java.lang.Object
helma.framework.core.SessionManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected long
cleanupSessions
(long lastSessionCleanup) Purge sessions that have not been used for a certain amount of time.int
Returns the number of currenty active sessions.createSession
(String sessionId) void
discardSession
(Session session) Remove the session from the sessions-table and logout the user.Return a list of Helma nodes (HopObjects - the database object representing the user, not the session object) representing currently logged in users.getSession
(String sessionId) Return the whole session map.getSessionsForUsername
(String username) Return an array ofSessionBean
objects currently associated with a given Helma user.void
init
(Application app) void
loadSessionData
(File f, ScriptingEngine engine) loads the serialized session table from a given file or from dbdir/sessionsvoid
registerSession
(Session session) void
shutdown()
void
storeSessionData
(File f, ScriptingEngine engine) Dump session state to a file.
-
Field Details
-
sessions
-
app
-
-
Constructor Details
-
SessionManager
public SessionManager()
-
-
Method Details
-
init
-
shutdown
public void shutdown() -
createSession
-
getSession
-
registerSession
-
getSessions
Return the whole session map. We return a clone of the table to prevent actual changes from the table itself, which is managed by the application. It is safe and allowed to manipulate the session objects contained in the table, though. -
countSessions
public int countSessions()Returns the number of currenty active sessions. -
discardSession
Remove the session from the sessions-table and logout the user. -
getSessionsForUsername
Return an array ofSessionBean
objects currently associated with a given Helma user. -
getActiveUsers
Return a list of Helma nodes (HopObjects - the database object representing the user, not the session object) representing currently logged in users. -
storeSessionData
Dump session state to a file.- Parameters:
f
- the file to write session into, or null to use the default sesssion store.
-
loadSessionData
loads the serialized session table from a given file or from dbdir/sessions -
cleanupSessions
protected long cleanupSessions(long lastSessionCleanup) Purge sessions that have not been used for a certain amount of time. This is called by run().- Parameters:
lastSessionCleanup
- the last time sessions were purged- Returns:
- the updated lastSessionCleanup value
-