Package logic

Class AuthenticationLogic

java.lang.Object
logic.AuthenticationLogic

public class AuthenticationLogic extends Object
Handles authentication logic such as user login and role retrieval.

Available methods:

  • Constructor Details

    • AuthenticationLogic

      public AuthenticationLogic(UserCredentialsDataService userCredentialsDataService)
      Constructs an AuthenticationLogic object with the specified UserCredentialsDataService.
      Parameters:
      userCredentialsDataService - the service for user credentials data
  • Method Details

    • login

      public boolean login(String username, String password) throws SystemLoginException
      Attempts to log in the user with the provided username and password.
      Parameters:
      username - the username to log in with
      password - 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

      public String getUserRole(String username)
      Retrieves the role of the user with the specified username.
      Parameters:
      username - the username of the user
      Returns:
      the role of the user
    • getEmployeeID

      public int getEmployeeID(String username)
      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