Package org.apache.catalina.session
Class DataSourceStore
- java.lang.Object
-
- org.apache.catalina.util.LifecycleBase
-
- org.apache.catalina.session.StoreBase
-
- org.apache.catalina.session.JDBCStore
-
- org.apache.catalina.session.DataSourceStore
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle
Lifecycle.SingleUse
-
-
Field Summary
-
Fields inherited from class org.apache.catalina.session.JDBCStore
connectionName, connectionPassword, connectionURL, dataSource, dataSourceName, driver, driverName, preparedClearSql, preparedLoadSql, preparedRemoveSql, preparedSaveSql, preparedSizeSql, sessionAppCol, sessionDataCol, sessionIdCol, sessionLastAccessedCol, sessionMaxInactiveCol, sessionTable, sessionValidCol, storeName, threadName
-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
-
-
Constructor Summary
Constructors Constructor Description DataSourceStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Remove all of the Sessions in this Store.protected voidclose(java.sql.Connection dbConnection)Close the specified database connection.java.lang.String[]expiredKeys()Get only those keys of sessions, that are saved in the Store and are to be expired.intgetSize()Return an integer containing a count of all Sessions currently saved in this Store.java.lang.String[]keys()Sessionload(java.lang.String id)Load the Session associated with the idid.protected java.sql.Connectionopen()Open (if necessary) and return a database connection for use by this Store.voidremove(java.lang.String id)Remove the Session with the specified session identifier from this Store, if present.voidsave(Session session)Save a session to the Store.-
Methods inherited from class org.apache.catalina.session.JDBCStore
getConnection, getConnectionName, getConnectionPassword, getConnectionURL, getDataSourceName, getDriverName, getLocalDataSource, getName, getSessionAppCol, getSessionDataCol, getSessionIdCol, getSessionLastAccessedCol, getSessionMaxInactiveCol, getSessionTable, getSessionValidCol, getStoreName, getThreadName, release, setConnectionName, setConnectionPassword, setConnectionURL, setDataSourceName, setDriverName, setLocalDataSource, setSessionAppCol, setSessionDataCol, setSessionIdCol, setSessionLastAccessedCol, setSessionMaxInactiveCol, setSessionTable, setSessionValidCol, startInternal, stopInternal
-
Methods inherited from class org.apache.catalina.session.StoreBase
addPropertyChangeListener, destroyInternal, getManager, getObjectInputStream, initInternal, processExpires, removePropertyChangeListener, setManager, toString
-
Methods inherited from class org.apache.catalina.util.LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
-
-
-
-
Method Detail
-
expiredKeys
public java.lang.String[] expiredKeys() throws java.io.IOExceptionDescription copied from class:StoreBaseGet only those keys of sessions, that are saved in the Store and are to be expired.- Overrides:
expiredKeysin classJDBCStore- Returns:
- list of session keys, that are to be expired
- Throws:
java.io.IOException- if an input-/output error occurred
-
keys
public java.lang.String[] keys() throws java.io.IOException- Specified by:
keysin interfaceStore- Overrides:
keysin classJDBCStore- Returns:
- an array containing the session identifiers of all Sessions currently saved in this Store. If there are no such Sessions, a zero-length array is returned.
- Throws:
java.io.IOException- if an input/output error occurred
-
getSize
public int getSize() throws java.io.IOExceptionReturn an integer containing a count of all Sessions currently saved in this Store. If there are no Sessions,0is returned.
-
load
public Session load(java.lang.String id) throws java.lang.ClassNotFoundException, java.io.IOException
Load the Session associated with the idid. If no such session is foundnullis returned.
-
remove
public void remove(java.lang.String id) throws java.io.IOExceptionRemove the Session with the specified session identifier from this Store, if present. If no such Session is present, this method takes no action.
-
clear
public void clear() throws java.io.IOExceptionRemove all of the Sessions in this Store.
-
save
public void save(Session session) throws java.io.IOException
Save a session to the Store.
-
open
protected java.sql.Connection open() throws java.sql.SQLExceptionOpen (if necessary) and return a database connection for use by this Store.
-
-