Jive API (3.0.13) Core Javadocs

com.jivesoftware.base
Class UserTemplate

java.lang.Object
  extended by com.jivesoftware.base.UserTemplate
All Implemented Interfaces:
User, AttachmentContentResource, JiveObject, com.tangosol.io.ExternalizableLite, Serializable

public class UserTemplate
extends Object
implements User, com.tangosol.io.ExternalizableLite

Value Object implementation of the user interface, optimized for Jive's internal caching mechanism. User provider implementations are strongly urged to return instances of this class or a subclass with a proper ExternalizableLite implementation.

See Also:
User, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jivesoftware.base.User
User.Status
 
Field Summary
protected static org.apache.log4j.Logger log
           
 
Fields inherited from interface com.jivesoftware.base.User
EMAIL_VISIBILITY_ALLOW_TOGGLE, EMAIL_VISIBILITY_DEFAULT, NAME_VISIBILITY_ALLOW_TOGGLE
 
Constructor Summary
UserTemplate()
          Creates an empty user template value object.
UserTemplate(long userId)
          Creates a new user template populating the User ID.
UserTemplate(String userName)
          Creates a new user template populating the username.
UserTemplate(String userName, String password, String email)
          Convenience constructor with username, password and email.
UserTemplate(String userName, String password, String email, String name)
          Convenience constructor with username, password, email and name.
UserTemplate(String userName, String password, String email, String name, boolean emailVisible, boolean nameVisible, Map<String,String> props)
          Creates a user template with username, password, email, name, email and name visibility and extended properties.
UserTemplate(String userName, String password, String email, String firstName, String lastName, boolean emailVisible, boolean nameVisible, Map<String,String> props)
          Creates a user template with username, password, email, first name, last name, email and name visibility and extended properties.
UserTemplate(User user)
          Creates a user template from the given user object.
 
