|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.marketcetera.persist.EntityBase
org.marketcetera.persist.NDEntityBase
org.marketcetera.ors.security.SimpleUser
public class SimpleUser
A user that can logon to the message bus used by the system. Each user has a name, description and password.
Every user needs to have a non-empty name and password. The password is saved as hashed value created from both the name and password value. The user name needs to be set before the password is set. If the user name is changed, user's password is unset.
| Field Summary |
|---|
| Fields inherited from class org.marketcetera.persist.NDEntityBase |
|---|
ATTRIBUTE_DESCRIPTION, ATTRIBUTE_NAME |
| Fields inherited from class org.marketcetera.persist.EntityBase |
|---|
ATTRIBUTE_ID, ATTRIBUTE_LAST_UPDATED, UNINITIALIZED |
| Constructor Summary | |
|---|---|
SimpleUser()
|
|
| Method Summary | |
|---|---|
void |
changePassword(char[] originalPassword,
char[] newPassword)
Changes the user's password after validating the supplied password. |
void |
delete()
Deletes the user from the database. |
String |
getSystemData()
Gets the system data as a String. |
String |
getUserData()
Gets the user data as a String. |
UserID |
getUserID()
The UserID of this user. |
boolean |
isActive()
The active flag of this user. |
boolean |
isPasswordSet()
Returns true if the user password is set. |
boolean |
isSuperuser()
The superuser flag of this user. |
void |
save()
Saves the user to the database. |
void |
setActive(boolean active)
Set the active flag for this user. |
void |
setName(String name)
Sets the user name. |
void |
setPassword(char[] password)
Sets the user's password. |
void |
setSuperuser(boolean superuser)
Set the superuser flag for this user. |
void |
setSystemData(String inSystemData)
Sets the system data. |
void |
setUserData(String inUserData)
Sets the user data. |
void |
validate()
Validates if the attributes of this instance are valid to attempt a save operation. |
void |
validatePassword(char[] password)
Verifies if the supplied password matches the configured password for the user. |
| Methods inherited from class org.marketcetera.persist.NDEntityBase |
|---|
getDescription, getName, setDescription, toString |
| Methods inherited from class org.marketcetera.persist.EntityBase |
|---|
applyRemote, createSaveResult, deleteLocal, deleteRemote, executeRemote, getId, getLastUpdated, getUpdateCount, isPersistent, postSaveLocal, preSaveLocal, saveLocal, saveRemote, setId, setUpdateCount |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.marketcetera.persist.SummaryEntityBase |
|---|
getId, getLastUpdated, getUpdateCount |
| Constructor Detail |
|---|
public SimpleUser()
| Method Detail |
|---|
public boolean isSuperuser()
public void setSuperuser(boolean superuser)
superuser - the superuser flag for this user.public boolean isActive()
public void setActive(boolean active)
active - the active flag for this user.public String getUserData()
String.
String value or nullpublic void setUserData(String inUserData)
inUserData - a String valuepublic String getSystemData()
String.
String value or nullpublic void setSystemData(String inSystemData)
inSystemData - a String valuepublic UserID getUserID()
public boolean isPasswordSet()
public void setName(String name)
setName in class NDEntityBasename - the user name
public void setPassword(char[] password)
throws ValidationException
setName(String)
password - The user password value, cannot be null.
ValidationException - If the user password is already set, or if
an empty password is supplied or if the user name is not set.
public void changePassword(char[] originalPassword,
char[] newPassword)
throws ValidationException
validating the supplied password.
originalPassword - the original password. This password should
match the currently configured password.
The new password is not saved to the database. To save
the new password to the database, invoke save()
newPassword - the new password, cannot be empty.
ValidationException - if there were
errors validating the original or the new password password.
public void validatePassword(char[] password)
throws ValidationException
password - the password to test.
ValidationException - If a nonempty password is presently
configured and either an empty password value was specified, or
the specified password doesn't match the currently configured
user password.
public void validate()
throws PersistenceException
This method validates if the user name is non-empty, contains only letters, numbers and space characters, and is less than 256 characters in length.
This method validates if the user password is non-empty.
validate in class NDEntityBasePersistenceException - if there were validation failures
public void save()
throws PersistenceException
ValidationException - if validation
failed when saving the user.
EntityExistsException - if a user
with the supplied name already exists in the database.
PersistenceException - If there were
errors saving the user to the database.
public void delete()
throws PersistenceException
PersistenceException - if there were errors deleting the user
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||