Interface QSessionStoreProviderInterface
public interface QSessionStoreProviderInterface
Interface for session storage providers.
QBits or application code can implement this interface to provide session
persistence. Implementations register themselves with QSessionStoreRegistry
on startup, and QQQ core uses the registered provider for session caching.
Example providers:
- InMemory: ConcurrentHashMap for dev/testing
- TableBased: QQQ table storage for multi-instance persistence
- Redis: Distributed caching for HA deployments
-
Method Summary
Modifier and TypeMethodDescriptionGet the default TTL for sessions.Load a session by UUID.loadAndTouch(String sessionUuid) Load a session and touch it to reset its TTL in a single operation.voidRemove a session by UUID.voidStore a session with the given TTL.voidTouch a session to reset its TTL (sliding expiration).
-
Method Details
-
store
-
load
-
remove
Remove a session by UUID.- Parameters:
sessionUuid- Unique identifier for the session to remove
-
touch
Touch a session to reset its TTL (sliding expiration).- Parameters:
sessionUuid- Unique identifier for the session to touch
-
getDefaultTtl
Duration getDefaultTtl()Get the default TTL for sessions.- Returns:
- The default time-to-live duration
-
loadAndTouch
Load a session and touch it to reset its TTL in a single operation. Default implementation calls load() then touch(). Providers may override with optimized implementations (e.g., Redis GETEX, combined SQL query).- Parameters:
sessionUuid- Unique identifier for the session- Returns:
- Optional containing the session if found and not expired
-