org.eclipse.jetty.nosql.mongodb
Class MongoSessionManager

java.lang.Object
  extended by org.eclipse.jetty.util.component.AbstractLifeCycle
      extended by org.eclipse.jetty.server.session.AbstractSessionManager
          extended by org.eclipse.jetty.nosql.NoSqlSessionManager
              extended by org.eclipse.jetty.nosql.mongodb.MongoSessionManager
All Implemented Interfaces:
SessionManager, LifeCycle

public class MongoSessionManager
extends NoSqlSessionManager


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jetty.server.session.AbstractSessionManager
AbstractSessionManager.SessionIf
 
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
static String __ACCESSED
           
static String __ID
           
static String __INVALIDATED
           
static String __VALID
           
static String __VERSION
           
 
Fields inherited from class org.eclipse.jetty.server.session.AbstractSessionManager
__defaultSessionTrackingModes, __distantFuture, _checkingRemoteSessionIdEncoding, _context, _dftMaxIdleSecs, _httpOnly, _loader, _maxCookieAge, _nodeIdInSessionId, _refreshCookieAge, _secureCookies, _sessionAttributeListeners, _sessionComment, _sessionCookie, _sessionDomain, _sessionHandler, _sessionIdManager, _sessionIdPathParameterName, _sessionIdPathParameterNamePrefix, _sessionListeners, _sessionPath, _sessionsStats, _sessionTimeStats, _sessionTrackingModes
 
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
Fields inherited from interface org.eclipse.jetty.server.SessionManager
__CheckRemoteSessionEncoding, __DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionIdPathParameterName, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionIdPathParameterNameProperty, __SessionPathProperty
 
Constructor Summary
MongoSessionManager()
           
 
Method Summary
protected  String decodeName(String name)
           
protected  Object decodeValue(Object value)
           
 void doStart()
           
protected  Object encodeName(ObjectOutputStream out, ByteArrayOutputStream bout, Object value)
           
protected  String encodeName(String name)
           
 long getSessionStoreCount()
          returns the total number of session objects in the session store the count() operation itself is optimized to perform on the server side and avoid loading to client side.
protected  void invalidateSession(String idInCluster)
           
protected  NoSqlSession loadSession(String clusterId)
           
 void purge()
           
 void purgeFully()
           
protected  Object refresh(NoSqlSession session, Object version)
           
protected  boolean remove(NoSqlSession session)
           
protected  Object save(NoSqlSession session, Object version, boolean activateAfterSave)
           
 void scavenge()
           
 void scavengeFully()
           
 void setSessionIdManager(SessionIdManager metaManager)
          Sets the cross context session id manager
 
Methods inherited from class org.eclipse.jetty.nosql.NoSqlSessionManager
addSession, getIdlePeriod, getSavePeriod, getSession, getStalePeriod, invalidateSessions, isInvalidateOnStop, isSaveAllAttributes, newSession, removeSession, setIdlePeriod, setInvalidateOnStop, setSaveAllAttributes, setSavePeriod, setStalePeriod
 
Methods inherited from class org.eclipse.jetty.server.session.AbstractSessionManager
access, addEventListener, addSession, clearEventListeners, complete, doSessionAttributeListeners, doStop, getClusterId, getContext, getContextHandler, getDefaultSessionTrackingModes, getEffectiveSessionTrackingModes, getHttpOnly, getHttpSession, getIdManager, getMaxInactiveInterval, getMaxSessions, getMetaManager, getMinSessions, getNodeId, getRefreshCookieAge, getSecureCookies, getSessionCookie, getSessionCookie, getSessionCookieConfig, getSessionDomain, getSessionHandler, getSessionIdManager, getSessionIdPathParameterName, getSessionIdPathParameterNamePrefix, getSessionMap, getSessions, getSessionsMax, getSessionsTotal, getSessionTimeMax, getSessionTimeMean, getSessionTimeStdDev, getSessionTimeTotal, isCheckingRemoteSessionIdEncoding, isNodeIdInSessionId, isUsingCookies, isUsingURLs, isValid, newHttpSession, removeEventListener, removeSession, removeSession, resetStats, setCheckingRemoteSessionIdEncoding, setHttpOnly, setIdManager, setMaxInactiveInterval, setNodeIdInSessionId, setRefreshCookieAge, setSessionCookie, setSessionHandler, setSessionIdPathParameterName, setSessionTrackingModes, setUsingCookies, statsReset
 
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jetty.server.SessionManager
access, addEventListener, clearEventListeners, complete, getClusterId, getDefaultSessionTrackingModes, getEffectiveSessionTrackingModes, getHttpOnly, getHttpSession, getMaxInactiveInterval, getMetaManager, getNodeId, getSessionCookie, getSessionCookieConfig, getSessionIdManager, getSessionIdPathParameterName, getSessionIdPathParameterNamePrefix, isCheckingRemoteSessionIdEncoding, isUsingCookies, isUsingURLs, isValid, newHttpSession, removeEventListener, setCheckingRemoteSessionIdEncoding, setMaxInactiveInterval, setSessionHandler, setSessionIdPathParameterName, setSessionTrackingModes
 
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 

Field Detail

__ID

public static final String __ID
See Also:
Constant Field Values

__VALID

public static final String __VALID
See Also:
Constant Field Values

__INVALIDATED

public static final String __INVALIDATED
See Also:
Constant Field Values

__ACCESSED

public static final String __ACCESSED
See Also:
Constant Field Values

__VERSION

public static final String __VERSION
See Also:
Constant Field Values
Constructor Detail

MongoSessionManager

public MongoSessionManager()
                    throws UnknownHostException,
                           com.mongodb.MongoException
Throws:
UnknownHostException
com.mongodb.MongoException
Method Detail

doStart

public void doStart()
             throws Exception
Overrides:
doStart in class NoSqlSessionManager
Throws:
Exception

setSessionIdManager

public void setSessionIdManager(SessionIdManager metaManager)
Description copied from interface: SessionManager
Sets the cross context session id manager

Specified by:
setSessionIdManager in interface SessionManager
Overrides:
setSessionIdManager in class AbstractSessionManager
Parameters:
metaManager - The metaManager used for cross context session management.
See Also:
SessionManager.getSessionIdManager()

save

protected Object save(NoSqlSession session,
                      Object version,
                      boolean activateAfterSave)
Specified by:
save in class NoSqlSessionManager

refresh

protected Object refresh(NoSqlSession session,
                         Object version)
Specified by:
refresh in class NoSqlSessionManager

loadSession

protected NoSqlSession loadSession(String clusterId)
Specified by:
loadSession in class NoSqlSessionManager

remove

protected boolean remove(NoSqlSession session)
Specified by:
remove in class NoSqlSessionManager

invalidateSession

protected void invalidateSession(String idInCluster)
Overrides:
invalidateSession in class NoSqlSessionManager

encodeName

protected String encodeName(String name)

decodeName

protected String decodeName(String name)

encodeName

protected Object encodeName(ObjectOutputStream out,
                            ByteArrayOutputStream bout,
                            Object value)
                     throws IOException
Throws:
IOException

decodeValue

protected Object decodeValue(Object value)
                      throws IOException,
                             ClassNotFoundException
Throws:
IOException
ClassNotFoundException

purge

public void purge()

purgeFully

public void purgeFully()

scavenge

public void scavenge()

scavengeFully

public void scavengeFully()

getSessionStoreCount

public long getSessionStoreCount()
returns the total number of session objects in the session store the count() operation itself is optimized to perform on the server side and avoid loading to client side.



Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.