|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dartra.standard.PersistentObject
org.dartra.standard.StandardUser
Standard implementation of the User interface.
Constructor Summary | |
StandardUser(java.lang.String userId,
java.lang.String name,
java.lang.String password)
Create a new user with given id, name and password (unencrypted). |
|
StandardUser(java.lang.String userId,
java.lang.String name,
java.lang.String password,
boolean female,
boolean leftHanded)
Create a new user with given id, name and password (unencrypted). |
|
StandardUser(java.lang.String userId,
java.lang.String name,
java.lang.String password,
boolean female,
boolean leftHanded,
boolean encryptedPassword)
Create a new user with given id, name and password. |
Method Summary | |
void |
addDartsSet(DartsSet dartsSet)
Adds a DartsSet to the collection owned by the user. |
boolean |
checkPassword(java.lang.String pw)
Check the password for the user. |
protected java.lang.String |
encryptPassword(java.lang.String password)
Encrypt given password. |
DartsSet |
getDartsSet(int index)
Returns the DartsSet at the given index. |
java.util.Vector |
getDartsSets()
Returns the collection of darts sets owned by the user. |
java.lang.String |
getPassword()
Get the password of the user, probably in an incrypted form. |
java.lang.String |
getUserId()
Return the user id (which is unique) of this user. |
java.lang.String |
getUserName()
Returns the username of this user. |
boolean |
isFemale()
Returns true when this user is female, false otherwise (for males). |
boolean |
isLeftHanded()
Is this a left handed user? |
void |
setPassword(java.lang.String pw)
Set the password of the user. |
void |
setUserName(java.lang.String name)
Set the username of this user. |
java.lang.String |
toString()
|
Methods inherited from class org.dartra.standard.PersistentObject |
getId, setId |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.dartra.framework.Persistent |
getId, setId |
Constructor Detail |
public StandardUser(java.lang.String userId, java.lang.String name, java.lang.String password)
Create a new user with given id, name and password (unencrypted). This defaults to a male, right handed player.
public StandardUser(java.lang.String userId, java.lang.String name, java.lang.String password, boolean female, boolean leftHanded)
Create a new user with given id, name and password (unencrypted). You should also specify the gender and the handed-ness of the player.
public StandardUser(java.lang.String userId, java.lang.String name, java.lang.String password, boolean female, boolean leftHanded, boolean encryptedPassword)
Create a new user with given id, name and password. You should also specify the gender and the handed-ness of the player.
When encryptedPassword is true, the given password is taken to be already encrypted. When false, it will be incrypted. This constuctor is intended for use in the DAOs.
Method Detail |
protected java.lang.String encryptPassword(java.lang.String password)
Encrypt given password.
Subclasses can redefine this method to do proper password encryption. This implementation does not encrypt the password.
public java.lang.String getUserId()
User
Return the user id (which is unique) of this user.
getUserId
in interface User
public void setUserName(java.lang.String name)
User
Set the username of this user.
setUserName
in interface User
public java.lang.String getUserName()
User
Returns the username of this user.
getUserName
in interface User
public void setPassword(java.lang.String pw)
User
Set the password of the user.
setPassword
in interface User
public java.lang.String getPassword()
User
Get the password of the user, probably in an incrypted form.
getPassword
in interface User
public boolean checkPassword(java.lang.String pw)
User
Check the password for the user.
checkPassword
in interface User
public java.lang.String toString()
public java.util.Vector getDartsSets()
User
Returns the collection of darts sets owned by the user. The resulting collection contains DartsSet objects.
getDartsSets
in interface User
public DartsSet getDartsSet(int index)
User
Returns the DartsSet at the given index.
getDartsSet
in interface User
public void addDartsSet(DartsSet dartsSet)
User
Adds a DartsSet to the collection owned by the user.
addDartsSet
in interface User
public boolean isFemale()
User
Returns true when this user is female, false otherwise (for males).
isFemale
in interface User
public boolean isLeftHanded()
User
Is this a left handed user?
isLeftHanded
in interface User
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |