public class VCardManager extends BasicModule implements ServerFeaturesProvider
Modifier and Type | Field and Description |
---|---|
static SystemProperty<Class> |
VCARD_PROVIDER |
Constructor and Description |
---|
VCardManager() |
Modifier and Type | Method and Description |
---|---|
void |
deleteVCard(String username)
Deletes the user's vCard from the user account.
|
Iterator<String> |
getFeatures()
Returns an Iterator (of String) with the supported features by the server.
|
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 |
initialize(XMPPServer server)
Initializes the basic module.
|
void |
reset()
Resets the manager state.
|
void |
setVCard(String username,
org.dom4j.Element vCardElement)
Sets the user's vCard information.
|
void |
start()
Starts the basic module.
|
void |
stop()
Stops the basic module.
|
destroy, getName
public static final SystemProperty<Class> VCARD_PROVIDER
public static VCardManager getInstance()
public static VCardProvider getProvider()
public String getVCardProperty(String username, String name)
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.
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.public void setVCard(String username, org.dom4j.Element vCardElement) throws Exception
username
- The username of the user to set his new vCard.vCardElement
- The DOM element sent by the user as his new vCard.Exception
- if an error occurred while storing the new vCard.public void deleteVCard(String username)
username
- The username of the user to delete his vCard.UnsupportedOperationException
- If the provider is read-only and the data
cannot be deleted, this exception is thrownpublic org.dom4j.Element getVCard(String username)
username
- Username (not full JID) whose vCard to retrieve.public void initialize(XMPPServer server)
BasicModule
Initializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
initialize
in interface Module
initialize
in class BasicModule
server
- the server hosting this module.public void start()
BasicModule
Starts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
start
in interface Module
start
in class BasicModule
public void stop()
BasicModule
Stops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
stop
in interface Module
stop
in class BasicModule
public void reset()
public Iterator<String> getFeatures()
ServerFeaturesProvider
getFeatures
in interface ServerFeaturesProvider
Copyright © 2003–2020 Ignite Realtime. All rights reserved.