Jive Messenger 2.2.2 Javadoc

org.jivesoftware.messenger.vcard
Class VCardManager

java.lang.Object
  extended by org.jivesoftware.messenger.vcard.VCardManager

public class VCardManager
extends Object

Manages VCard information for users.

Author:
Matt Tucker

Method Summary
 void deleteVCard(String username)
          Deletes the user's vCard from the user account.
static VCardManager getInstance()
           
static VCardProvider getProvider()
          Returns the currently-installed VCardProvider.
 org.dom4j.Element getVCard(String username)
          Returns the vCard of a given user or null if none was defined before.
 String getVCardProperty(String username, String name)
          Returns the user's vCard information for a given vcard property name.
 void setVCard(String username, org.dom4j.Element vCardElement)
          Sets the user's vCard information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static VCardManager getInstance()

getProvider

public static VCardProvider getProvider()
Returns the currently-installed VCardProvider. Warning: in virtually all cases the vcard provider should not be used directly. Instead, the appropriate methods in VCardManager should be called. Direct access to the vcard provider is only provided for special-case logic.

Returns:
the current VCardProvider.

getVCardProperty

public String getVCardProperty(String username,
                               String name)
Returns the user's vCard information for a given vcard property name. If the property has no defined text then an empty string will be returned. However, if the property does not exist then a null value will be answered. Advanced user systems can use vCard information to link to user directory information or store other relevant user information.

Note that many elements in the vCard may have the same path so the returned value in that case will be the first found element. For instance, "ADR:STREET" may be present in many addresses of the user. Use getVCard(String) to get the whole vCard of the user.

Parameters:
username - The username of the user to return his vCard property.
name - The name of the vcard property to retrieve encoded with ':' to denote the path.
Returns:
The vCard value found

setVCard

public void setVCard(String username,
                     org.dom4j.Element vCardElement)
              throws Exception
Sets the user's vCard information. The new vCard information will be persistent. Advanced user systems can use vCard information to link to user directory information or store other relevant user information.

Parameters:
username - The username of the user to set his new vCard.
vCardElement - The DOM element sent by the user as his new vcard.
Throws:
Exception - if an error occured while storing the new vCard.

deleteVCard

public void deleteVCard(String username)
Deletes the user's vCard from the user account.

Parameters:
username - The username of the user to delete his vCard.

getVCard

public org.dom4j.Element getVCard(String username)
Returns the vCard of a given user or null if none was defined before. Changes to the returned vCard will not be stored in the database. Use the returned vCard as a read-only vCard.

Returns:
the vCard of a given user.

Jive Messenger 2.2.2 Javadoc

Copyright © 1999-2004 Jive Software.