org.opensha.sha.gui.servlets.user_auth_db
Class OpenSHA_UsersDBDAO

java.lang.Object
  extended by org.opensha.sha.gui.servlets.user_auth_db.OpenSHA_UsersDBDAO
All Implemented Interfaces:
java.io.Serializable, OpenSHA_UsersDAO

public class OpenSHA_UsersDBDAO
extends java.lang.Object
implements OpenSHA_UsersDAO

Title: OpenSHA_UsersDBDAO.java

Description: This class will interact with MySQL database for users management for OpenSHA

Copyright: Copyright (c) 2002

Company:

Version:
1.0
Author:
Vipin Gupta, Nitin Gupta
See Also:
Serialized Form

Constructor Summary
OpenSHA_UsersDBDAO()
           
 
Method Summary
 void deleteUser(java.lang.String email)
          Remove the user from the database
 void emailUserName(java.lang.String email)
           
 java.util.ArrayList getAllUsers()
          Returns a list of OpenSHA_UsersVO objects
 java.util.ArrayList getApprovedUsers()
          Returns a list of OpenSHA_UsersVO objects
 java.util.ArrayList getUnapprovedUsers()
          Returns a list of OpenSHA_UsersVO objects
 OpenSHA_UsersVO getUser(java.lang.String email)
           
 OpenSHA_UsersVO getUserInfo(java.lang.String userName, java.lang.String password)
          Wheether username/password combination is valid and whether user is approved
 boolean insertNewUser(OpenSHA_UsersVO newUserVO)
          Add new OpenSHA user to the database It encodes the password and then puts it into the MySQL database
 boolean isNameUsed(java.lang.String userName)
           
 boolean isUserAuthorized(OpenSHA_UsersVO userVO)
          Get the status
static void main(java.lang.String[] args)
           
 void makeEmptyForTesting()
           
 void resetAndEmailPassword(java.lang.String email)
          Reset the paswword for this user
 void updatePassword(java.lang.String email, java.lang.String newPassword)
          update the user password
 void updateUser(OpenSHA_UsersVO updatedUserVO)
          Update the user info in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenSHA_UsersDBDAO

public OpenSHA_UsersDBDAO()
Method Detail

insertNewUser

public boolean insertNewUser(OpenSHA_UsersVO newUserVO)
Add new OpenSHA user to the database It encodes the password and then puts it into the MySQL database

Specified by:
insertNewUser in interface OpenSHA_UsersDAO
Parameters:
newUserVO -
Returns:

updateUser

public void updateUser(OpenSHA_UsersVO updatedUserVO)
Update the user info in the database. It will update all the fields except username, password and email

Specified by:
updateUser in interface OpenSHA_UsersDAO
Parameters:
updatedUserVO -

updatePassword

public void updatePassword(java.lang.String email,
                           java.lang.String newPassword)
update the user password

Specified by:
updatePassword in interface OpenSHA_UsersDAO

resetAndEmailPassword

public void resetAndEmailPassword(java.lang.String email)
Reset the paswword for this user

Specified by:
resetAndEmailPassword in interface OpenSHA_UsersDAO
Parameters:
email -

deleteUser

public void deleteUser(java.lang.String email)
Remove the user from the database

Specified by:
deleteUser in interface OpenSHA_UsersDAO
Parameters:
updatedUserVO -

getUserInfo

public OpenSHA_UsersVO getUserInfo(java.lang.String userName,
                                   java.lang.String password)
Wheether username/password combination is valid and whether user is approved

Specified by:
getUserInfo in interface OpenSHA_UsersDAO
Parameters:
userName -
password -
Returns:

isUserAuthorized

public boolean isUserAuthorized(OpenSHA_UsersVO userVO)
Get the status

Specified by:
isUserAuthorized in interface OpenSHA_UsersDAO
Parameters:
userName -
password -
Returns:

getAllUsers

public java.util.ArrayList getAllUsers()
Returns a list of OpenSHA_UsersVO objects

Specified by:
getAllUsers in interface OpenSHA_UsersDAO
Returns:

getApprovedUsers

public java.util.ArrayList getApprovedUsers()
Returns a list of OpenSHA_UsersVO objects

Specified by:
getApprovedUsers in interface OpenSHA_UsersDAO
Returns:

getUnapprovedUsers

public java.util.ArrayList getUnapprovedUsers()
Returns a list of OpenSHA_UsersVO objects

Specified by:
getUnapprovedUsers in interface OpenSHA_UsersDAO
Returns:

isNameUsed

public boolean isNameUsed(java.lang.String userName)
Specified by:
isNameUsed in interface OpenSHA_UsersDAO

getUser

public OpenSHA_UsersVO getUser(java.lang.String email)
Specified by:
getUser in interface OpenSHA_UsersDAO

emailUserName

public void emailUserName(java.lang.String email)
Specified by:
emailUserName in interface OpenSHA_UsersDAO

makeEmptyForTesting

public void makeEmptyForTesting()

main

public static void main(java.lang.String[] args)