|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ecyrd.jspwiki.auth.user.DefaultUserProfile
public final class DefaultUserProfile
Default implementation for representing wiki user information, such as the login name, full name, wiki name, and e-mail address.
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
Map<String,Serializable> |
getAttributes()
Returns the attributes associated with this profile as a Map of key/value pairs. |
Date |
getCreated()
Returns the creation date |
String |
getEmail()
Returns the user's e-mail address. |
String |
getFullname()
Returns the user's full name. |
Date |
getLastModified()
Returns the last-modified date. |
Date |
getLockExpiry()
Returns the date/time of expiration of the profile's lock, if it has been previously locked via UserProfile.setLockExpiry(Date) and the lock is
still active. |
String |
getLoginName()
Returns the user's login name. |
String |
getPassword()
Returns the user password for use with custom authentication. |
String |
getUid()
Returns the unique identifier for the user profile. |
String |
getWikiName()
Returns the user's wiki name. |
int |
hashCode()
|
boolean |
isLocked()
Returns true if the profile is currently locked (disabled); false otherwise. |
boolean |
isNew()
Returns true if the user profile is
new. |
protected static UserProfile |
newProfile(UserDatabase db)
Static factory method that creates a new DefaultUserProfile and sets a unique identifier (uid) for the supplied UserDatabase. |
void |
setCreated(Date date)
Sets the created date. |
void |
setEmail(String email)
Sets the user's e-mail address. |
void |
setFullname(String arg)
Sets the user's full name. |
void |
setLastModified(Date date)
Sets the last-modified date. |
void |
setLockExpiry(Date expiry)
Locks the profile until a specified lock expiration date. |
void |
setLoginName(String name)
Sets the name by which the user logs in. |
void |
setPassword(String arg)
Sets the user's password for use with custom authentication. |
void |
setUid(String uid)
Sets the unique identifier for the user profile. |
void |
setWikiName(String name)
Deprecated. This method will be removed in a future release. |
String |
toString()
Returns a string representation of this user profile. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
protected static UserProfile newProfile(UserDatabase db)
db - the UserDatabase for which the uid should be
created
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic Date getCreated()
getCreated in interface UserProfileUserProfile.getCreated()public String getEmail()
getEmail in interface UserProfilepublic String getFullname()
getFullname in interface UserProfilepublic Date getLastModified()
getLastModified in interface UserProfileUserProfile.getLastModified()public String getLoginName()
getLoginName in interface UserProfilepublic String getPassword()
UserDatabaseimplementation, in most cases the
value returned by this method will be a password hash, not the password
itself.
getPassword in interface UserProfilepublic String getWikiName()
getWikiName in interface UserProfilepublic boolean isNew()
true if the user profile is
new. This implementation checks whether
getLastModified() returns null
to determine the status.
isNew in interface UserProfileUserProfile.isNew()public void setCreated(Date date)
UserProfile
setCreated in interface UserProfiledate - the creation dateUserProfile.setCreated(java.util.Date)public void setEmail(String email)
setEmail in interface UserProfileemail - the e-mail addresspublic void setFullname(String arg)
setFullname in interface UserProfilearg - the full namepublic void setLastModified(Date date)
setLastModified in interface UserProfiledate - the last-modified dateUserProfile.setLastModified(java.util.Date)public void setLoginName(String name)
AuthenticationManager.login(WikiSession, String, String)).
The login name is typically a short name ("jannej"). In contrast, the
wiki name is typically of type FirstnameLastName ("JanneJalkanen").
setLoginName in interface UserProfilename - the login namepublic void setPassword(String arg)
UserDatabase.save(UserProfile)).
Note that the password field is not meaningful for container
authentication; the user's private credentials are generally stored
elsewhere.
setPassword in interface UserProfilearg - the passwordpublic void setWikiName(String name)
setWikiName in interface UserProfilename - the wiki namepublic String toString()
toString in interface UserProfiletoString in class Objectpublic Map<String,Serializable> getAttributes()
getAttributes in interface UserProfilepublic Date getLockExpiry()
UserProfile.setLockExpiry(Date) and the lock is
still active. If the profile is unlocked, this method returns null.
Note that calling this method after the expiration date, even if had previously
been set explicitly by UserProfile.setLockExpiry(Date), will always return
null.
- Specified by:
getLockExpiry in interface UserProfile
- Returns:
- the lock expiration date
public String getUid()
null.
getUid in interface UserProfilepublic boolean isLocked()
true if the profile is currently locked (disabled); false otherwise.
By default, profiles are created unlocked. Strictly speaking, calling this method is equivalent to calling UserProfile.getLockExpiry()
and, if it returns a non-null value, checking if the date returned is later than the current time.
isLocked in interface UserProfilepublic void setLockExpiry(Date expiry)
setLockExpiry in interface UserProfileexpiry - the date the lock expires; setting this value to null
will cause the lock to be cleared.public void setUid(String uid)
setUid in interface UserProfileuid - the unique identifier to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||