|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.util.component.AbstractLifeCycle org.eclipse.jetty.server.session.AbstractSessionIdManager org.eclipse.jetty.server.session.JDBCSessionIdManager
public class JDBCSessionIdManager
JDBCSessionIdManager SessionIdManager implementation that uses a database to store in-use session ids, to support distributed sessions.
Nested Class Summary | |
---|---|
class |
JDBCSessionIdManager.DatabaseAdaptor
DatabaseAdaptor Handles differences between databases. |
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
AbstractLifeCycle.AbstractLifeCycleListener |
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle |
---|
LifeCycle.Listener |
Field Summary | |
---|---|
protected String |
_blobType
|
protected String |
_connectionUrl
|
protected String |
_createSessionIdTable
|
protected String |
_createSessionTable
|
protected DataSource |
_datasource
|
protected JDBCSessionIdManager.DatabaseAdaptor |
_dbAdaptor
|
protected String |
_deleteId
|
protected String |
_deleteOldExpiredSessions
|
protected String |
_driverClassName
|
protected String |
_insertId
|
protected String |
_jndiName
|
protected long |
_lastScavengeTime
|
protected String |
_queryId
|
protected long |
_scavengeIntervalMs
|
protected String |
_selectExpiredSessions
|
protected Server |
_server
|
protected HashSet<String> |
_sessionIds
|
protected String |
_sessionIdTable
|
protected String |
_sessionTable
|
protected String |
_sessionTableRowId
|
protected TimerTask |
_task
|
protected Timer |
_timer
|
Fields inherited from class org.eclipse.jetty.server.session.AbstractSessionIdManager |
---|
_random, _weakRandom, _workerName |
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
Constructor Summary | |
---|---|
JDBCSessionIdManager(Server server)
|
|
JDBCSessionIdManager(Server server,
Random random)
|
Method Summary | |
---|---|
void |
addSession(HttpSession session)
Add a session to the list of known sessions for a given ID. |
void |
doStart()
Start up the id manager. |
void |
doStop()
Stop the scavenger. |
String |
getBlobType()
|
String |
getClusterId(String nodeId)
Get the session id without any node identifier suffix. |
protected Connection |
getConnection()
Get a connection from the driver or datasource. |
String |
getConnectionUrl()
|
String |
getDatasourceName()
|
String |
getDriverClassName()
|
String |
getNodeId(String clusterId,
HttpServletRequest request)
Get the session id, including this node's id as a suffix. |
long |
getScavengeInterval()
|
boolean |
idInUse(String id)
|
void |
invalidateAll(String id)
Invalidate the session matching the id on all contexts. |
void |
removeSession(HttpSession session)
Remove session from the list of known sessions for a given ID. |
void |
removeSession(String id)
|
void |
setBlobType(String name)
|
void |
setDatasourceName(String jndi)
|
void |
setDriverInfo(String driverClassName,
String connectionUrl)
Configure jdbc connection information via a jdbc Driver |
void |
setScavengeInterval(long sec)
|
Methods inherited from class org.eclipse.jetty.server.session.AbstractSessionIdManager |
---|
getRandom, getWorkerName, initRandom, newSessionId, setRandom, setWorkerName |
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle |
---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Field Detail |
---|
protected final HashSet<String> _sessionIds
protected Server _server
protected String _driverClassName
protected String _connectionUrl
protected DataSource _datasource
protected String _jndiName
protected String _sessionIdTable
protected String _sessionTable
protected String _sessionTableRowId
protected Timer _timer
protected TimerTask _task
protected long _lastScavengeTime
protected long _scavengeIntervalMs
protected String _blobType
protected String _createSessionIdTable
protected String _createSessionTable
protected String _selectExpiredSessions
protected String _deleteOldExpiredSessions
protected String _insertId
protected String _deleteId
protected String _queryId
protected JDBCSessionIdManager.DatabaseAdaptor _dbAdaptor
Constructor Detail |
---|
public JDBCSessionIdManager(Server server)
public JDBCSessionIdManager(Server server, Random random)
Method Detail |
---|
public void setDriverInfo(String driverClassName, String connectionUrl)
driverClassName
- connectionUrl
- public String getDriverClassName()
public String getConnectionUrl()
public void setDatasourceName(String jndi)
public String getDatasourceName()
public void setBlobType(String name)
public String getBlobType()
public void setScavengeInterval(long sec)
public long getScavengeInterval()
public void addSession(HttpSession session)
SessionIdManager
session
- The sessionpublic void removeSession(HttpSession session)
SessionIdManager
public void removeSession(String id)
public String getClusterId(String nodeId)
SessionIdManager.getClusterId(java.lang.String)
public String getNodeId(String clusterId, HttpServletRequest request)
clusterId
- The ID of the sessionrequest
- The request that for the session (or null)
SessionIdManager.getNodeId(java.lang.String, javax.servlet.http.HttpServletRequest)
public boolean idInUse(String id)
id
- The session ID without any cluster node extension
public void invalidateAll(String id)
id
- The session ID without any cluster node extensionSessionIdManager.invalidateAll(java.lang.String)
public void doStart()
doStart
in class AbstractSessionIdManager
public void doStop() throws Exception
doStop
in class AbstractSessionIdManager
Exception
protected Connection getConnection() throws SQLException
SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |