org.web_auth.bizobj
Interface IUser

All Known Implementing Classes:
User

public interface IUser

An interface that represents a user who is required to use username/password authentication for login.

Version:
1.0
Author:
Zhengrong Tang

Method Summary
 void add(java.sql.Connection conn)
          This method persists the user object in the database.
 boolean authenticateByUsernamePassword(java.sql.Connection conn)
          This method does username/password authentication.
 void changePassword(java.sql.Connection conn, java.lang.String newPassword)
          This method changes the user password.
 boolean exist(java.sql.Connection conn)
          Check whether this user exists.
 java.lang.String getPassword()
           
 java.lang.String getUsername()
           
 void remove(java.sql.Connection conn)
          This method removes the user from the database.
 void setPassword(java.lang.String string)
           
 void setUsername(java.lang.String string)
           
 

Method Detail

authenticateByUsernamePassword

public boolean authenticateByUsernamePassword(java.sql.Connection conn)
This method does username/password authentication.

Parameters:
conn - the database connection object for connecting to the database
Returns:
true if the username and password pass authentication; false otherwise

changePassword

public void changePassword(java.sql.Connection conn,
                           java.lang.String newPassword)
                    throws ApplicationException
This method changes the user password.

Parameters:
conn - the database connection object for connecting to the database
newPassword - the new password
Throws:
ApplicationException - if the password change is failed; the failure reason can be retrieved by calling ApplicationException.getApplicationResourceKey()

add

public void add(java.sql.Connection conn)
         throws ApplicationException
This method persists the user object in the database.

Parameters:
conn - the database connection object for connecting to the database
Throws:
ApplicationException - if the persisting is failed; the failure reason can be retrieved by calling ApplicationException.getApplicationResourceKey()

remove

public void remove(java.sql.Connection conn)
            throws ApplicationException
This method removes the user from the database.

Parameters:
conn - the database connection object for connecting to the database
Throws:
ApplicationException - if the remove operation failedthe failure reason can be retrieved by calling ApplicationException.getApplicationResourceKey()

exist

public boolean exist(java.sql.Connection conn)
Check whether this user exists.

Parameters:
conn - the database connection object for connecting to the database
Returns:
true if the user exists; false otherwise

getPassword

public java.lang.String getPassword()

getUsername

public java.lang.String getUsername()

setPassword

public void setPassword(java.lang.String string)

setUsername

public void setUsername(java.lang.String string)


Copyright © 2003 Zhengrong Tang. All Rights Reserved.