Method Summary
 boolean equals(Object object)
           
 int getCachedSize()
           
 Date getCreationDate()
          Returns the date that the user was created.
 String getEmail()
          Returns the user's email address.
 String getFirstName()
          Returns the user's first name.
 long getID()
          Returns the user's id.
 Date getLastLoggedIn()
          Returns the date the user last logged in.
 String getLastName()
          Returns the user's last name.
 Date getLastProfileUpdate()
          Returns the date the user's profile was last updated, or null if not set.
 Date getModificationDate()
          Returns the date that the user was last modified.
 String getName()
          Returns the user's name.
 int getObjectType()
          Return the object type of the jive object.
 String getPassword()
          Exposes a raw password.
 String getPasswordHash()
          Returns the user's password in hashed form.
 Permissions getPermissions(AuthToken authToken)
          Returns the permissions for the user that correspond to the passed-in AuthToken.
 Map<String,String> getProperties()
          Retrieve a map of all the extended properties for the user.
 User.Status getStatus()
          Returns the current status of the user in regards to moderation.
 String getUsername()
          Returns the user's username.
 int hashCode()
           
 boolean isAnonymous()
          Returns true if the user represents an anonymous user.
 boolean isAuthorized(long perm)
          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 isEnabled()
          Returns true if the user is disabled, meaning they cannot log in.
 boolean isExternal()
          Indicates if the user is simply a representation of an external identity and not a Jive SBS system user.
 boolean isFederated()
          Indicates if a user is a federated - if their identity is managed outside the Jive SBS application.
 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()
           
 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.
 boolean isSetUsernameSupported()
          Indicates whether setting the username is supported for this user.
 void readExternal(DataInput in)
           
 void setCreationDate(Date creationDate)
           
 void setEmail(String email)
           
 void setEmailVisible(boolean emailVisible)
           
 void setEnabled(boolean enabled)
           
 void setExternal(boolean external)
           
 void setFederated(boolean federated)
           
 void setFirstName(String firstName)
           
 void setGetPasswordHashSupported(boolean getPasswordHashSupported)
           
 void setID(long ID)
           
 void setLastLoggedIn(Date lastLoggedIn)
           
 void setLastName(String lastName)
           
 void setLastProfileUpdate(Date lastProfileUpdate)
           
 void setModificationDate(Date modificationDate)
           
 void setName(String name)
           
 void setNameVisible(boolean nameVisible)
           
 void setPassword(String password)
           
 void setPasswordHash(String passwordHash)
           
 void setProperties(Map<String,String> properties)
           
 void setSetEmailSuppoted(boolean setEmailSuppoted)
           
 void setSetEmailVisibleSupported(boolean setEmailVisibleSupported)
           
 void setSetNameSupported(boolean setNameSupported)
           
 void setSetNameVisibleSupported(boolean setNameVisibleSupported)
           
 void setSetPasswordHashSupported(boolean setPasswordHashSupported)
           
 void setSetPasswordSupported(boolean setPasswordSupported)
           
 void setSetPropertyEditSupported(boolean setPropertyEditSupported)
           
 void setSetUsernameSupported(boolean setUsernameSupported)
           
 void setStatus(User.Status status)
           
 void setUsername(String username)
           
 String toString()
          Returns a String representation of the User object.
 void writeExternal(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log
Constructor Detail

UserTemplate

public UserTemplate()
Creates an empty user template value object.


UserTemplate

public UserTemplate(String userName)
Creates a new user template populating the username.

Parameters:
userName -

UserTemplate

public UserTemplate(String userName,
                    String password,
                    String email,
                    String name)
Convenience constructor with username, password, email and name.

Parameters:
userName -
password -
email -
name -

UserTemplate

public UserTemplate(String userName,
                    String password,
                    String email,
                    String name,
                    boolean emailVisible,
                    boolean nameVisible,
                    Map<String,String> props)
Creates a user template with username, password, email, name, email and name visibility and extended properties.

Parameters:
userName -
password -
email -
name -
emailVisible -
nameVisible -
props -

UserTemplate

public UserTemplate(String userName,
                    String password,
                    String email,
                    String firstName,
                    String lastName,
                    boolean emailVisible,
                    boolean nameVisible,
                    Map<String,String> props)
Creates a user template with username, password, email, first name, last name, email and name visibility and extended properties.

Parameters:
userName -
password -
email -
firstName -
lastName -
emailVisible -
nameVisible -
props -

UserTemplate

public UserTemplate(String userName,
                    String password,
                    String email)
Convenience constructor with username, password and email.

Parameters:
userName -
password -
email -

UserTemplate

public UserTemplate(long userId)
Creates a new user template populating the User ID.

Parameters:
userId -

UserTemplate

public UserTemplate(User user)
Creates a user template from the given user object.

Parameters:
user -
Method Detail

readExternal

public void readExternal(DataInput in)
                  throws IOException
Specified by:
readExternal in interface com.tangosol.io.ExternalizableLite
Throws:
IOException

writeExternal

public void writeExternal(DataOutput out)
                   throws IOException
Specified by:
writeExternal in interface com.tangosol.io.ExternalizableLite
Throws:
IOException

getCachedSize

public int getCachedSize()

getPermissions

public Permissions getPermissions(AuthToken authToken)
Description copied from interface: User
Returns the permissions for the user that correspond to the passed-in AuthToken.

Specified by:
getPermissions in interface User
Parameters:
authToken - the auth token to look up permissions with.
Returns:
The permissions for the auth token.

getPassword

public String getPassword()
                   throws UnauthorizedException
Description copied from interface: User
Exposes a raw password. Will generally be null except in the case where a user is being created or updated.

Specified by:
getPassword in interface User
Returns:
null if the password is not set in this context.
Throws:
UnauthorizedException

setPassword

public void setPassword(String password)

isReadOnly

public boolean isReadOnly()

getCreationDate

public Date getCreationDate()
Description copied from interface: User
Returns the date that the user was created.

If your back-end user store does not support this operation, throw an UnsupportedOperationException.

Specified by:
getCreationDate in interface User
Returns:
the date the user was created.

setCreationDate

public void setCreationDate(Date creationDate)

getEmail

public String getEmail()
Description copied from interface: User
Returns the user's email address. Email should be considered to be a required field of a user account since it is critical to many user operations performing. If the user sets emailVisible to false, this method will always return null.

If your back-end user store does not support this operation, always return null.

Specified by:
getEmail in interface User
Returns:
the email address of the user.

setEmail

public void setEmail(String email)

isEmailVisible

public boolean isEmailVisible()
Description copied from interface: User
Returns true if the user has chosen to make her email visible to other users. If the email field is not visible, calling getEmail() will throw an UnauthorizedException.

Specified by:
isEmailVisible in interface User
Returns:
true if the name is visible to other users.

setEmailVisible

public void setEmailVisible(boolean emailVisible)

isEnabled

public boolean isEnabled()
Description copied from interface: User
Returns true if the user is disabled, meaning they cannot log in. Disabled Users do not count against perseat licensing.

Specified by:
isEnabled in interface User
Returns:
Returns false if the user is disabled

setEnabled

public void setEnabled(boolean enabled)

getID

public long getID()
Description copied from interface: User
Returns the user's id. All ids must be unique in the system.

Specified by:
getID in interface User
Specified by:
getID in interface JiveObject
Returns:
the user's id.

setID

public void setID(long ID)

getLastLoggedIn

public Date getLastLoggedIn()
Description copied from interface: User
Returns the date the user last logged in.

Specified by:
getLastLoggedIn in interface User
Returns:
the date the user last logged in.

setLastLoggedIn

public void setLastLoggedIn(Date lastLoggedIn)

getLastProfileUpdate

public Date getLastProfileUpdate()
Description copied from interface: User
Returns the date the user's profile was last updated, or null if not set.

Specified by:
getLastProfileUpdate in interface User
Returns:
the date the user's profile was last updated, or null if not set.

setLastProfileUpdate

public void setLastProfileUpdate(Date lastProfileUpdate)

getModificationDate

public Date getModificationDate()
Description copied from interface: User
Returns the date that the user was last modified.

Specified by:
getModificationDate in interface User
Returns:
the date the user record was last modified.

setModificationDate

public void setModificationDate(Date modificationDate)

getName

public String getName()
Description copied from interface: User
Returns the user's name. The user's name does not have to be to be unique in the system. Some users may opt to not let others see their name for privacy reasons. In that case, the user can set nameVisible to false. In that case, a call to this method will return null. If firstName and lastName exist in persistence, a concatinated String of these values will be returned.

Specified by:
getName in interface User
Returns:
the name of the user.

setName

public void setName(String name)

getFirstName

public String getFirstName()
Description copied from interface: User
Returns the user's first name. Follows visibility rules defined as defined in getName(). General API usage will be to use User.getName() to retrieve the full name, as the first name will be returned only if it exists in persistence.

Specified by:
getFirstName in interface User
Returns:
the first name of the user, or null if the first name doesn't exist.

setFirstName

public void setFirstName(String firstName)

getLastName

public String getLastName()
Description copied from interface: User
Returns the user's last name. Follows visibility rules defined as defined in getName(). General API usage will be to use User.getName() to retrieve the full name, as the first name will be returned only if it exists in persistence.

Specified by:
getLastName in interface User
Returns:
the last name of the user, or null if the last name doesn't exist.

setLastName

public void setLastName(String lastName)

isNameVisible

public boolean isNameVisible()
Description copied from interface: User
Returns true if the user has chosen to make her name visible to other users. If the name is not visible, calling getName() will throw an UnauthorizedException.

Specified by:
isNameVisible in interface User
Returns:
true if the name is visible to other users.

setNameVisible

public void setNameVisible(boolean nameVisible)

getPasswordHash

public String getPasswordHash()
Description copied from interface: User
Returns the user's password in hashed form. This method is only intended for system administration functions and can be ignored by skin writers.

If your back-end user store does not support this operation, throw an UnsupportedOperationException.

Specified by:
getPasswordHash in interface User
Returns:
the hashed password.

setPasswordHash

public void setPasswordHash(String passwordHash)

getProperties

public Map<String,String> getProperties()
Description copied from interface: User
Retrieve a map of all the extended properties for the user. Each user can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface. The map is alterable if the user is authorized to modify the user. Null keys and values are not allowed.

If the user is not authorized to modify the user any method which modifies the map will fail with a UnsupportedOperationException;

Changes to the properties requires updates.

Specified by:
getProperties in interface User
Returns:
a map of user extended properties.

setProperties

public void setProperties(Map<String,String> properties)

getUsername

public String getUsername()
Description copied from interface: User
Returns the user's username. All usernames must be unique in the system.

Specified by:
getUsername in interface User
Returns:
the username of the user.

setUsername

public void setUsername(String username)

getObjectType

public int getObjectType()
Description copied from interface: JiveObject
Return the object type of the jive object.

Specified by:
getObjectType in interface JiveObject
Returns:
the object type of the jive object.

isFederated

public boolean isFederated()
Description copied from interface: User
Indicates if a user is a federated - if their identity is managed outside the Jive SBS application. Every user has an internal application representation but for many installations, Jive SBS will not be the system of record.

Specified by:
isFederated in interface User
Returns:

setFederated

public void setFederated(boolean federated)

isExternal

public boolean isExternal()
Description copied from interface: User
Indicates if the user is simply a representation of an external identity and not a Jive SBS system user. Originally motivated by external collaboration users. All external users are federated, but not all federated users are external. External users do not count against Jive SBS licenses seats.

Specified by:
isExternal in interface User
Returns:

setExternal

public void setExternal(boolean external)

isAuthorized

public boolean isAuthorized(long perm)
Description copied from interface: User
Returns true if the handle on the object has the permission specified. A list of possible permissions can be found in the Permissions class. Certain methods of this class are restricted to certain permissions as specified in the method comments.

Because proxy objects will implement real security checking, this method should be implemented as:
return true;
.

Specified by:
isAuthorized in interface User
Parameters:
perm - the permission to check for.
Returns:
True if the user is authorized.
See Also:
Permissions

setStatus

public void setStatus(User.Status status)

getStatus

public User.Status getStatus()
Description copied from interface: User
Returns the current status of the user in regards to moderation.

Specified by:
getStatus in interface User
Returns:
the current status of the user in regards to moderation.

toString

public String toString()
Returns a String representation of the User object.

Overrides:
toString in class Object
Returns:
a String representation of the User object.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

isSetPasswordSupported

public boolean isSetPasswordSupported()
Description copied from interface: User
Indicates whether modifying the user's password is supported.

Specified by:
isSetPasswordSupported in interface User
Returns:
true if modifying the user's password is supported.

isGetPasswordHashSupported

public boolean isGetPasswordHashSupported()
Description copied from interface: User
Indicates whether retrieving a password hash is supported for this user.

Specified by:
isGetPasswordHashSupported in interface User
Returns:
true if you can retrieve a password hash.

isSetPasswordHashSupported

public boolean isSetPasswordHashSupported()
Description copied from interface: User
Indicates whether modifying the hash of the user's password is supported for this user.

Specified by:
isSetPasswordHashSupported in interface User
Returns:
true if setting the hash is supported.

isSetNameSupported

public boolean isSetNameSupported()
Description copied from interface: User
Indicates whether setting the full name is supported for this user.

Specified by:
isSetNameSupported in interface User
Returns:
true if setting the name is supported.

isSetUsernameSupported

public boolean isSetUsernameSupported()
Description copied from interface: User
Indicates whether setting the username is supported for this user.

Specified by:
isSetUsernameSupported in interface User
Returns:
true if setting the username is supported.

isSetEmailSupported

public boolean isSetEmailSupported()
Description copied from interface: User
Indicates whether setting the email address is supported for this user.

Specified by:
isSetEmailSupported in interface User
Returns:
true if setting the email is supported.

isSetNameVisibleSupported

public boolean isSetNameVisibleSupported()
Description copied from interface: User
Indicates whether setting the visibility of the name is supported for this user.

Specified by:
isSetNameVisibleSupported in interface User
Returns:
true if setting the name visibility flag is supported.

isSetEmailVisibleSupported

public boolean isSetEmailVisibleSupported()
Description copied from interface: User
Indicates whether setting the visibility of the email address is supported for this user.

Specified by:
isSetEmailVisibleSupported in interface User
Returns:
true if setting the email visibility flag is supported.

isPropertyEditSupported

public boolean isPropertyEditSupported()
Description copied from interface: User
Indicates whether the property methods (get, set, delete, etc.) are supported.

Specified by:
isPropertyEditSupported in interface User
Returns:
true if the property methods are supported.

setSetNameVisibleSupported

public void setSetNameVisibleSupported(boolean setNameVisibleSupported)

setSetPasswordSupported

public void setSetPasswordSupported(boolean setPasswordSupported)

setGetPasswordHashSupported

public void setGetPasswordHashSupported(boolean getPasswordHashSupported)

setSetEmailVisibleSupported

public void setSetEmailVisibleSupported(boolean setEmailVisibleSupported)

setSetNameSupported

public void setSetNameSupported(boolean setNameSupported)

setSetUsernameSupported

public void setSetUsernameSupported(boolean setUsernameSupported)

setSetPasswordHashSupported

public void setSetPasswordHashSupported(boolean setPasswordHashSupported)

setSetPropertyEditSupported

public void setSetPropertyEditSupported(boolean setPropertyEditSupported)

setSetEmailSuppoted

public void setSetEmailSuppoted(boolean setEmailSuppoted)

isAnonymous

public boolean isAnonymous()
Description copied from interface: User
Returns true if the user represents an anonymous user.

Specified by:
isAnonymous in interface User
Returns:

Jive Product Page

Copyright © 1999-2007 Jive Software.