Class SessionManager

java.lang.Object
one.jpro.platform.session.SessionManager

public class SessionManager extends Object
This class handles the management of sessions in an application. It provides the functionality to create, retrieve, and store sessions.
  • Constructor Details

    • SessionManager

      public SessionManager(String appName)
      Creates a SessionManager object with the given app name.
      Parameters:
      appName - the name of the application
    • SessionManager

      public SessionManager(File baseDirectory, String cookieName)
      Creates a SessionManager object with the given base directory and cookie name.
      Parameters:
      baseDirectory - the base directory for session storage
      cookieName - the name of the cookie used for session tracking
      Throws:
      SessionException - if the session directory cannot be created
  • Method Details

    • getFolder

      public File getFolder()
      Returns the base directory used for session storage.
      Returns:
      the base directory for session storage
    • getSession

      public javafx.collections.ObservableMap<String,String> getSession(com.jpro.webapi.WebAPI webAPI)
      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

      public javafx.collections.ObservableMap<String,String> getSession(String sessionKey)
      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