java.lang.Object
logic.AuthenticationLogic
Handles authentication logic such as user login and role retrieval.
Available methods:
-
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationLogic
(UserCredentialsDataService userCredentialsDataService) Constructs an AuthenticationLogic object with the specified UserCredentialsDataService. -
Method Summary
Modifier and TypeMethodDescriptionint
getEmployeeID
(String username) Retrieves the employee ID of the user with the specified username.getUserRole
(String username) Retrieves the role of the user with the specified username.boolean
Attempts to log in the user with the provided username and password.
-
Constructor Details
-
AuthenticationLogic
Constructs an AuthenticationLogic object with the specified UserCredentialsDataService.- Parameters:
userCredentialsDataService
- the service for user credentials data
-
-
Method Details
-
login
Attempts to log in the user with the provided username and password.- Parameters:
username
- the username to log in withpassword
- the password to log in with- Returns:
- true if login is successful, otherwise false
- Throws:
SystemLoginException
- if login fails due to missing username/password or incorrect credentials
-
getUserRole
Retrieves the role of the user with the specified username.- Parameters:
username
- the username of the user- Returns:
- the role of the user
-
getEmployeeID
Retrieves the employee ID of the user with the specified username.- Parameters:
username
- the username of the user- Returns:
- the employee ID of the user
-