Top Description Fields Constructors Methods
org.eclipse.jetty.session

public Class NullSessionDataStore

extends AbstractSessionDataStore
Class Inheritance
Annotations
@ManagedObject
Imports
java.util.Collections, .Set, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedObject

NullSessionDataStore Does not actually store anything, useful for testing.

Field Summary

Inherited from org.eclipse.jetty.session.AbstractSessionDataStore:
_context_gracePeriodSec_lastExpiryCheckTime_lastOrphanSweepTime_savePeriodSecDEFAULT_GRACE_PERIOD_SECDEFAULT_SAVE_PERIOD_SEC

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
delete(String
identity of session to delete
id
)

Implements org.eclipse.jetty.session.SessionDataMap.delete.

Delete session data

public Set<String>
doCheckExpired(Set<String>
the ids of sessions the SessionCache thinks has expired
candidates
,
long
the time at which to check for expiry
time
)

Implements abstract org.eclipse.jetty.session.AbstractSessionDataStore.doCheckExpired.

Implemented by subclasses to resolve which sessions in this context that are being managed by this node that should be expired.

public void
doCleanOrphans(long
the upper limit of the expiry time to check in msec
timeLimit
)

Implements abstract org.eclipse.jetty.session.AbstractSessionDataStore.doCleanOrphans.

Implemented by subclasses to delete sessions for other contexts that expired at or before the timeLimit.

public boolean
doExists(String
the session id to check
id
)

Implements abstract org.eclipse.jetty.session.AbstractSessionDataStore.doExists.

Check if a session for the given id exists.

public Set<String>
doGetExpired(long
the upper limit of expiry times to check. Sessions expired at or before this timestamp will match.
timeLimit
)

Implements abstract org.eclipse.jetty.session.AbstractSessionDataStore.doGetExpired.

Implemented by subclasses to find sessions for this context in the store that expired at or before the time limit and thus not being actively managed by any node.

public SessionData
doLoad(String
the id of the session to load
id
)

Implements abstract org.eclipse.jetty.session.AbstractSessionDataStore.doLoad.

Load the session from persistent store.

public void
doStore(String
identity of session to store
id
,
SessionData
info of the session
data
,
long
time of previous save or 0 if never saved
lastSaveTime
)

Implements abstract org.eclipse.jetty.session.AbstractSessionDataStore.doStore.

Store the session data persistently.

public boolean
isPassivating()

Implements org.eclipse.jetty.session.SessionDataStore.isPassivating.

True if this type of datastore will passivate session objects

public SessionData
newSessionData(String
the id
id
,
long
the timestamp when created
created
,
long
the timestamp when accessed
accessed
,
long
the timestamp when last accessed
lastAccessed
,
long
the max inactive time in milliseconds
maxInactiveMs
)

Overrides org.eclipse.jetty.session.AbstractSessionDataStore.newSessionData.

Implements org.eclipse.jetty.session.SessionDataStore.newSessionData.

Create a new SessionData

Inherited from org.eclipse.jetty.session.AbstractSessionDataStore:
checkStartedcleanOrphansdoStartexistsgetExpiredgetGracePeriodSecgetSavePeriodSecinitializeloadsetGracePeriodSecsetSavePeriodSecstoretoString

Constructor Detail

NullSessionDataStoreback to summary
public NullSessionDataStore()

Method Detail

deleteback to summary
public boolean delete(String id) throws Exception

Implements org.eclipse.jetty.session.SessionDataMap.delete.

Doc from org.eclipse.jetty.session.SessionDataMap.delete.

Delete session data

Parameters
id:String

identity of session to delete

Returns:boolean

true if the session was deleted

Annotations
@Override
Exceptions
Exception:
if unable to delete session data
doCheckExpiredback to summary
public Set<String> doCheckExpired(Set<String> candidates, long time)

Implements abstract org.eclipse.jetty.session.AbstractSessionDataStore.doCheckExpired.

Doc from org.eclipse.jetty.session.AbstractSessionDataStore.doCheckExpired.

Implemented by subclasses to resolve which sessions in this context that are being managed by this node that should be expired.

Parameters
candidates:Set<String>

the ids of sessions the SessionCache thinks has expired

time:long

the time at which to check for expiry

Returns:Set<String>

the reconciled set of session ids that have been checked in the store

Annotations
@Override
doCleanOrphansback to summary
public void doCleanOrphans(long timeLimit)

Implements abstract org.eclipse.jetty.session.AbstractSessionDataStore.doCleanOrphans.

Doc from org.eclipse.jetty.session.AbstractSessionDataStore.doCleanOrphans.

Implemented by subclasses to delete sessions for other contexts that expired at or before the timeLimit. These are 'orphaned' sessions that are no longer being actively managed by any node. These are explicitly sessions that do NOT belong to this context (other mechanisms such as doGetExpired take care of those). As they don't belong to this context, they cannot be loaded by us. This is called only periodically to avoid placing excessive load on the store.

Parameters
timeLimit:long

the upper limit of the expiry time to check in msec

Annotations
@Override
doExistsback to summary
public boolean doExists(String id)

Implements abstract org.eclipse.jetty.session.AbstractSessionDataStore.doExists.

Doc from org.eclipse.jetty.session.AbstractSessionDataStore.doExists.

Check if a session for the given id exists.

Parameters
id:String

the session id to check

Returns:boolean

true if the session exists in the persistent store, false otherwise

Annotations
@Override
doGetExpiredback to summary
public Set<String> doGetExpired(long timeLimit)

Implements abstract org.eclipse.jetty.session.AbstractSessionDataStore.doGetExpired.

Doc from org.eclipse.jetty.session.AbstractSessionDataStore.doGetExpired.

Implemented by subclasses to find sessions for this context in the store that expired at or before the time limit and thus not being actively managed by any node. This method is only called periodically (the period is configurable) to avoid putting too much load on the store.

Parameters
timeLimit:long

the upper limit of expiry times to check. Sessions expired at or before this timestamp will match.

Returns:Set<String>

the empty set if there are no sessions expired as at the time, or otherwise a set of session ids.

Annotations
@Override
doLoadback to summary
public SessionData doLoad(String id) throws Exception

Implements abstract org.eclipse.jetty.session.AbstractSessionDataStore.doLoad.

Doc from org.eclipse.jetty.session.AbstractSessionDataStore.doLoad.

Load the session from persistent store.

Parameters
id:String

the id of the session to load

Returns:SessionData

the re-inflated session

Annotations
@Override
Exceptions
Exception:
if unable to load the session
doStoreback to summary
public void doStore(String id, SessionData data, long lastSaveTime) throws Exception

Implements abstract org.eclipse.jetty.session.AbstractSessionDataStore.doStore.

Doc from org.eclipse.jetty.session.AbstractSessionDataStore.doStore.

Store the session data persistently.

Parameters
id:String

identity of session to store

data:SessionData

info of the session

lastSaveTime:long

time of previous save or 0 if never saved

Annotations
@Override
Exceptions
Exception:
if unable to store data
isPassivatingback to summary
public boolean isPassivating()

Implements org.eclipse.jetty.session.SessionDataStore.isPassivating.

Doc from org.eclipse.jetty.session.SessionDataStore.isPassivating.

True if this type of datastore will passivate session objects

Returns:boolean

true if this store can passivate sessions, false otherwise

Annotations
@ManagedAttribute:does this store serialize sessions
readonly:true
@Override
See Also
org.eclipse.jetty.session.SessionDataStore#isPassivating()
newSessionDataback to summary
public SessionData newSessionData(String id, long created, long accessed, long lastAccessed, long maxInactiveMs)

Overrides org.eclipse.jetty.session.AbstractSessionDataStore.newSessionData.

Implements org.eclipse.jetty.session.SessionDataStore.newSessionData.

Doc from org.eclipse.jetty.session.SessionDataStore.newSessionData.

Create a new SessionData

Parameters
id:String

the id

created:long

the timestamp when created

accessed:long

the timestamp when accessed

lastAccessed:long

the timestamp when last accessed

maxInactiveMs:long

the max inactive time in milliseconds

Returns:SessionData

a new SessionData object

Annotations
@Override