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
 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.
 
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,
                                        java.lang.String age,
                                        java.lang.String gender,
                                        java.lang.String emailAddress,
                                        java.lang.String phoneNumber)
Specified by:
registerPatient in interface UserManager

loginUser

public User 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. The User object is returned if the user is found, and null otherwise.

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

checkAdministrator

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

Specified by:
checkAdministrator in interface UserManager
Parameters:
userName - the username of the user
password - the password of the user
Returns:
true if the user is an Administrator, false otherwise
See Also:
UserManager.checkAdministrator(String, String)