Class SessionManager
java.lang.Object
com.developer.nefarious.zjoule.plugin.auth.SessionManager
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 TypeMethodDescriptionstatic 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.
-
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 theTagHandler
.- Parameters:
browser
- theBrowser
instance to execute the login process.
-
logout
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 theEclipseMemory
.- Parameters:
browser
- theBrowser
instance to execute the logout process. If the browser is null or disposed, no JavaScript execution occurs.eclipseMemory
- theEclipseMemory
instance used to clear all memory.
-