Class SessionManager

java.lang.Object
com.developer.nefarious.zjoule.plugin.auth.SessionManager

public abstract class SessionManager extends Object
Manages the user's session within the application. The SessionManager class provides static methods for login, logout, and session state verification. It interacts with various memory components and the browser to manage user sessions.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Checks if the user is currently logged in.
    static void
    login(org.eclipse.swt.browser.Browser browser)
    Executes the login process using the specified browser.
    static void
    logout(org.eclipse.swt.browser.Browser browser, EclipseMemory eclipseMemory)
    Executes the logout process using the specified browser and clears all memory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isUserLoggedIn

      public static boolean isUserLoggedIn()
      Checks if the user is currently logged in. A user is considered logged in if the following memory components are not empty:
      Returns:
      true if the user is logged in, false otherwise.
    • login

      public static void login(org.eclipse.swt.browser.Browser browser)
      Executes the login process using the specified browser. This method triggers the `login()` JavaScript function in the browser and updates the associated tags using the TagHandler.
      Parameters:
      browser - the Browser instance to execute the login process.
    • logout

      public static void logout(org.eclipse.swt.browser.Browser browser, EclipseMemory eclipseMemory)
      Executes the logout process using the specified browser and clears all memory. The method triggers the `logout()` JavaScript function in the browser and clears all user-related data from the EclipseMemory.
      Parameters:
      browser - the Browser instance to execute the logout process. If the browser is null or disposed, no JavaScript execution occurs.
      eclipseMemory - the EclipseMemory instance used to clear all memory.