Package user.manager

Class UserManager

java.lang.Object
user.manager.UserManager
All Implemented Interfaces:
UserManagement

public class UserManager extends Object implements UserManagement
Manages user-related operations.

Available methods:

  • Constructor Details

    • UserManager

      public UserManager(UserCredentialsDataService userCredentialsDataService)
      Creates a new UserManager instance.
      Parameters:
      userCredentialsDataService - the UserCredentialsDataService
  • Method Details

    • createUser

      public void createUser(UserCredentials userCredentials)
      Creates a new user record in the database.
      Specified by:
      createUser in interface UserManagement
      Parameters:
      userCredentials - the user credentials to be created
    • updateCredentials

      public void updateCredentials(UserCredentials userCredential) throws UserRecordsException
      Updates a user record in the database.
      Specified by:
      updateCredentials in interface UserManagement
      Parameters:
      userCredential - the user credentials to be updated
      Throws:
      UserRecordsException - if an error occurs
    • deleteUser

      public void deleteUser(int employeeID) throws UserRecordsException
      Deletes a user record from the database.
      Specified by:
      deleteUser in interface UserManagement
      Parameters:
      employeeID - the ID of the user to be deleted
      Throws:
      UserRecordsException - if an error occurs
    • getAllUserRecords

      public List<UserCredentials> getAllUserRecords()
      Retrieves a list of all user records.
      Specified by:
      getAllUserRecords in interface UserManagement
      Returns:
      a list of all user records
    • getUserRecord

      public UserCredentials getUserRecord(int employeeID)
      Retrieves the user record for a specific employee ID.
      Specified by:
      getUserRecord in interface UserManagement
      Parameters:
      employeeID - the employee ID for which to retrieve the user record
      Returns:
      the UserCredentials object corresponding to the employee ID, or null if an error occurs