public final class DefaultUserProfile extends java.lang.Object implements UserProfile
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.util.Map<java.lang.String,java.io.Serializable> |
getAttributes()
Returns the attributes associated with this profile as a Map of key/value pairs.
|
java.util.Date |
getCreated()
Returns the creation date
|
java.lang.String |
getEmail()
Returns the user's e-mail address.
|
java.lang.String |
getFullname()
Returns the user's full name.
|
java.util.Date |
getLastModified()
Returns the last-modified date.
|
java.util.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. |
java.lang.String |
getLoginName()
Returns the user's login name.
|
java.lang.String |
getPassword()
Returns the user password for use with custom authentication.
|
java.lang.String |
getUid()
Returns the unique identifier for the user profile.
|
java.lang.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. |
void |
setCreated(java.util.Date date)
Sets the created date.
|
void |
setEmail(java.lang.String email)
Sets the user's e-mail address.
|
void |
setFullname(java.lang.String arg)
Sets the user's full name.
|
void |
setLastModified(java.util.Date date)
Sets the last-modified date.
|
void |
setLockExpiry(java.util.Date expiry)
Locks the profile until a specified lock expiration date.
|
void |
setLoginName(java.lang.String name)
Sets the name by which the user logs in.
|
void |
setPassword(java.lang.String arg)
Sets the user's password for use with custom authentication.
|
void |
setUid(java.lang.String uid)
Sets the unique identifier for the user profile.
|
java.lang.String |
toString()
Returns a string representation of this user profile.
|
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.util.Date getCreated()
getCreated in interface UserProfileUserProfile.getCreated()public java.lang.String getEmail()
getEmail in interface UserProfilepublic java.lang.String getFullname()
getFullname in interface UserProfilepublic java.util.Date getLastModified()
getLastModified in interface UserProfileUserProfile.getLastModified()public java.lang.String getLoginName()
getLoginName in interface UserProfilepublic java.lang.String getPassword()
UserDatabase
implementation, in most cases the value returned by this method will be a password hash, not the password itself.getPassword in interface UserProfilepublic java.lang.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(java.util.Date date)
UserProfilesetCreated in interface UserProfiledate - the creation dateUserProfile.setCreated(java.util.Date)public void setEmail(java.lang.String email)
setEmail in interface UserProfileemail - the e-mail addresspublic void setFullname(java.lang.String arg)
setFullname in interface UserProfilearg - the full namepublic void setLastModified(java.util.Date date)
setLastModified in interface UserProfiledate - the last-modified dateUserProfile.setLastModified(java.util.Date)public void setLoginName(java.lang.String name)
AuthenticationManager.login(org.apache.wiki.api.core.Session,HttpServletRequest, 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(java.lang.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 java.lang.String toString()
toString in interface UserProfiletoString in class java.lang.Objectpublic java.util.Map<java.lang.String,java.io.Serializable> getAttributes()
getAttributes in interface UserProfilepublic java.util.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.getLockExpiry in interface UserProfilepublic java.lang.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(java.util.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(java.lang.String uid)
setUid in interface UserProfileuid - the unique identifier to setCopyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.