Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire.user
Class User

java.lang.Object
  extended by org.jivesoftware.wildfire.user.User
All Implemented Interfaces:
Serializable, Cacheable

public class User
extends Object
implements Cacheable

Encapsulates information about a user. New users are created using UserManager.createUser(String, String, String, String). All user properties are loaded on demand and are read from the jiveUserProp database table. The currently-installed UserProvider is used for setting all other user data and some operations may not be supported depending on the capabilities of the UserProvider.

Author:
Matt Tucker
See Also:
Serialized Form

Constructor Summary
User(String username, String name, String email, Date creationDate, Date modificationDate)
          Constructs a new user.
 
Method Summary
 boolean equals(Object object)
           
 int getCachedSize()
          Returns the approximate size of the Object in bytes.
 Date getCreationDate()
           
 String getEmail()
          Returns the email address of the user or null if none is defined.
 Date getModificationDate()
           
 String getName()
           
 Map<String,String> getProperties()
          Returns all extended properties of the group.
static String getPropertyValue(String username, String propertyName)
          Returns the value of the specified property for the given username.
 Roster getRoster()
          Returns the user's roster.
 String getUsername()
          Returns this user's username.
 int hashCode()
           
 void setCreationDate(Date creationDate)
           
 void setEmail(String email)
           
 void setModificationDate(Date modificationDate)
           
 void setName(String name)
           
 void setPassword(String password)
          Sets a new password for this user.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

User

public User(String username,
            String name,
            String email,
            Date creationDate,
            Date modificationDate)
Constructs a new user. All arguments can be null except the username. Typically, User objects should not be constructed by end-users of the API. Instead, user objects should be retrieved using UserManager.getUser(String).

Parameters:
username - the username.
name - the name.
email - the email address.
creationDate - the date the user was created.
modificationDate - the date the user was last modified.
Method Detail

getPropertyValue

public static String getPropertyValue(String username,
                                      String propertyName)
Returns the value of the specified property for the given username. This method is an optimization to avoid loading a user to get a specific property.

Parameters:
username - the username of the user to get a specific property value.
propertyName - the name of the property to return its value.
Returns:
the value of the specified property for the given username.

getUsername

public String getUsername()
Returns this user's username.

Returns:
the username..

setPassword

public void setPassword(String password)
Sets a new password for this user.

Parameters:
password - the new password for the user.

getName

public String getName()

setName

public void setName(String name)

getEmail

public String getEmail()
Returns the email address of the user or null if none is defined.

Returns:
the email address of the user or nullif none is defined.

setEmail

public void setEmail(String email)

getCreationDate

public Date getCreationDate()

setCreationDate

public void setCreationDate(Date creationDate)

getModificationDate

public Date getModificationDate()

setModificationDate

public void setModificationDate(Date modificationDate)

getProperties

public Map<String,String> getProperties()
Returns all extended properties of the group. Groups have an arbitrary number of extended properties.

Returns:
the extended properties.

getRoster

public Roster getRoster()
Returns the user's roster. A roster is a list of users that the user wishes to know if they are online. Rosters are similar to buddy groups in popular IM clients.

Returns:
the user's roster.

getCachedSize

public int getCachedSize()
Description copied from interface: Cacheable
Returns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.

Specified by:
getCachedSize in interface Cacheable
Returns:
the size of the Object in bytes.

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.