Class SessionManager
java.lang.Object
util.SessionManager
Class that manages current user session for the application.
Has methods that keep track of if a user is signed in or not.
Only one user can be signed in at a time.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SessionManager
public SessionManager()
-
-
Method Details
-
signIn
Signs in a user. Stores the user as the current session holder.- Parameters:
user- the user to sign in
-
signOut
public static void signOut()Signs out current user by clearing session. -
isSignedIn
public static boolean isSignedIn()Method returns boolean value on whether a user is signed in.- Returns:
- false if user is not signed in, true if signed in.
-
getSignedInUser
Method that returns the current user that the session contains.- Returns:
- the current user
-