|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.web_auth.bizobj.impl.User
An abstract class that represents a user who is required to use username/password authentication for login.
Field Summary | |
protected java.lang.String |
password
|
static int |
PASSWORD_LENGTH_MAX
|
static int |
PASSWORD_LENGTH_MIN
|
protected java.lang.String |
username
|
Constructor Summary | |
User()
|
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()
|
abstract int |
getUserType()
Subclass needs to implement this method to return a unique int that represents the type of user. |
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int PASSWORD_LENGTH_MAX
public static final int PASSWORD_LENGTH_MIN
protected java.lang.String username
protected java.lang.String password
Constructor Detail |
public User()
Method Detail |
public abstract int getUserType()
public boolean authenticateByUsernamePassword(java.sql.Connection conn)
authenticateByUsernamePassword
in interface IUser
conn
- the database connection object for connecting to the database
public void changePassword(java.sql.Connection conn, java.lang.String newPassword) throws ApplicationException
changePassword
in interface IUser
conn
- the database connection object for connecting to the databasenewPassword
- the new password
ApplicationException
- if the password change is failed; the failure reason get be retrieved by
calling ApplicationException.getApplicationResourceKey()public void add(java.sql.Connection conn) throws ApplicationException
add
in interface IUser
conn
- the database connection object for connecting to the database
ApplicationException
- if the persisting is failed; the failure reason can be retrieved by
calling ApplicationException.getApplicationResourceKey()public void remove(java.sql.Connection conn) throws ApplicationException
remove
in interface IUser
conn
- the database connection object for connecting to the database
ApplicationException
- if the remove operation failedthe failure reason can be retrieved by
calling ApplicationException.getApplicationResourceKey()public boolean exist(java.sql.Connection conn)
exist
in interface IUser
conn
- the database connection object for connecting to the database
public java.lang.String getPassword()
getPassword
in interface IUser
public java.lang.String getUsername()
getUsername
in interface IUser
public void setPassword(java.lang.String string)
setPassword
in interface IUser
public void setUsername(java.lang.String string)
setUsername
in interface IUser
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |