- 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
TheAuthServiceclass is an abstract class that implements theIAuthServiceinterface. It provides basic authentication functionalities for user login and logout.
-
-
Constructor Summary
Constructors Constructor Description AuthService()Constructs an instance of theAuthServiceclass.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanauthenticate(User user, java.lang.String password)Authenticates the given user with the given password.abstract booleanlogin(java.lang.String userID, java.lang.String password)Logs in a user with the specified user ID and password.booleanlogout()Logs out the currently logged in user.
-
-
-
Constructor Detail
-
AuthService
public AuthService()
Constructs an instance of theAuthServiceclass.
-
-
Method Detail
-
login
public abstract boolean login(java.lang.String userID, java.lang.String password)Description copied from interface:IAuthServiceLogs in a user with the specified user ID and password.- Specified by:
loginin 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:IAuthServiceLogs out the currently logged in user.- Specified by:
logoutin 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
-
-