|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.kosi.model.UserImpl
The UserImpl class represents a User of the syste. It contains all neccessairy information about the user.
Fields inherited from interface de.kosi.model.User |
STRENGTH_ADVANCED, STRENGTH_BEGINNER, STRENGTH_PROFESSIONAL |
Constructor Summary | |
UserImpl(java.lang.String loginname,
java.lang.String eMail,
java.util.Locale locale,
int strength,
java.util.TimeZone timeZone,
java.lang.String biddingSystem)
Creates a new User and sends him his password with an e-mail. |
|
UserImpl(java.lang.String loginname,
java.lang.String password,
java.lang.String eMail,
boolean admin)
Creates a new User. |
Method Summary | |
void |
addUserListener(UserListener listener)
Adds a user listener to this User instance. |
boolean |
checkPassword(java.lang.String password)
Checks the password. |
protected static java.lang.String |
createRandomPassword()
Create a random password. |
void |
destroy()
Destroy this user instance. |
boolean |
equals(java.lang.Object obj)
Two User objects are equal, if the loginnames are equal. |
Conventions |
getConventions()
Returns the Conventions of the user. |
java.lang.String |
getEMail()
Returns the e-mail address. |
java.util.Locale |
getLocale()
Returns the locale. |
java.lang.String |
getLoginName()
Returns the login name of the user. |
protected java.lang.String |
getPassword()
|
Session |
getSession()
Returns the session that is currently assigned to this user. |
int |
getStrength()
Returns the strength of the user. |
java.util.TimeZone |
getTimeZone()
Returns the time zone. |
boolean |
isAdmin()
Reutrns if this user is an admin. |
boolean |
isOnline()
Checks whether this user is currently online or not. |
void |
removeUserListener(UserListener listener)
Removes a user listener from the list of user listeners. |
void |
sendMail(java.lang.String text,
java.lang.Object[] params)
Send an email to this user. |
void |
setEMail(java.lang.String email)
Sets the e-mail address. |
void |
setLocale(java.util.Locale locale)
Sets the locale of the user. |
void |
setOnline(boolean online)
Sets whether this user is currently online or offline. |
void |
setPassword(java.lang.String password,
java.lang.String oldPassword)
Sets the password. |
void |
setSession(Session session)
Sets the session of this user. |
void |
setStrength(int strength)
Set the strength of the user. |
void |
setTimeZone(java.util.TimeZone timeZone)
Sets the time zone of the user. |
java.lang.String |
toString()
Returns a String representation of the user. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public UserImpl(java.lang.String loginname, java.lang.String password, java.lang.String eMail, boolean admin) throws java.lang.IllegalArgumentException
loginname
- The loginname of the user.password
- The password of the user.eMail
- The e-mail address of the user.admin
- Wether this user is an administrator.java.lang.IllegalArgumentException
- If an parameter does not contain a valid value.public UserImpl(java.lang.String loginname, java.lang.String eMail, java.util.Locale locale, int strength, java.util.TimeZone timeZone, java.lang.String biddingSystem) throws javax.mail.MessagingException
loginname
- Loginname of the user.eMail
- eMail address of the user.locale
- Locale of the user.strength
- Strength of the user (one of the User.STRENGHT_* constants).timeZone
- Time zone the user lives in.biddingSystem
- Bidding system. This is used to set up first conventions for the user.javax.mail.MessagingException
- If the E-Mail could not be sent.Method Detail |
protected static java.lang.String createRandomPassword()
public java.lang.String getLoginName()
getLoginName
in interface User
public boolean checkPassword(java.lang.String password) throws KosiAccessException
checkPassword
in interface User
password
- The password.KosiAccessException
- if not called by the user himself or an admin.protected java.lang.String getPassword()
public void setPassword(java.lang.String password, java.lang.String oldPassword) throws KosiAccessException, InvalidSessionException, PasswordException
setPassword
in interface User
password
- The new password.oldPassword
- The old password used to verify, that the user knows the password.KosiAccessException
- If not called by the user himself or an admin.InvalidSessionException
- If not called from a valid session context.public void setEMail(java.lang.String email) throws KosiAccessException, InvalidSessionException
setEMail
in interface User
email
- the new e-mail address.KosiAccessException
- if not called by the user himself or an admin.InvalidSessionException
- If not called from a valid session context.public java.lang.String getEMail() throws KosiAccessException, InvalidSessionException
getEMail
in interface User
KosiAccessException
- If not called by the user himself or an admin.InvalidSessionException
- If not called from a valid session context.public void setLocale(java.util.Locale locale) throws KosiAccessException, InvalidSessionException
setLocale
in interface User
locale
- The new Locale.KosiAccessException
- if not called by the user himself or an admin.InvalidSessionException
- If not called from a valid session context.public java.util.Locale getLocale()
getLocale
in interface User
public void setTimeZone(java.util.TimeZone timeZone) throws KosiAccessException, InvalidSessionException
setTimeZone
in interface User
timeZone
- th.KosiAccessException
- if not called by the user himself or an admin.InvalidSessionException
- If not called from a valid session context.public java.util.TimeZone getTimeZone()
getTimeZone
in interface User
public int getStrength()
getStrength
in interface User
public void setStrength(int strength) throws KosiAccessException, InvalidSessionException
setStrength
in interface User
strength
- One of the STRENGTH_* constants.KosiAccessException
- if not called by the user himself or an admin.InvalidSessionException
- If not called from a valid session context.public Conventions getConventions()
getConventions
in interface User
public void addUserListener(UserListener listener)
listener
- The UserListener to add to the list of listeners.public void removeUserListener(UserListener listener)
listener
- The user listener that is to be removed.public void setSession(Session session)
session
- The session to assign to this user.public Session getSession()
public void sendMail(java.lang.String text, java.lang.Object[] params) throws javax.mail.MessagingException
text
- Name of the Text for this mail (the actual text and subject are loaded from a ResourceBundle):params
- Parameters, that can be used in the mail (see java.text.MessageFormat for further information)javax.mail.MessagingException
- If the email could not be sent.public void setOnline(boolean online)
online
- true if the user is going online, otherwise false.public void destroy()
public boolean isOnline()
public boolean isAdmin()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Object to compare.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |