public final class ServiceDiscoveryManager extends ExtensionManager implements InfoNode, ItemNode
The ability to discover information about entities on the Jabber network is extremely valuable. Such information might include features offered or protocols supported by the entity, the entity's type or identity, and additional entities that are associated with the original entity in some way (often thought of as "children" of the "parent" entity).
Enabled extensions are automatically added to the list of features by their respective manager class. Disabled extensions are removed.
This class automatically manages incoming service discovery requests by responding with a list of enabled extensions (features).
xmppSession| Modifier and Type | Method and Description |
|---|---|
void |
addExtension(DataForm extension)
Adds an extension.
|
void |
addFeature(Feature feature)
Adds a feature.
|
void |
addIdentity(Identity identity)
Adds an identity.
|
void |
addInfoNode(InfoNode infoNode)
Adds an info node.
|
void |
addItem(Item item)
Adds an item.
|
void |
addItemNode(ItemNode itemNode)
Adds an item node.
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a property change listener, which listens for changes in the identities, features, extensions and items collections.
|
InfoNode |
discoverInformation(Jid jid)
Discovers information about another XMPP entity.
|
InfoNode |
discoverInformation(Jid jid,
String node)
Discovers information about another XMPP entity targeted at a specific node.
|
ItemNode |
discoverItems(Jid jid)
Discovers item associated with another XMPP entity.
|
ItemNode |
discoverItems(Jid jid,
String node)
Discovers item associated with another XMPP entity.
|
List<DataForm> |
getExtensions()
Gets an unmodifiable list of extensions.
|
Set<Feature> |
getFeatures()
Gets an unmodifiable set of features.
|
Set<Identity> |
getIdentities()
Gets an unmodifiable set of identities.
|
List<Item> |
getItems()
Gets an unmodifiable list of items.
|
String |
getNode()
Since this is the "root" node, it returns null.
|
void |
removeExtension(DataForm extension)
Removes an extension.
|
void |
removeFeature(Feature feature)
Removes a feature.
|
void |
removeIdentity(Identity identity)
Removes an identity.
|
void |
removeInfoNode(String node)
Removes an info node.
|
void |
removeItem(Item item)
Removes an item.
|
void |
removeItemNode(String node)
Removes an item node.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener.
|
setEnabledpublic void addPropertyChangeListener(PropertyChangeListener listener)
listener - The listener.removePropertyChangeListener(java.beans.PropertyChangeListener)public void removePropertyChangeListener(PropertyChangeListener listener)
listener - The listener.addPropertyChangeListener(java.beans.PropertyChangeListener)public String getNode()
public List<Item> getItems()
getItems in interface ItemNodeaddItem(rocks.xmpp.extensions.disco.model.items.Item),
removeItem(rocks.xmpp.extensions.disco.model.items.Item)public Set<Identity> getIdentities()
getIdentities in interface InfoNodeaddIdentity(rocks.xmpp.extensions.disco.model.info.Identity),
removeIdentity(rocks.xmpp.extensions.disco.model.info.Identity)public Set<Feature> getFeatures()
getFeatures in interface InfoNodeaddFeature(rocks.xmpp.extensions.disco.model.info.Feature),
removeFeature(rocks.xmpp.extensions.disco.model.info.Feature)public List<DataForm> getExtensions()
getExtensions in interface InfoNodeaddExtension(rocks.xmpp.extensions.data.model.DataForm),
removeExtension(rocks.xmpp.extensions.data.model.DataForm),
XEP-0128: Service Discovery Extensionspublic void addItem(Item item)
item - The item.removeItem(rocks.xmpp.extensions.disco.model.items.Item),
()public void removeItem(Item item)
item - The item.addItem(rocks.xmpp.extensions.disco.model.items.Item),
getItems()public void addIdentity(Identity identity)
identity - The identity.removeIdentity(rocks.xmpp.extensions.disco.model.info.Identity),
getIdentities()public void removeIdentity(Identity identity)
identity - The identity.addIdentity(rocks.xmpp.extensions.disco.model.info.Identity),
getIdentities()public void addFeature(Feature feature)
feature - The feature.removeFeature(rocks.xmpp.extensions.disco.model.info.Feature),
getFeatures()public void removeFeature(Feature feature)
feature - The feature.addFeature(rocks.xmpp.extensions.disco.model.info.Feature),
getFeatures()public void addExtension(DataForm extension)
extension - The extension.removeExtension(rocks.xmpp.extensions.data.model.DataForm),
getExtensions(),
XEP-0128: Service Discovery Extensionspublic void removeExtension(DataForm extension)
extension - The extension.addExtension(rocks.xmpp.extensions.data.model.DataForm),
getExtensions(),
XEP-0128: Service Discovery Extensionspublic InfoNode discoverInformation(Jid jid) throws XmppException
3. Discovering Information About a Jabber Entity
A requesting entity may want to discover information about another entity on the network. The information desired generally is of two kinds:
- The target entity's identity.
- The features offered and protocols supported by the target entity.
jid - The entity's JID.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic InfoNode discoverInformation(Jid jid, String node) throws XmppException
A disco#info query MAY also be directed to a specific node identifier associated with a JID.
jid - The entity's JID.node - The node.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptiondiscoverInformation(rocks.xmpp.core.Jid)public ItemNode discoverItems(Jid jid) throws XmppException
jid - The JID.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic ItemNode discoverItems(Jid jid, String node) throws XmppException
jid - The JID.node - The node.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic void addInfoNode(InfoNode infoNode)
infoNode - The info node.public void removeInfoNode(String node)
node - The node name.public void addItemNode(ItemNode itemNode)
itemNode - The item node.public void removeItemNode(String node)
node - The item node.Copyright © 2014 XMPP.rocks. All rights reserved.