org.locomotive.loco.store.session
Class SessionStoreJdbcMysql

java.lang.Object
  |
  +--org.locomotive.loco.store.session.SessionStore
        |
        +--org.locomotive.loco.store.session.SessionStoreJdbc
              |
              +--org.locomotive.loco.store.session.SessionStoreJdbcMysql

public class SessionStoreJdbcMysql
extends SessionStoreJdbc


Constructor Summary
SessionStoreJdbcMysql()
           
 
Method Summary
 void associateUser(java.sql.Connection conn, User user, long sid)
          associate a user with this session, persistantly.
 long createNewSession(java.sql.Connection conn, int srid, int userid, java.sql.Timestamp expire)
          Saves a new Session and returns its sid
 void expire(java.sql.Connection conn, long sid, java.sql.Timestamp expireTime)
          expires this session, in the database returns false if the operation failed
 void resetExpiration(java.sql.Connection conn, long sid, java.sql.Timestamp expireTime)
          Advances the expiration time of the session by exp_seconds if the session is persistant, the new time will be committed to the session database
 void storeObjects(java.sql.Connection conn, long sid, java.util.Hashtable objects)
          Stores the session_objects table in the database.
 void storeSessionObjects(java.sql.Connection conn, java.util.Hashtable objects)
          Saves a new Session and returns its sid
 
Methods inherited from class org.locomotive.loco.store.session.SessionStoreJdbc
getLocoSessionRow, getNextSessionId, getSessionObjects, removeObjects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionStoreJdbcMysql

public SessionStoreJdbcMysql()
Method Detail

associateUser

public void associateUser(java.sql.Connection conn,
                          User user,
                          long sid)
                   throws FailedSessionException
Description copied from class: SessionStore
associate a user with this session, persistantly. Authentication should be handled externally
Overrides:
associateUser in class SessionStoreJdbc
Tags copied from class: SessionStore
Parameters:
conn - a JDBC connection with access to the Loco tables
user - the user to be associated
sid - the session id
Throws:
FailedSessionException - if there is a database storage problem

expire

public void expire(java.sql.Connection conn,
                   long sid,
                   java.sql.Timestamp expireTime)
            throws FailedSessionException
Description copied from class: SessionStore
expires this session, in the database returns false if the operation failed
Overrides:
expire in class SessionStoreJdbc
Tags copied from class: SessionStore
Parameters:
conn - a JDBC connection with access to the Loco session tables
sid - the session id
expireTime - The timestamp
Throws:
FailedSessionException - if the session cannot be marked in the database

resetExpiration

public void resetExpiration(java.sql.Connection conn,
                            long sid,
                            java.sql.Timestamp expireTime)
                     throws FailedSessionException
Description copied from class: SessionStore
Advances the expiration time of the session by exp_seconds if the session is persistant, the new time will be committed to the session database
Overrides:
resetExpiration in class SessionStoreJdbc
Tags copied from class: SessionStore
Parameters:
conn - a JDBC connection with access to the Loco session tables
sid - the session id
expireTime - The timestamp
Throws:
FailedSessionException - if there is a database error

storeObjects

public void storeObjects(java.sql.Connection conn,
                         long sid,
                         java.util.Hashtable objects)
                  throws java.sql.SQLException
Description copied from class: SessionStore
Stores the session_objects table in the database. Should be called to store the session's resources after the session has been used for a request, if caching is not being used.
Overrides:
storeObjects in class SessionStoreJdbc
Tags copied from class: SessionStore
Parameters:
conn - a JDBC connection with access to the Loco session tables
sid - the session id
objects - the hashtable of objects to be saved

createNewSession

public long createNewSession(java.sql.Connection conn,
                             int srid,
                             int userid,
                             java.sql.Timestamp expire)
                      throws FailedSessionException
Description copied from class: SessionStore
Saves a new Session and returns its sid
Overrides:
createNewSession in class SessionStoreJdbc
Tags copied from class: SessionStore
Parameters:
conn - a JDBC connection with access to the Loco session tables
srid - the random number for cookie checks
userid - the user
expire - the timestamp
Throws:
FailedSessionException - if there is a database error or the session cannot be found

storeSessionObjects

public void storeSessionObjects(java.sql.Connection conn,
                                java.util.Hashtable objects)
Description copied from class: SessionStore
Saves a new Session and returns its sid
Overrides:
storeSessionObjects in class SessionStoreJdbc
Tags copied from class: SessionStore
Parameters:
conn - a JDBC connection with access to the Loco session tables
sid - the session id
objects - the hashtable of objects to be saved
Throws:
FailedSessionException - if there is a database error or the session cannot be found