|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcorelib.security.User
public class User
This class represents the concept of user for a considered computer system.
A user has a number of attributes and a set of roles assigned to it.
Note: you cannot directly create a User. Instead of, use an UserManager instance.
Role,
RoleManager,
SecurityManager,
UserManager| Method Summary | |
|---|---|
void |
addRole(Role role)
Adds another role to this user. |
int |
getConnectionNumber()
Returns the connection number of this user. |
int |
getConsecutiveError()
Returns the consecutive error number |
int |
getIdentifier()
Return the identifier of this user. |
java.util.Date |
getLastConnection()
Returns the date and the time of the last connection for this user. |
java.lang.String |
getLogin()
Returns the user login. |
java.util.Set<Role> |
getRoles()
Returns a set of all roles associated to this user.. |
boolean |
isDisabled()
Returns if the user account is disabled. |
boolean |
isMemberOfRole(Role role)
Checks is this user is associated to the specified role. |
boolean |
isSamePassword(java.lang.String password)
Check if the encripted string (for the specified password) is the same that the encripted password store in the used security system (certainly a relational database). |
void |
removeRole(Role role)
Removes a role to this user. |
void |
setConsecutiveError(int consecutiveError)
Set the consecutive error number. |
void |
setDisabled(boolean isDisabled)
Set the disabled state for this user. |
void |
setPassword(java.lang.String newPassword)
Set the new password for this user. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public int getIdentifier()
public java.lang.String getLogin()
public boolean isSamePassword(java.lang.String password)
throws SecurityManagerException
password - The clear password to compare
SecurityManagerException - Thrown if passwords cannot be compared.setPassword(String)
public void setPassword(java.lang.String newPassword)
throws SecurityManagerException
newPassword - The new password for this user.
SecurityManagerException - Thrown if security system cannot change the password.isSamePassword(String)public int getConnectionNumber()
setConnectionNumber( int ),
UserManager.checkCredentials(String, String)public java.util.Date getLastConnection()
setLastConnection( Date )public boolean isDisabled()
setDisabled( boolean )public void setDisabled(boolean isDisabled)
isDisabled - The disabled state.isDisabled()public int getConsecutiveError()
setConsecutiveError( int )public void setConsecutiveError(int consecutiveError)
consecutiveError - The consecutive error value.getConsecutiveError()public boolean isMemberOfRole(Role role)
role - The expected role.
public java.util.Set<Role> getRoles()
public void addRole(Role role)
role - The new role to affect for this user.public void removeRole(Role role)
role - The role to remove for this user.public java.lang.String toString()
toString in class java.lang.Object
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||