Package com.tangosol.coherence.servlet
Class SessionLocalBackingMapCacheDelegator
- java.lang.Object
-
- com.tangosol.coherence.servlet.SessionLocalBackingMapCacheDelegator
-
- All Implemented Interfaces:
CacheDelegator
public class SessionLocalBackingMapCacheDelegator extends Object implements CacheDelegator
An abstract base class from which implementations of HttpSessionCollection that use a SessionLocalBackingMap can be more easily built.- Author:
- jk 2011.05.24
-
-
Constructor Summary
Constructors Constructor Description SessionLocalBackingMapCacheDelegator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(String sId, AbstractHttpSessionCollection collection)
Check if the cluster cache contains a session obj.Set<String>
deleteExpiredLocalSessions(AbstractHttpSessionCollection collection)
Deletes the locally opened sessions in the session cache which have timed-out and returns the ids for deleted sessions.Set<String>
deleteExpiredSessions(AbstractHttpSessionCollection collection)
Deletes the sessions in the session cache which have timed-out and returns the ids for deleted sessions.void
deleteModel(AbstractHttpSessionCollection collection, AbstractHttpSessionModel model)
Delete the session from the cluster cache.void
flush(AbstractHttpSessionCollection collection, AbstractHttpSessionModel model)
Perform a flush operation of the session onto the cluster cacheIterator
getIteratorForPotentiallyExpiredIds(AbstractHttpSessionCollection collection)
Retrieve an iterator of potentially expired session ids.Iterator
getIteratorForPotentiallyExpiredLocalIds(AbstractHttpSessionCollection collection)
Retrieve an iterator of potentially expired session ids from the list of local sessions.AbstractHttpSessionModel
getModel(String sId, AbstractHttpSessionCollection collection)
Retrieve a model from the cluster cacheAbstractHttpSessionModel
getModel(String sId, AbstractHttpSessionCollection collection, boolean fLite)
Retrieve a model from the cluster cachevoid
optimisticModelUpdate(AbstractHttpSessionModel model)
Perform an optimistic model update in the cache.void
putModel(AbstractHttpSessionModel model)
Put a session model in the cache.void
updateModelTimestamp(AbstractHttpSessionModel model)
Update a session model timestamp in the cache.
-
-
-
Method Detail
-
deleteModel
public void deleteModel(AbstractHttpSessionCollection collection, AbstractHttpSessionModel model)
Description copied from interface:CacheDelegator
Delete the session from the cluster cache.- Specified by:
deleteModel
in interfaceCacheDelegator
- Parameters:
collection
- the collection objmodel
- the model obj
-
containsKey
public boolean containsKey(String sId, AbstractHttpSessionCollection collection)
Description copied from interface:CacheDelegator
Check if the cluster cache contains a session obj.- Specified by:
containsKey
in interfaceCacheDelegator
- Parameters:
sId
- the session idcollection
- the session collection obj- Returns:
- true, if the session obj exists in the cluster cache
-
optimisticModelUpdate
public void optimisticModelUpdate(AbstractHttpSessionModel model)
Description copied from interface:CacheDelegator
Perform an optimistic model update in the cache.- Specified by:
optimisticModelUpdate
in interfaceCacheDelegator
- Parameters:
model
- the session mdoel
-
getIteratorForPotentiallyExpiredIds
public Iterator getIteratorForPotentiallyExpiredIds(AbstractHttpSessionCollection collection)
Description copied from interface:CacheDelegator
Retrieve an iterator of potentially expired session ids.- Specified by:
getIteratorForPotentiallyExpiredIds
in interfaceCacheDelegator
- Parameters:
collection
- the session collection obj- Returns:
- Iterator of potentially expired session ids
-
getModel
public AbstractHttpSessionModel getModel(String sId, AbstractHttpSessionCollection collection, boolean fLite)
Description copied from interface:CacheDelegator
Retrieve a model from the cluster cache- Specified by:
getModel
in interfaceCacheDelegator
- Parameters:
sId
- the session idcollection
- the session collection objfLite
- when set to true then if a near cache is used, the front map is avoided; thus avoiding listener registration and unnecessary eviction on the front map- Returns:
- the session model
-
getModel
public AbstractHttpSessionModel getModel(String sId, AbstractHttpSessionCollection collection)
Description copied from interface:CacheDelegator
Retrieve a model from the cluster cache- Specified by:
getModel
in interfaceCacheDelegator
- Parameters:
sId
- the session idcollection
- the session collection obj- Returns:
- the session model
-
putModel
public void putModel(AbstractHttpSessionModel model)
Description copied from interface:CacheDelegator
Put a session model in the cache.- Specified by:
putModel
in interfaceCacheDelegator
- Parameters:
model
- the session model
-
updateModelTimestamp
public void updateModelTimestamp(AbstractHttpSessionModel model)
Description copied from interface:CacheDelegator
Update a session model timestamp in the cache.- Specified by:
updateModelTimestamp
in interfaceCacheDelegator
- Parameters:
model
- the session model
-
getIteratorForPotentiallyExpiredLocalIds
public Iterator getIteratorForPotentiallyExpiredLocalIds(AbstractHttpSessionCollection collection)
Description copied from interface:CacheDelegator
Retrieve an iterator of potentially expired session ids from the list of local sessions.- Specified by:
getIteratorForPotentiallyExpiredLocalIds
in interfaceCacheDelegator
- Parameters:
collection
- the session collection obj- Returns:
- iterator of potentially expired session local session ids
-
deleteExpiredSessions
public Set<String> deleteExpiredSessions(AbstractHttpSessionCollection collection)
Description copied from interface:CacheDelegator
Deletes the sessions in the session cache which have timed-out and returns the ids for deleted sessions.- Specified by:
deleteExpiredSessions
in interfaceCacheDelegator
- Parameters:
collection
- the session collection obj- Returns:
- the set of ids of sessions that are deleted
-
deleteExpiredLocalSessions
public Set<String> deleteExpiredLocalSessions(AbstractHttpSessionCollection collection)
Description copied from interface:CacheDelegator
Deletes the locally opened sessions in the session cache which have timed-out and returns the ids for deleted sessions.- Specified by:
deleteExpiredLocalSessions
in interfaceCacheDelegator
- Parameters:
collection
- the session collection obj- Returns:
- the set of ids of sessions that are deleted
-
flush
public void flush(AbstractHttpSessionCollection collection, AbstractHttpSessionModel model)
Description copied from interface:CacheDelegator
Perform a flush operation of the session onto the cluster cache- Specified by:
flush
in interfaceCacheDelegator
- Parameters:
collection
- the session collection objmodel
- the session model
-
-