|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.davesag.generica.core.User
The User bean represents the bare information we know about the user of the system. The User is the core of the core objects really. The user's password is converted to an MD5 hash code for privacy. There are protected methods for setting and getting the user's hashed password. These are there to support Hibernate only and can be ignored by most developers. This User object also provides a mechanism for providing a simple password helper, invalidating the user's password and so forth. In addition users may be inactive, ie they exist but can not log in or do anything.
| Field Summary | |
protected Boolean |
isActive
is the user an active user, or has their access been disabled? |
protected String |
theEmail
the email address for this user |
protected Long |
theId
user's id used as a key by hibernate |
protected String |
theLastIp
a security measure, this is the last IP number the user logged in from |
protected String |
thePassword
the MD5Hash of the password of this user |
protected PasswordHelper |
thePasswordHelper
the user's password helper |
protected Boolean |
thePasswordRequiresReset
A flag that determins id the password requires resetting. |
protected String |
theUsername
the user's username - must not contain chars that can not be used in a uri |
| Constructor Summary | |
User()
null constructor required by hibernate. |
|
User(String username,
String ctpassword)
constructor takes a member and populates this summary object with the values required in common to all member displays. |
|
| Method Summary | |
void |
activate()
A user may be activated, in which case they may log-in. |
void |
deactivate()
A user may be deactivated. |
boolean |
equals(Object o)
Tests if the supplied object is equal to this User. |
Boolean |
getActive()
Get the active status of the user. |
String |
getEmail()
Get the user's email address. |
Long |
getId()
the id number. |
String |
getLastIp()
the user's last known IP number. |
String |
getPassword()
Get the hashed password. |
PasswordHelper |
getPasswordHelper()
Get the user's PasswordHelper. |
Boolean |
getPasswordRequiresReset()
Essentially the same as isPasswordRequiresReset but expressed in a form more useful for Struts. |
String |
getUsername()
Get the user's username. |
int |
hashcode()
An object must override the hashcode if it overrides the equals method. |
void |
invalidatePassword()
Invalidate the user's password. |
boolean |
isActive()
Is the user active, ie are they allowed to log-in? |
boolean |
isPasswordRequiresReset()
Tests to see if the user's password is valid. |
void |
setActive(Boolean b)
Set the validity of the user's password. |
void |
setClearTextPassword(String ctpassword)
set the user's password by creating an MD5 hash of the clear text password supplied. |
void |
setEmail(String email)
Set the user's email address. |
protected void |
setId(Long id)
Sets the The User's Id number. |
void |
setLastIp(String ip)
Sets the The User's IP number. |
void |
setPassword(String password)
Set the user's password directly. |
void |
setPasswordHelper(PasswordHelper ph)
Set the user's PasswordHelper. |
protected void |
setPasswordRequiresReset(Boolean b)
Set the validity of the user's password. |
void |
setTemplateId(Long id)
Sets the The User's ID number directly. |
void |
setUsername(String username)
Set the user's username. |
String |
toString()
Get the user's details as a string. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Long theId
protected String theUsername
protected String thePassword
protected Boolean thePasswordRequiresReset
protected PasswordHelper thePasswordHelper
protected String theEmail
protected Boolean isActive
protected String theLastIp
| Constructor Detail |
public User()
public User(String username,
String ctpassword)
username - The name of the user.ctpassword - The clear text password of the user. It will be
hashed.| Method Detail |
public Long getId()
getId in interface Persistableprotected void setId(Long id)
id - The Id number to set.public void setTemplateId(Long id)
User's ID number directly. This is only to be
used when creating a template object, and is not to be used when
creating actual objects that will be persisted.
setTemplateId in interface Persistableid - The ID number to set.public String getLastIp()
public void setLastIp(String ip)
ip - The IP number to set.public String getUsername()
public void setUsername(String username)
username - The username.public void setClearTextPassword(String ctpassword)
ctpassword - the clear text password.public String getPassword()
public void setPassword(String password)
password - The already hashed password.public boolean isPasswordRequiresReset()
public void invalidatePassword()
protected void setPasswordRequiresReset(Boolean b)
b - True if the password is valid.public Boolean getPasswordRequiresReset()
isPasswordRequiresReset but expressed in a form more useful for Struts.
public PasswordHelper getPasswordHelper()
PasswordHelper.
PasswordHelper.public void setPasswordHelper(PasswordHelper ph)
PasswordHelper.
ph - The PasswordHelper.public String getEmail()
public void setEmail(String email)
email - the email address.public void activate()
public void deactivate()
public void setActive(Boolean b)
b - True if the password is valid.public Boolean getActive()
isActive but presented in a form more useful to Struts.
public boolean isActive()
public String toString()
public boolean equals(Object o)
o - The object to test against this User. Must also be a User to
make sense.
public int hashcode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||