SessionDataMap, SessionDataStore, Container, Destroyable, Dumpable, LifeCycle@ManagedObject public class MongoSessionDataStore extends NoSqlSessionDataStore
One of the name:value attribute pairs will always be the special attribute "__metadata__". The value is an object representing a version counter which is incremented every time the attributes change.
For example:
{ "_id" : ObjectId("52845534a40b66410f228f23"),
"accessed" : NumberLong("1384818548903"),
"maxIdle" : 1,
"context" : { "0_0_0_0:_testA" : { "A" : "A",
"__metadata__" : { "version" : NumberLong(2) }
},
"0_0_0_0:_testB" : { "B" : "B",
"__metadata__" : { "version" : NumberLong(1) }
}
},
"created" : NumberLong("1384818548903"),
"expiry" : NumberLong("1384818549903"),
"id" : "w01ijx2vnalgv1sqrpjwuirprp7",
"valid" : true
}
In MongoDB, the nesting level is indicated by "." separators for the key name. Thus to
interact with a session attribute, the key is composed of:
"context".unique_context_name.attribute_name
Eg "context"."0_0_0_0:_testA"."A"
AbstractLifeCycle.AbstractLifeCycleListenerContainer.InheritedListener, Container.ListenerLifeCycle.ListenerNoSqlSessionDataStore.NoSqlSessionData| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
__ACCESSED |
Last access time of session
|
static java.lang.String |
__EXPIRY |
Time this session will expire, based on last access time and maxIdle
|
static java.lang.String |
__ID |
Session id
|
static java.lang.String |
__LASTNODE |
|
static java.lang.String |
__LASTSAVED |
|
static java.lang.String |
__MAX_IDLE |
The max idle time of a session (smallest value across all contexts which has a session with the same id)
|
static java.lang.String |
__VALID |
Whether or not session is valid
|
static java.lang.String |
__VERSION |
Special attribute per session per context, incremented each time attributes are modified
|
FAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING_context, _gracePeriodSec, _lastExpiryCheckTime, _savePeriodSec| Constructor | Description |
|---|---|
MongoSessionDataStore() |
| Modifier and Type | Method | Description |
|---|---|---|
protected java.lang.String |
decodeName(java.lang.String name) |
|
protected java.lang.Object |
decodeValue(java.lang.Object valueToDecode) |
|
boolean |
delete(java.lang.String id) |
|
java.util.Set<java.lang.String> |
doGetExpired(java.util.Set<java.lang.String> candidates) |
|
protected void |
doStart() |
|
protected void |
doStop() |
|
void |
doStore(java.lang.String id,
SessionData data,
long lastSaveTime) |
|
protected java.lang.Object |
encodeName(java.lang.Object value) |
|
protected java.lang.String |
encodeName(java.lang.String name) |
|
protected void |
ensureIndexes() |
|
boolean |
exists(java.lang.String id) |
|
com.mongodb.DBCollection |
getDBCollection() |
|
boolean |
isPassivating() |
|
SessionData |
load(java.lang.String id) |
|
void |
setDBCollection(com.mongodb.DBCollection collection) |
|
java.lang.String |
toString() |
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopcheckStarted, getExpired, getGracePeriodSec, getSavePeriodSec, initialize, setGracePeriodSec, setSavePeriodSec, storeaddBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stopnewSessionDatapublic static final java.lang.String __VERSION
public static final java.lang.String __LASTSAVED
public static final java.lang.String __LASTNODE
public static final java.lang.String __ACCESSED
public static final java.lang.String __EXPIRY
public static final java.lang.String __MAX_IDLE
public static final java.lang.String __VALID
public static final java.lang.String __ID
public void setDBCollection(com.mongodb.DBCollection collection)
@ManagedAttribute(value="DBCollection", readonly=true) public com.mongodb.DBCollection getDBCollection()
public SessionData load(java.lang.String id) throws java.lang.Exception
java.lang.ExceptionSessionDataMap.load(String)public boolean delete(java.lang.String id)
throws java.lang.Exception
java.lang.ExceptionSessionDataMap.delete(String)public boolean exists(java.lang.String id)
throws java.lang.Exception
java.lang.ExceptionSessionDataStore.exists(java.lang.String)public java.util.Set<java.lang.String> doGetExpired(java.util.Set<java.lang.String> candidates)
doGetExpired in class AbstractSessionDataStoreSessionDataStore.getExpired(Set)public void doStore(java.lang.String id,
SessionData data,
long lastSaveTime)
throws java.lang.Exception
doStore in class AbstractSessionDataStorejava.lang.ExceptionAbstractSessionDataStore.doStore(String, SessionData, long)protected void doStart()
throws java.lang.Exception
doStart in class AbstractSessionDataStorejava.lang.Exceptionprotected void doStop()
throws java.lang.Exception
doStop in class ContainerLifeCyclejava.lang.Exceptionprotected void ensureIndexes()
throws com.mongodb.MongoException
com.mongodb.MongoExceptionprotected java.lang.Object decodeValue(java.lang.Object valueToDecode)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionprotected java.lang.String decodeName(java.lang.String name)
protected java.lang.String encodeName(java.lang.String name)
protected java.lang.Object encodeName(java.lang.Object value)
throws java.io.IOException
java.io.IOException@ManagedAttribute(value="does store serialize sessions", readonly=true) public boolean isPassivating()
SessionDataStore.isPassivating()public java.lang.String toString()
toString in class AbstractSessionDataStoreAbstractSessionDataStore.toString()Copyright © 1995–2018 Webtide. All rights reserved.