|
Jive Forums API (5.5.8) Developer Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jivesoftware.base.database.DbUser
public class DbUser
Database implementation of the User interface.
User,
Serialized Form| Constructor Summary | |
|---|---|
|
DbUser()
Constructor for internal user only. |
protected |
DbUser(long userID)
Load a DbUser object specified by userID. |
protected |
DbUser(long id,
java.lang.String username,
java.lang.String password,
java.lang.String name,
java.lang.String email,
boolean nameVisible,
boolean emailVisible,
java.util.Map properties)
Create a new DbUser with all required AND optional fields. |
protected |
DbUser(java.lang.String username)
Load a DbUser object specified by username. |
protected |
DbUser(java.lang.String username,
java.lang.String password,
java.lang.String email)
Create a new DbUser with all required fields. |
protected |
DbUser(java.lang.String username,
java.lang.String password,
java.lang.String name,
java.lang.String email,
boolean nameVisible,
boolean emailVisible,
java.util.Map properties)
Create a new DbUser with all required AND optional fields. |
| Method Summary | |
|---|---|
void |
deleteProperty(java.lang.String name)
Deletes an extended property. |
boolean |
equals(java.lang.Object object)
|
int |
getCachedSize()
Returns the approximate size of the Object in bytes. |
java.util.Date |
getCreationDate()
Returns the date that the user was created. |
java.lang.String |
getEmail()
Returns the user's email address. |
long |
getID()
Returns the user's id. |
java.util.Date |
getModificationDate()
Returns the date that the user was last modified. |
java.lang.String |
getName()
Returns the user's name. |
java.lang.String |
getPasswordHash()
Returns the user's password in hashed form. |
Permissions |
getPermissions(AuthToken auth)
Returns the permissions for the user that correspond to the passed-in AuthToken. |
java.lang.String |
getProperty(java.lang.String name)
Returns an extended property of the user. |
java.util.Iterator |
getPropertyNames()
Returns an Iterator for all the names of the extended user properties. |
java.lang.String |
getUsername()
Returns the user's username. |
int |
hashCode()
|
boolean |
isAuthorized(long permissionType)
Returns true if the handle on the object has the permission specified. |
boolean |
isEmailVisible()
Returns true if the user has chosen to make her email visible to other users. |
boolean |
isGetPasswordHashSupported()
Indicates whether retrieving a password hash is supported for this user. |
boolean |
isNameVisible()
Returns true if the user has chosen to make her name visible to other users. |
boolean |
isPropertyEditSupported()
Indicates whether the property methods (get, set, delete, etc.) are supported. |
boolean |
isReadOnly()
Convenience method - returns true if the user is in a 'read only' mode - that is, none of the setter methods are implemented. |
boolean |
isSetEmailSupported()
Indicates whether setting the email address is supported for this user. |
boolean |
isSetEmailVisibleSupported()
Indicates whether setting the visibility of the email address is supported for this user. |
boolean |
isSetNameSupported()
Indicates whether setting the full name is supported for this user. |
boolean |
isSetNameVisibleSupported()
Indicates whether setting the visibility of the name is supported for this user. |
boolean |
isSetPasswordHashSupported()
Indicates whether modifying the hash of the user's password is supported for this user. |
boolean |
isSetPasswordSupported()
Indicates whether modifying the user's password is supported. |
void |
readExternal(java.io.DataInput in)
|
void |
setCreationDate(java.util.Date creationDate)
Sets the creation date of the user. |
void |
setEmail(java.lang.String email)
Sets the user's email address. |
void |
setEmailVisible(boolean visible)
Sets whether a user's email is visible to other users. |
void |
setModificationDate(java.util.Date modificationDate)
Sets the date the user was last modified. |
void |
setName(java.lang.String name)
Sets the user's name. |
void |
setNameVisible(boolean visible)
Sets whether a user's name is visible to other users. |
void |
setPassword(java.lang.String password)
Sets the users's password. |
void |
setPasswordHash(java.lang.String passwordHash)
Sets the user's password in hashed form. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets an extended property of the user. |
void |
setUsername(java.lang.String username)
|
java.lang.String |
toString()
Returns a String representation of the User object using the username. |
void |
writeExternal(java.io.DataOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected DbUser(java.lang.String username,
java.lang.String password,
java.lang.String email)
username - the username for the user.password - a password for the user.email - the email address for the user.
protected DbUser(java.lang.String username,
java.lang.String password,
java.lang.String name,
java.lang.String email,
boolean nameVisible,
boolean emailVisible,
java.util.Map properties)
username - the username for the user.password - a password for the user.email - the email address for the user.
protected DbUser(long id,
java.lang.String username,
java.lang.String password,
java.lang.String name,
java.lang.String email,
boolean nameVisible,
boolean emailVisible,
java.util.Map properties)
protected DbUser(long userID)
throws UserNotFoundException
userID - the userID of the user to load.
UserNotFoundException
protected DbUser(java.lang.String username)
throws UserNotFoundException
username - the username of the user to load.
UserNotFoundExceptionpublic DbUser()
| Method Detail |
|---|
public void readExternal(java.io.DataInput in)
throws java.io.IOException
readExternal in interface com.tangosol.io.ExternalizableLitejava.io.IOException
public void writeExternal(java.io.DataOutput out)
throws java.io.IOException
writeExternal in interface com.tangosol.io.ExternalizableLitejava.io.IOExceptionpublic boolean isSetPasswordSupported()
IntrospectiveUser
isSetPasswordSupported in interface IntrospectiveUserpublic boolean isGetPasswordHashSupported()
IntrospectiveUser
isGetPasswordHashSupported in interface IntrospectiveUserpublic boolean isSetPasswordHashSupported()
IntrospectiveUser
isSetPasswordHashSupported in interface IntrospectiveUserpublic boolean isSetNameSupported()
IntrospectiveUser
isSetNameSupported in interface IntrospectiveUserpublic boolean isSetEmailSupported()
IntrospectiveUser
isSetEmailSupported in interface IntrospectiveUserpublic boolean isSetNameVisibleSupported()
IntrospectiveUser
isSetNameVisibleSupported in interface IntrospectiveUserpublic boolean isSetEmailVisibleSupported()
IntrospectiveUser
isSetEmailVisibleSupported in interface IntrospectiveUserpublic boolean isPropertyEditSupported()
IntrospectiveUser
isPropertyEditSupported in interface IntrospectiveUserpublic boolean isReadOnly()
IntrospectiveUser
isReadOnly in interface IntrospectiveUserpublic long getID()
User
getID in interface Userpublic java.lang.String getUsername()
User
getUsername in interface User
public void setUsername(java.lang.String username)
throws UnauthorizedException,
UserAlreadyExistsException
UnauthorizedException
UserAlreadyExistsExceptionpublic java.lang.String getName()
User
getName in interface User
public void setName(java.lang.String name)
throws UnauthorizedException
User
setName in interface Username - new name for the user.
UnauthorizedException - if does not have administrator permissions.public boolean isNameVisible()
User
isNameVisible in interface User
public void setNameVisible(boolean visible)
throws UnauthorizedException
User
setNameVisible in interface Uservisible - boolean value to determin if the name should be visible.
UnauthorizedException - if does not have administrator permissions.
public void setPassword(java.lang.String password)
throws UnauthorizedException
User
setPassword in interface Userpassword - new password for the user.
UnauthorizedException - if does not have administrator permissions.
public java.lang.String getPasswordHash()
throws UnauthorizedException
UserIf your back-end user store does not support this operation, throw an UnsupportedOperationException.
getPasswordHash in interface UserUnauthorizedException - if does not have administrator permissions.public void setPasswordHash(java.lang.String passwordHash)
UserIf your back-end user store does not support this operation, throw an UnsupportedOperationException.
setPasswordHash in interface UserpasswordHash - the hashedPassword for the user.public java.lang.String getEmail()
UserIf your back-end user store does not support this operation, always return null.
getEmail in interface User
public void setEmail(java.lang.String email)
throws UnauthorizedException
UserIf your back-end user store does not support this operation, throw an UnsupportedOperationException.
setEmail in interface Useremail - new email address for the user.
UnauthorizedException - if does not have administrator permissions.public boolean isEmailVisible()
User
isEmailVisible in interface User
public void setEmailVisible(boolean visible)
throws UnauthorizedException
User
setEmailVisible in interface Uservisible - boolean value to determin if the name should be visible.
UnauthorizedException - if does not have administrator permissions.public java.util.Date getCreationDate()
UserIf your back-end user store does not support this operation, throw an UnsupportedOperationException.
getCreationDate in interface User
public void setCreationDate(java.util.Date creationDate)
throws UnauthorizedException
User
setCreationDate in interface UsercreationDate - the date the user was created.
UnauthorizedException - if does not have administrator permissions.public java.util.Date getModificationDate()
User
getModificationDate in interface User
public void setModificationDate(java.util.Date modificationDate)
throws UnauthorizedException
User
setModificationDate in interface UsermodificationDate - the date the user was modified.
UnauthorizedException - if does not have administrator permissions.public java.lang.String getProperty(java.lang.String name)
User
getProperty in interface Username - the name of the property to get.
public void setProperty(java.lang.String name,
java.lang.String value)
User
setProperty in interface Username - the name of the property to set.value - the new value for the property.public void deleteProperty(java.lang.String name)
Username does not exist,
this method will do nothing.
deleteProperty in interface Username - the name of the property to delete.public java.util.Iterator getPropertyNames()
User
This method should typically be implemented as:
if (auth.getUserID() == id) {
return new Permissions(Permissions.USER_ADMIN);
}
else {
return new Permissions(Permissions.NONE);
}
getPropertyNames in interface Userpublic Permissions getPermissions(AuthToken auth)
User
getPermissions in interface Userauth - the auth token to look up permissions with.public boolean isAuthorized(long permissionType)
User
Because proxy objects will implement real security checking, this
method should be implemented as:
return true;.
isAuthorized in interface UserpermissionType - the permission to check for.Permissionspublic int getCachedSize()
Cacheable
getCachedSize in interface Cacheablepublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Object
|
Jive Forums Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||