org.domain.rhims.dao
Interface UserDAO

All Known Implementing Classes:
UserDAOMySQL

public interface UserDAO

The UserDAO is responsible for managing the persistence of application Users. This includes the base User, along with Administrator, Clinician, and Patient entities. It is a component of the Persistance layer of the application. Currently, it contains methods for adding and retrieving both Users and Administrators. In the future, it will also contain methods to handle Patients and Clinicians.

Author:
Mitch Williams

Method Summary
 java.lang.String addAdministrator(Administrator admin)
          This method persists a new administrator.
 java.lang.String addPatient(Patient patient)
           
 java.lang.String addUser(User user)
          This method persists a new user.
 Administrator getAdministrator(java.lang.String userName, java.lang.String password)
          This method retrieves an Administrator based on their username and password.
 User getUser(java.lang.String userName, java.lang.String password)
          The getUser method retrieves a user based on their userName and password.
 

Method Detail

addUser

java.lang.String addUser(User user)
This method persists a new user. If the user was saved successfully, then it returns "success". Otherwise, it returns a "failure" message.

Parameters:
user - the User to save
Returns:
"success" if the user is saved, "failure" if not

getUser

User getUser(java.lang.String userName,
             java.lang.String password)
The getUser method retrieves a user based on their userName and password. If the user is not found, then it returns null. Otherwise, the User object is returned. This method is intended to be used for login authentication purposes.

Parameters:
userName - the username of the user to find
password - the password of the user to find
Returns:
the User object if the user is found, null otherwise.

addPatient

java.lang.String addPatient(Patient patient)

addAdministrator

java.lang.String addAdministrator(Administrator admin)
This method persists a new administrator. If the user was saved successfully, then it returns "success". Otherwise, it returns a "failure" message.

Parameters:
admin - the Administrator to save
Returns:
"success" if the user is saved, "failure" if not

getAdministrator

Administrator getAdministrator(java.lang.String userName,
                               java.lang.String password)
This method retrieves an Administrator based on their username and password. If they are not found, then it returns null. Otherwise, the Administrator object is returned. This method is intended to be used for login authentication purposes.

Parameters:
userName - the username of the Administrator to find
password - the password of the Administrator to find
Returns:
the Administrator object if found, null otherwise