connectionName
protected String connectionName
The connection username to use when trying to connect to the database.
connectionPassword
protected String connectionPassword
The connection URL to use when trying to connect to the database.
connectionURL
protected String connectionURL
Connection string to use when connecting to the DB.
driver
protected Driver driver
Instance of the JDBC Driver class we use as a connection factory.
driverName
protected String driverName
Driver to use.
info
protected static String info
The descriptive information about this implementation.
preparedClearSql
protected PreparedStatement preparedClearSql
Variable to hold the clear()
prepared statement.
preparedKeysSql
protected PreparedStatement preparedKeysSql
Variable to hold the keys()
prepared statement.
preparedLoadSql
protected PreparedStatement preparedLoadSql
Variable to hold the load()
prepared statement.
preparedRemoveSql
protected PreparedStatement preparedRemoveSql
Variable to hold the remove()
prepared statement.
preparedSaveSql
protected PreparedStatement preparedSaveSql
Variable to hold the save()
prepared statement.
preparedSizeSql
protected PreparedStatement preparedSizeSql
Variable to hold the getSize()
prepared statement.
sessionAppCol
protected String sessionAppCol
Column to use for /Engine/Host/Context name
sessionDataCol
protected String sessionDataCol
Data column to use.
sessionIdCol
protected String sessionIdCol
Id column to use.
sessionLastAccessedCol
protected String sessionLastAccessedCol
Last Accessed column to use.
sessionMaxInactiveCol
protected String sessionMaxInactiveCol
Max Inactive column to use.
sessionTable
protected String sessionTable
Table to use.
sessionValidCol
protected String sessionValidCol
Is Valid column to use.
storeName
protected static String storeName
Name to register for this Store, used for logging.
threadName
protected String threadName
Name to register for the background thread.
clear
public void clear()
throws IOException
Remove all of the Sessions in this Store.
- clear in interface Store
close
protected void close(Connection dbConnection)
Close the specified database connection.
dbConnection
- The connection to be closed
getConnection
protected Connection getConnection()
Check the connection associated with this store, if it's
null
or closed try to reopen it.
Returns null
if the connection could not be established.
Connection
if the connection suceeded
getConnectionName
public String getConnectionName()
Return the username to use to connect to the database.
getConnectionPassword
public String getConnectionPassword()
Return the password to use to connect to the database.
getConnectionURL
public String getConnectionURL()
Return the Connection URL for this Store.
getDriverName
public String getDriverName()
Return the driver for this Store.
getInfo
public String getInfo()
Return the info for this Store.
- getInfo in interface Store
- getInfo in interface StoreBase
getName
public String getName()
Return the name for this instance (built from container name)
getSessionAppCol
public String getSessionAppCol()
Return the web application name column for the table.
getSessionDataCol
public String getSessionDataCol()
Return the data column for the table
getSessionIdCol
public String getSessionIdCol()
Return the Id column for the table.
getSessionLastAccessedCol
public String getSessionLastAccessedCol()
Return the Last Accessed column
getSessionMaxInactiveCol
public String getSessionMaxInactiveCol()
Return the Max Inactive column
getSessionTable
public String getSessionTable()
Return the table for this Store.
getSessionValidCol
public String getSessionValidCol()
Return the Is Valid column
getSize
public int getSize()
throws IOException
Return an integer containing a count of all Sessions
currently saved in this Store. If there are no Sessions,
0
is returned.
- getSize in interface Store
getStoreName
public String getStoreName()
Return the name for this Store, used for logging.
- getStoreName in interface StoreBase
getThreadName
public String getThreadName()
Return the thread name for this Store.
keys
public String[] keys()
throws IOException
Return 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.
- keys in interface Store
load
public Session load(String id)
throws ClassNotFoundException,
IOException
Load the Session associated with the id id
.
If no such session is found null
is returned.
- load in interface Store
id
- a value of type String
- the stored
Session
open
protected Connection open()
throws SQLException
Open (if necessary) and return a database connection for use by
this Realm.
release
protected void release(Connection conn)
Release the connection, not needed here since the
connection is not associated with a connection pool.
conn
- The connection to be released
remove
public void remove(String id)
throws IOException
Remove the Session with the specified session identifier from
this Store, if present. If no such Session is present, this method
takes no action.
- remove in interface Store
id
- Session identifier of the Session to be removed
save
public void save(Session session)
throws IOException
Save a session to the Store.
- save in interface Store
session
- the session to be stored
setConnectionName
public void setConnectionName(String connectionName)
Set the username to use to connect to the database.
connectionName
- Username
setConnectionPassword
public void setConnectionPassword(String connectionPassword)
Set the password to use to connect to the database.
connectionPassword
- User password
setConnectionURL
public void setConnectionURL(String connectionURL)
Set the Connection URL for this Store.
connectionURL
- The new Connection URL
setDriverName
public void setDriverName(String driverName)
Set the driver for this Store.
driverName
- The new driver
setSessionAppCol
public void setSessionAppCol(String sessionAppCol)
Set the App column for the table.
sessionAppCol
- the column name
setSessionDataCol
public void setSessionDataCol(String sessionDataCol)
Set the Data column for the table
sessionDataCol
- the column name
setSessionIdCol
public void setSessionIdCol(String sessionIdCol)
Set the Id column for the table.
sessionIdCol
- the column name
setSessionLastAccessedCol
public void setSessionLastAccessedCol(String sessionLastAccessedCol)
Set the Last Accessed column for the table
sessionLastAccessedCol
- The column name
setSessionMaxInactiveCol
public void setSessionMaxInactiveCol(String sessionMaxInactiveCol)
Set the Max Inactive column for the table
sessionMaxInactiveCol
- The column name
setSessionTable
public void setSessionTable(String sessionTable)
Set the table for this Store.
sessionTable
- The new table
setSessionValidCol
public void setSessionValidCol(String sessionValidCol)
Set the Is Valid column for the table
sessionValidCol
- The column name