java.lang.Object
one.jpro.platform.session.SessionManager
This class handles the management of sessions in an application.
It provides the functionality to create, retrieve, and store sessions.
-
Constructor Summary
ConstructorsConstructorDescriptionSessionManager(File baseDirectory, String cookieName) Creates a SessionManager object with the given base directory and cookie name.SessionManager(String appName) Creates a SessionManager object with the given app name. -
Method Summary
Modifier and TypeMethodDescriptionReturns the base directory used for session storage.getSession(com.jpro.webapi.WebAPI webAPI) Retrieves the session for the given JPro WebAPI.getSession(String sessionKey) Retrieves the session for the given session key.
-
Constructor Details
-
SessionManager
Creates a SessionManager object with the given app name.- Parameters:
appName- the name of the application
-
SessionManager
Creates a SessionManager object with the given base directory and cookie name.- Parameters:
baseDirectory- the base directory for session storagecookieName- the name of the cookie used for session tracking- Throws:
SessionException- if the session directory cannot be created
-
-
Method Details
-
getFolder
Returns the base directory used for session storage.- Returns:
- the base directory for session storage
-
getSession
Retrieves the session for the given JPro WebAPI.- Parameters:
webAPI- the WebAPI to retrieve the session for- Returns:
- the session as an ObservableMap containing key-value pairs
-
getSession
Retrieves the session for the given session key.- Parameters:
sessionKey- the session key to retrieve the session for- Returns:
- the session as an ObservableMap containing key-value pairs
- Throws:
SessionException- if the session retrieval is called from a non-JFX Application Thread
-