Class DefaultLettuceSessionStore
- java.lang.Object
-
- com.aspectran.core.component.AbstractComponent
-
- com.aspectran.core.component.session.AbstractSessionStore
-
- com.aspectran.core.component.session.redis.lettuce.AbstractLettuceSessionStore
-
- com.aspectran.core.component.session.redis.lettuce.DefaultLettuceSessionStore
-
- All Implemented Interfaces:
Component,SessionStore
- Direct Known Subclasses:
MasterReplicaLettuceSessionStore
public class DefaultLettuceSessionStore extends AbstractLettuceSessionStore
A Redis-based session store using Lettuce as the client.Created: 2019/12/06
- Since:
- 6.6.0
-
-
Constructor Summary
Constructors Constructor Description DefaultLettuceSessionStore(ConnectionPool<io.lettuce.core.api.StatefulRedisConnection<java.lang.String,SessionData>> pool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete(java.lang.String id)Delete session data.protected voiddoDestroy()protected voiddoInitialize()voiddoSave(java.lang.String id, SessionData data)Store the session data persistently.booleanexists(java.lang.String id)Test if data exists for a given session id.SessionDataload(java.lang.String id)Read in session data.voidscan(java.util.function.Consumer<SessionData> func)-
Methods inherited from class com.aspectran.core.component.session.redis.lettuce.AbstractLettuceSessionStore
checkExpiry, doGetExpired
-
Methods inherited from class com.aspectran.core.component.session.AbstractSessionStore
checkAlreadyInitialized, getExpired, getGracePeriodSecs, getLastExpiryCheckTime, getNonPersistentAttributes, getSavePeriodSecs, isNonPersistentAttributes, save, setGracePeriodSecs, setNonPersistentAttributes, setSavePeriodSecs
-
Methods inherited from class com.aspectran.core.component.AbstractComponent
destroy, getComponentName, initialize, isAvailable, isDestroyed, isDestroying, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.aspectran.core.component.Component
destroy, getComponentName, initialize, isAvailable, isDestroyed, isDestroying, isInitialized
-
-
-
-
Constructor Detail
-
DefaultLettuceSessionStore
public DefaultLettuceSessionStore(ConnectionPool<io.lettuce.core.api.StatefulRedisConnection<java.lang.String,SessionData>> pool)
-
-
Method Detail
-
doInitialize
protected void doInitialize() throws java.lang.Exception- Specified by:
doInitializein classAbstractComponent- Throws:
java.lang.Exception
-
doDestroy
protected void doDestroy() throws java.lang.Exception- Specified by:
doDestroyin classAbstractComponent- Throws:
java.lang.Exception
-
scan
public void scan(java.util.function.Consumer<SessionData> func)
- Specified by:
scanin classAbstractLettuceSessionStore
-
load
public SessionData load(java.lang.String id)
Description copied from interface:SessionStoreRead in session data.- Parameters:
id- identity of session to load- Returns:
- the SessionData matching the id
-
delete
public boolean delete(java.lang.String id)
Description copied from interface:SessionStoreDelete session data.- Parameters:
id- identity of session to delete- Returns:
- true if the session was deleted
-
exists
public boolean exists(java.lang.String id)
Description copied from interface:SessionStoreTest if data exists for a given session id.- Parameters:
id- Identity of session whose existence should be checked- Returns:
- true if valid, non-expired session exists
-
doSave
public void doSave(java.lang.String id, SessionData data)Description copied from class:AbstractSessionStoreStore the session data persistently.- Specified by:
doSavein classAbstractSessionStore- Parameters:
id- identity of session to storedata- info of the session
-
-