Package org.jivesoftware.openfire.vcard
Class DefaultVCardProvider
java.lang.Object
org.jivesoftware.openfire.vcard.DefaultVCardProvider
- All Implemented Interfaces:
VCardProvider
- Direct Known Subclasses:
CrowdVCardProvider
Default implementation of the VCardProvider interface, which reads and writes data
from the
ofVCard database table.- Author:
- Gaston Dombiak
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.dom4j.ElementcreateVCard(String username, org.dom4j.Element vCardElement) Creates and saves the new user vcard.voiddeleteVCard(String username) Delets a user vcard.booleanReturns true if this VCardProvider is read-only.org.dom4j.ElementLoads the specified user vcard by username.org.dom4j.ElementupdateVCard(String username, org.dom4j.Element vCardElement) Updates the user vcard in the backend store.
-
Constructor Details
-
DefaultVCardProvider
public DefaultVCardProvider()
-
-
Method Details
-
loadVCard
Description copied from interface:VCardProviderLoads the specified user vcard by username. Returnsnullif no vCard was found for the specified username.- Specified by:
loadVCardin interfaceVCardProvider- Parameters:
username- the username- Returns:
- the vCard as an DOM element or
nullif none was found.
-
createVCard
public org.dom4j.Element createVCard(String username, org.dom4j.Element vCardElement) throws AlreadyExistsException Description copied from interface:VCardProviderCreates and saves the new user vcard. This method should throw an UnsupportedOperationException if this operation is not supported by the backend vcard store. The method is expected to return the vCard after it has had a chance to make any modifications to it that it needed to. In many cases, this may be a simple return of the passed in vCard. This change was made in 3.4.4.- Specified by:
createVCardin interfaceVCardProvider- Parameters:
username- the username.vCardElement- the vCard to save.- Returns:
- vCard as it is after the provider has a chance to adjust it.
- Throws:
AlreadyExistsException- if the user already has a vCard.
-
updateVCard
public org.dom4j.Element updateVCard(String username, org.dom4j.Element vCardElement) throws NotFoundException Description copied from interface:VCardProviderUpdates the user vcard in the backend store. This method should throw an UnsupportedOperationException if this operation is not supported by the backend vcard store. The method is expected to return the vCard after it has had a chance to make any modifications to it that it needed to. In many cases, this may be a simple return of the passed in vCard. This change was made in 3.4.4.- Specified by:
updateVCardin interfaceVCardProvider- Parameters:
username- the username.vCardElement- the vCard to save.- Returns:
- vCard as it is after the provider has a chance to adjust it.
- Throws:
NotFoundException- if the vCard to update does not exist.
-
deleteVCard
Description copied from interface:VCardProviderDelets a user vcard. This method should throw an UnsupportedOperationException if this operation is not supported by the backend vcard store.- Specified by:
deleteVCardin interfaceVCardProvider- Parameters:
username- the username to delete.
-
isReadOnly
public boolean isReadOnly()Description copied from interface:VCardProviderReturns true if this VCardProvider is read-only. When read-only, vcards can not be created, deleted, or modified.- Specified by:
isReadOnlyin interfaceVCardProvider- Returns:
- true if the vcard provider is read-only.
-