public final class ServiceDiscoveryManager extends ExtensionManager
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 inbound service discovery requests by responding with a list of enabled extensions (features).
| 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 |
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,
ResultSetManagement resultSet)
Discovers item associated with another XMPP entity.
|
ItemNode |
discoverItems(Jid jid,
String node)
Discovers item associated with another XMPP entity.
|
ItemNode |
discoverItems(Jid jid,
String node,
ResultSetManagement resultSetManagement)
Discovers item associated with another XMPP entity.
|
Collection<Item> |
discoverServices(String feature)
Discovers a service on the connected server by its feature namespace.
|
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.
|
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 |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener.
|
void |
setItemProvider(ResultSetProvider<Item> itemProvider)
Sets an item provider for the root node.
|
void |
setItemProvider(String node,
ResultSetProvider<Item> itemProvider)
Sets an item provider for a node.
|
isEnabled, 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 Set<Identity> getIdentities()
addIdentity(rocks.xmpp.extensions.disco.model.info.Identity),
removeIdentity(rocks.xmpp.extensions.disco.model.info.Identity)public Set<Feature> getFeatures()
addFeature(rocks.xmpp.extensions.disco.model.info.Feature),
removeFeature(rocks.xmpp.extensions.disco.model.info.Feature)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, ResultSetManagement resultSet) throws XmppException
jid - The JID.resultSet - The result set management.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 ItemNode discoverItems(Jid jid, String node, ResultSetManagement resultSetManagement) throws XmppException
jid - The JID.node - The node.resultSetManagement - The result set management.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic Collection<Item> discoverServices(String feature) throws XmppException
feature - The feature namespace.StanzaException - If the server returned a stanza error.NoResponseException - If the server did not respond.XmppExceptionpublic void addInfoNode(InfoNode infoNode)
infoNode - The info node.public void removeInfoNode(String node)
node - The node name.public void setItemProvider(ResultSetProvider<Item> itemProvider)
If you want to manage items in memory, you can use DefaultItemProvider.
itemProvider - The item provider.public void setItemProvider(String node, ResultSetProvider<Item> itemProvider)
If you want to manage items in memory, you can use DefaultItemProvider.
node - The node name.itemProvider - The item provider.Copyright © 2014–2015 XMPP.rocks. All rights reserved.