Interface SessionDriver
- All Known Implementing Classes:
FileSessionDriver
public interface SessionDriver
Interface representing a driver responsible for session persistence operations.
- Since:
- 3.3.5-SNAPSHOT
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidDestroys or removes the session data associated with the given session identifier from the underlying storage.booleanChecks if the session id exists in the underlying storage.voidLoads session data from the underlying storage into the provided session instance.default voidmigrate(Session session, String sessionID, SessionDriver priorDriver) Migrates the session data from oneSessionDriverto another.voidPersists the provided session data to the underlying storage.
-
Method Details
-
exists
Checks if the session id exists in the underlying storage.- Parameters:
session- TheSessioninstance to be populated with data.sessionID- The unique identifier of the session.- Returns:
- Returns
trueif the session exists in the underlying storage,falseotherwise. - Throws:
IOException- If an error occurs while loading the session data.- Since:
- 3.4.0-SNAPSHOT
-
load
Loads session data from the underlying storage into the provided session instance.- Parameters:
session- TheSessioninstance to be populated with data.sessionID- The unique identifier of the session.- Throws:
IOException- If an error occurs while loading the session data.
-
save
Persists the provided session data to the underlying storage.- Parameters:
session- The session instance containing data to be saved.sessionID- The unique identifier of the session.- Throws:
IOException- If an error occurs while saving the session data.
-
destroy
Destroys or removes the session data associated with the given session identifier from the underlying storage.NOTE: Should not clear the underlying session object, otherwise the migrate function will no longer work.
- Parameters:
session- The session instance to be destroyed.sessionID- The unique identifier of the session.- Throws:
IOException- If an error occurs while destroying the session data.
-
migrate
default void migrate(Session session, String sessionID, SessionDriver priorDriver) throws IOException Migrates the session data from oneSessionDriverto another.- Parameters:
session- The session instance to be migrated.sessionID- The unique identifier of the session.priorDriver- The priorSessionDriverfrom which this session is migrated.- Throws:
IOException- If an error occurs while migrating the session data.- Since:
- 3.3.5-SNAPSHOT
-