- java.lang.Object
-
- services.AuthService
-
- All Implemented Interfaces:
IAuthService
- Direct Known Subclasses:
AuthFYPCoordinatorService
,AuthStudentService
,AuthSupervisorService
public abstract class AuthService extends java.lang.Object implements IAuthService
TheAuthService
class is an abstract class that implements theIAuthService
interface. It provides basic authentication functionalities for user login and logout.
-
-
Constructor Summary
Constructors Constructor Description AuthService()
Constructs an instance of theAuthService
class.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
authenticate(User user, java.lang.String password)
Authenticates the given user with the given password.abstract boolean
login(java.lang.String userID, java.lang.String password)
Logs in a user with the specified user ID and password.boolean
logout()
Logs out the currently logged in user.
-
-
-
Constructor Detail
-
AuthService
public AuthService()
Constructs an instance of theAuthService
class.
-
-
Method Detail
-
login
public abstract boolean login(java.lang.String userID, java.lang.String password)
Description copied from interface:IAuthService
Logs in a user with the specified user ID and password.- Specified by:
login
in interfaceIAuthService
- Parameters:
userID
- the ID of the userpassword
- the user's password- Returns:
- true if the login was successful, false otherwise
-
logout
public boolean logout()
Description copied from interface:IAuthService
Logs out the currently logged in user.- Specified by:
logout
in interfaceIAuthService
- Returns:
- true if the logout was successful, false otherwise
-
authenticate
protected boolean authenticate(User user, java.lang.String password)
Authenticates the given user with the given password.- Parameters:
user
- the user to be authenticatedpassword
- the password to be used for authentication- Returns:
- true if the user is authenticated successfully, false otherwise
-
-