Package io.karatelabs.http
Class FileSessionStore
java.lang.Object
io.karatelabs.http.FileSessionStore
- All Implemented Interfaces:
SessionStore
File-based implementation of SessionStore.
Each session is stored as a JSON file in the configured directory.
Suitable for single-instance deployments where sessions must survive restarts
(e.g., Docker containers with volume mounts).
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
FileSessionStore
-
-
Method Details
-
create
Description copied from interface:SessionStoreCreate a new session with the specified expiry time.- Specified by:
createin interfaceSessionStore- Parameters:
expirySeconds- number of seconds until the session expires- Returns:
- newly created session with unique ID
-
get
Description copied from interface:SessionStoreRetrieve a session by its ID.- Specified by:
getin interfaceSessionStore- Parameters:
id- the session ID- Returns:
- the session if found and not expired, null otherwise
-
save
Description copied from interface:SessionStoreSave/update a session in the store.- Specified by:
savein interfaceSessionStore- Parameters:
session- the session to save
-
delete
Description copied from interface:SessionStoreDelete a session from the store.- Specified by:
deletein interfaceSessionStore- Parameters:
id- the session ID to delete
-