org.domain.rhims.manager
Class UserManagerAction

java.lang.Object
  extended by org.domain.rhims.manager.UserManagerAction
All Implemented Interfaces:
UserManager

@Name(value="userManager")
public class UserManagerAction
extends java.lang.Object
implements UserManager

This class provides an implementation of the UserManager. It maintains a reference to the UserDAO for persisting data. Its Seam name "userManager"

Author:
Mitch Williams

Constructor Summary
UserManagerAction()
           
 
Method Summary
 java.util.List<Clinician> getAllClinicians()
          This method gets a list of all the Clinicians in the system.
 java.util.List<Patient> getAllPatients()
          This method gets a list of all the Patients in the system.
 Clinician getClinician(java.lang.String clinicianUsername)
          This method retrieves a Clinician given their username
 Patient getPatient(java.lang.String patientUsername)
          This method retrieves a Patient given their username
 boolean 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 registerClinician(java.lang.String username, java.lang.String password, java.lang.String firstName, java.lang.String lastName, java.lang.String emailAddress, java.lang.String phoneNumber, java.lang.String department)
          This method adds a new Clinician to the system by registering them.
 java.lang.String registerPatient(java.lang.String username, java.lang.String password, java.lang.String firstName, java.lang.String lastName, int age, Gender gender, java.lang.String emailAddress, java.lang.String phoneNumber)
          This method adds a new patient to the system by registering them.
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserManagerAction

public UserManagerAction()
Method Detail

registerUser

public java.lang.String registerUser(java.lang.String userName,
                                     java.lang.String password,
                                     boolean admin)
Description copied from interface: UserManager
This method adds a new user to the system by registering them.

Specified by:
registerUser in interface UserManager
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.
See Also:
UserManager.registerUser(String, String, boolean)

registerPatient

public java.lang.String registerPatient(java.lang.String username,
                                        java.lang.String password,
                                        java.lang.String firstName,
                                        java.lang.String lastName,
                                        int age,
                                        Gender gender,
                                        java.lang.String emailAddress,
                                        java.lang.String phoneNumber)
Description copied from interface: UserManager
This method adds a new patient to the system by registering them.

Specified by:
registerPatient in interface UserManager
Returns:
See Also:
UserManager.registerPatient(String, String, String, String, int, Gender, String, String)

registerClinician

public java.lang.String registerClinician(java.lang.String username,
                                          java.lang.String password,
                                          java.lang.String firstName,
                                          java.lang.String lastName,
                                          java.lang.String emailAddress,
                                          java.lang.String phoneNumber,
                                          java.lang.String department)
Description copied from interface: UserManager
This method adds a new Clinician to the system by registering them.

Specified by:
registerClinician in interface UserManager
Returns:
See Also:
UserManager.registerClinician(String, String, String, String, String, String, String)

loginUser

public boolean loginUser(java.lang.String userName,
                         java.lang.String password)
Description copied from interface: UserManager
This method attempts to login a user by verifying that they exist in the application's persistence means.

Specified by:
loginUser in interface UserManager
Parameters:
userName - the username of the user
password - the password of the user
Returns:
true if login was successful, false if not
See Also:
UserManager.loginUser(String, String)

getPatient

public Patient getPatient(java.lang.String patientUsername)
Description copied from interface: UserManager
This method retrieves a Patient given their username

Specified by:
getPatient in interface UserManager
Parameters:
patientUsername - the username of the Patient to retrieve
Returns:
the Patient
See Also:
UserManager.getPatient(String)

getClinician

public Clinician getClinician(java.lang.String clinicianUsername)
Description copied from interface: UserManager
This method retrieves a Clinician given their username

Specified by:
getClinician in interface UserManager
Parameters:
clinicianUsername - the username of the Clinician to retrieve
Returns:
the Clinician
See Also:
UserManager.getClinician(String)

getAllPatients

public java.util.List<Patient> getAllPatients()
Description copied from interface: UserManager
This method gets a list of all the Patients in the system. It is intended to be used for actions such as viewing all the Patients so that they can be added to a CaseFile.

Specified by:
getAllPatients in interface UserManager
Returns:
a list of all the Patients in the system
See Also:
UserManager.getAllPatients()

getAllClinicians

public java.util.List<Clinician> getAllClinicians()
Description copied from interface: UserManager
This method gets a list of all the Clinicians in the system. It is intended to be used for actions such as viewing all the Clinicians so that they can be added to a CaseFile.

Specified by:
getAllClinicians in interface UserManager
Returns:
a list of all the Clinicians in the system
See Also:
UserManager.getAllClinicians()