org.domain.rhims.manager
Interface UserManager

All Known Implementing Classes:
UserManagerAction

public interface UserManager

The UserManager is the business/application logic that handles the users of the system, such as clinicians and patients. It is responsible for registering new users, along with validating users and retrieving users. It is a component of the Application layer.

Author:
Mitch Williams

Method Summary
 boolean checkAdministrator(java.lang.String userName, java.lang.String password)
          This method checks if the user associated with the supplied username and password is an Administrator.
 User loginUser(java.lang.String userName, java.lang.String password)
          This method attempts to login a user by verifying that they exist in the application's persistence means.
 java.lang.String registerPatient(java.lang.String username, java.lang.String password, java.lang.String firstName, java.lang.String lastName, java.lang.String age, java.lang.String gender, java.lang.String emailAddress, java.lang.String phoneNumber)
           
 java.lang.String registerUser(java.lang.String userName, java.lang.String password, boolean admin)
          This method adds a new user to the system by registering them.
 

Method Detail

registerUser

java.lang.String registerUser(java.lang.String userName,
                              java.lang.String password,
                              boolean admin)
This method adds a new user to the system by registering them.

Parameters:
userName - the username of the new user
password - the password of the new user
admin - is the user going to be an administrator
Returns:
"success" if the user is added, "failure" if not.

registerPatient

java.lang.String registerPatient(java.lang.String username,
                                 java.lang.String password,
                                 java.lang.String firstName,
                                 java.lang.String lastName,
                                 java.lang.String age,
                                 java.lang.String gender,
                                 java.lang.String emailAddress,
                                 java.lang.String phoneNumber)

loginUser

User loginUser(java.lang.String userName,
               java.lang.String password)
This method attempts to login a user by verifying that they exist in the application's persistence means. The User object is returned if the user is found, and null otherwise.

Parameters:
userName - the username of the user
password - the password of the user
Returns:
the User if they exist (with the given username & password), null otherwise

checkAdministrator

boolean checkAdministrator(java.lang.String userName,
                           java.lang.String password)
This method checks if the user associated with the supplied username and password is an Administrator. It returns true if they are, false otherwise.

Parameters:
userName - the username of the user
password - the password of the user
Returns:
true if the user is an Administrator, false otherwise