public class JDBCSessionManager extends AbstractSessionManager
| Modifier and Type | Class and Description |
|---|---|
class |
JDBCSessionManager.Session
Session
Session instance.
|
AbstractSessionManager.CookieConfig, AbstractSessionManager.SessionIfAbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.ListenerContainer.InheritedListener, Container.Listener| Modifier and Type | Field and Description |
|---|---|
protected JDBCSessionIdManager |
_jdbcSessionIdMgr |
protected long |
_saveIntervalSec |
protected JDBCSessionIdManager.SessionTableSchema |
_sessionTableSchema |
__defaultSessionTrackingModes, __distantFuture, _checkingRemoteSessionIdEncoding, _context, _dftMaxIdleSecs, _httpOnly, _loader, _maxCookieAge, _nodeIdInSessionId, _refreshCookieAge, _secureCookies, _secureRequestOnly, _sessionAttributeListeners, _sessionComment, _sessionCookie, _sessionDomain, _sessionHandler, _sessionIdListeners, _sessionIdManager, _sessionIdPathParameterName, _sessionIdPathParameterNamePrefix, _sessionListeners, _sessionPath, _sessionsStats, _sessionTimeStats, _sessionTrackingModesFAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING__CheckRemoteSessionEncoding, __DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionIdPathParameterName, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionIdPathParameterNameProperty, __SessionPathProperty| Constructor and Description |
|---|
JDBCSessionManager() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addSession(AbstractSession session)
Add a newly created session to our in-memory list for this node and persist it.
|
void |
cacheInvalidate(JDBCSessionManager.Session session)
A method that can be implemented in subclasses to support
distributed caching of sessions.
|
protected void |
deleteSession(JDBCSessionManager.Session data)
Delete a session from the database.
|
void |
doStart()
Start the session manager.
|
void |
doStop()
Stop the session manager.
|
protected Set<String> |
expire(Set<String> sessionIds)
Expire any Sessions we have in memory matching the list of
expired Session ids.
|
long |
getSaveInterval() |
JDBCSessionManager.Session |
getSession(String idInCluster)
A session has been requested by its id on this node.
|
int |
getSessions()
Get the number of sessions.
|
protected void |
invalidateSession(String idInCluster)
Invalidate a session.
|
protected JDBCSessionManager.Session |
loadSession(String id,
String canonicalContextPath,
String vhost)
Load a session from the database
|
protected AbstractSession |
newSession(HttpServletRequest request)
Make a new Session.
|
protected AbstractSession |
newSession(String sessionId,
String rowId,
long created,
long accessed,
long maxInterval) |
boolean |
removeSession(AbstractSession session,
boolean invalidate)
Remove session from manager
|
protected boolean |
removeSession(String idInCluster)
Delete an existing session, both from the in-memory map and
the database.
|
void |
renewSessionId(String oldClusterId,
String oldNodeId,
String newClusterId,
String newNodeId)
Tell the HttpSessionIdListeners the id changed.
|
void |
setSaveInterval(long sec)
Set the time in seconds which is the interval between
saving the session access time to the database.
|
protected void |
shutdownSessions()
Prepare sessions for session manager shutdown
|
protected void |
storeSession(JDBCSessionManager.Session session)
Insert a session into the database.
|
protected void |
updateSession(JDBCSessionManager.Session data)
Update data on an existing persisted session.
|
protected void |
updateSessionNode(JDBCSessionManager.Session data)
Update the node on which the session was last seen to be my node.
|
access, addEventListener, addSession, clearEventListeners, complete, doSessionAttributeListeners, getClusterId, getContext, getContextHandler, getDefaultSessionTrackingModes, getEffectiveSessionTrackingModes, getHttpOnly, getHttpSession, getMaxCookieAge, getMaxInactiveInterval, getMetaManager, getNodeId, getRefreshCookieAge, getSecureCookies, getSessionCookie, getSessionCookie, getSessionCookieConfig, getSessionDomain, getSessionHandler, getSessionIdManager, getSessionIdPathParameterName, getSessionIdPathParameterNamePrefix, getSessionPath, getSessionsMax, getSessionsTotal, getSessionTimeMax, getSessionTimeMean, getSessionTimeStdDev, getSessionTimeTotal, isCheckingRemoteSessionIdEncoding, isNodeIdInSessionId, isSecureRequestOnly, isUsingCookies, isUsingURLs, isValid, newHttpSession, removeEventListener, removeSession, setCheckingRemoteSessionIdEncoding, setHttpOnly, setMaxInactiveInterval, setNodeIdInSessionId, setRefreshCookieAge, setSecureRequestOnly, setSessionCookie, setSessionHandler, setSessionIdManager, setSessionIdPathParameterName, setSessionTrackingModes, setUsingCookies, statsResetaddBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopprotected JDBCSessionIdManager _jdbcSessionIdMgr
protected long _saveIntervalSec
protected JDBCSessionIdManager.SessionTableSchema _sessionTableSchema
public void setSaveInterval(long sec)
sec - public long getSaveInterval()
public void cacheInvalidate(JDBCSessionManager.Session session)
session - public JDBCSessionManager.Session getSession(String idInCluster)
getSession in class AbstractSessionManageridInCluster - The session ID in the cluster, stripped of any worker name.AbstractSessionManager.getSession(java.lang.String)public int getSessions()
getSessions in class AbstractSessionManagerAbstractSessionManager.getSessions()public void doStart()
throws Exception
doStart in class AbstractSessionManagerExceptionAbstractSessionManager.doStart()public void doStop()
throws Exception
doStop in class AbstractSessionManagerExceptionAbstractSessionManager.doStop()protected void shutdownSessions()
AbstractSessionManagershutdownSessions in class AbstractSessionManagerpublic void renewSessionId(String oldClusterId, String oldNodeId, String newClusterId, String newNodeId)
AbstractSessionManagerrenewSessionId in interface SessionManagerrenewSessionId in class AbstractSessionManagerSessionManager.renewSessionId(java.lang.String, java.lang.String, java.lang.String, java.lang.String)protected void invalidateSession(String idInCluster)
idInCluster - protected boolean removeSession(String idInCluster)
removeSession in class AbstractSessionManagerAbstractSessionManager.removeSession(java.lang.String)protected void addSession(AbstractSession session)
addSession in class AbstractSessionManagerAbstractSessionManager.addSession(org.eclipse.jetty.server.session.AbstractSession)protected AbstractSession newSession(HttpServletRequest request)
newSession in class AbstractSessionManagerAbstractSessionManager.newSession(javax.servlet.http.HttpServletRequest)protected AbstractSession newSession(String sessionId, String rowId, long created, long accessed, long maxInterval)
sessionId - rowId - created - accessed - maxInterval - public boolean removeSession(AbstractSession session, boolean invalidate)
removeSession in class AbstractSessionManagersession - The session to removeinvalidate - True if HttpSessionListener#sessionDestroyed(HttpSessionEvent) and
SessionIdManager#invalidateAll(String) should be called.protected Set<String> expire(Set<String> sessionIds)
sessionIds - protected JDBCSessionManager.Session loadSession(String id, String canonicalContextPath, String vhost) throws Exception
id - Exceptionprotected void storeSession(JDBCSessionManager.Session session) throws Exception
session - Exceptionprotected void updateSession(JDBCSessionManager.Session data) throws Exception
data - the sessionExceptionprotected void updateSessionNode(JDBCSessionManager.Session data) throws Exception
data - the sessionExceptionprotected void deleteSession(JDBCSessionManager.Session data) throws Exception
data - ExceptionCopyright © 1995-2015 Webtide. All Rights Reserved.