public class ServiceDiscoveryManager
extends java.lang.Object
Constructor and Description |
---|
ServiceDiscoveryManager(XMPPConnection connection)
Creates a new ServiceDiscoveryManager for a given XMPPConnection.
|
Modifier and Type | Method and Description |
---|---|
void |
addFeature(java.lang.String feature)
Registers that a new feature is supported by this XMPP entity.
|
boolean |
canPublishItems(java.lang.String entityID)
Returns true if the server supports publishing of items.
|
DiscoverInfo |
discoverInfo(java.lang.String entityID)
Returns the discovered information of a given XMPP entity addressed by its JID.
|
DiscoverInfo |
discoverInfo(java.lang.String entityID,
java.lang.String node)
Returns the discovered information of a given XMPP entity addressed by its JID and
note attribute.
|
DiscoverItems |
discoverItems(java.lang.String entityID)
Returns the discovered items of a given XMPP entity addressed by its JID.
|
DiscoverItems |
discoverItems(java.lang.String entityID,
java.lang.String node)
Returns the discovered items of a given XMPP entity addressed by its JID and
note attribute.
|
java.util.Iterator |
getFeatures()
Returns the supported features by this XMPP entity.
|
static java.lang.String |
getIdentityName()
Returns the name of the client that will be returned when asked for the client identity
in a disco request.
|
static java.lang.String |
getIdentityType()
Returns the type of client that will be returned when asked for the client identity in a
disco request.
|
static ServiceDiscoveryManager |
getInstanceFor(XMPPConnection connection)
Returns the ServiceDiscoveryManager instance associated with a given XMPPConnection.
|
boolean |
includesFeature(java.lang.String feature)
Returns true if the specified feature is registered in the ServiceDiscoveryManager.
|
void |
publishItems(java.lang.String entityID,
DiscoverItems discoverItems)
Publishes new items to a parent entity.
|
void |
publishItems(java.lang.String entityID,
java.lang.String node,
DiscoverItems discoverItems)
Publishes new items to a parent entity and node.
|
void |
removeFeature(java.lang.String feature)
Removes the specified feature from the supported features by this XMPP entity.
|
void |
removeNodeInformationProvider(java.lang.String node)
Removes the NodeInformationProvider responsible for providing information
(ie items) related to a given node.
|
static void |
setIdentityName(java.lang.String name)
Sets the name of the client that will be returned when asked for the client identity
in a disco request.
|
static void |
setIdentityType(java.lang.String type)
Sets the type of client that will be returned when asked for the client identity in a
disco request.
|
void |
setNodeInformationProvider(java.lang.String node,
NodeInformationProvider listener)
Sets the NodeInformationProvider responsible for providing information
(ie items) related to a given node.
|
public ServiceDiscoveryManager(XMPPConnection connection)
connection
- the connection to which a ServiceDiscoveryManager is going to be created.public static ServiceDiscoveryManager getInstanceFor(XMPPConnection connection)
connection
- the connection used to look for the proper ServiceDiscoveryManager.public static java.lang.String getIdentityName()
public static void setIdentityName(java.lang.String name)
name
- the name of the client that will be returned when asked for the client identity
in a disco request.public static java.lang.String getIdentityType()
public static void setIdentityType(java.lang.String type)
type
- the type of client that will be returned when asked for the client identity in a
disco request.public void setNodeInformationProvider(java.lang.String node, NodeInformationProvider listener)
In MUC, a node could be 'http://jabber.org/protocol/muc#rooms' which means that the NodeInformationProvider will provide information about the rooms where the user has joined.
node
- the node whose items will be provided by the NodeInformationProvider.listener
- the NodeInformationProvider responsible for providing items related
to the node.public void removeNodeInformationProvider(java.lang.String node)
node
- the node to remove the associated NodeInformationProvider.public java.util.Iterator getFeatures()
public void addFeature(java.lang.String feature)
feature
- the feature to register as supported.public void removeFeature(java.lang.String feature)
feature
- the feature to remove from the supported features.public boolean includesFeature(java.lang.String feature)
feature
- the feature to look for.public DiscoverInfo discoverInfo(java.lang.String entityID) throws XMPPException
entityID
- the address of the XMPP entity.XMPPException
- if the operation failed for some reason.public DiscoverInfo discoverInfo(java.lang.String entityID, java.lang.String node) throws XMPPException
entityID
- the address of the XMPP entity.node
- the attribute that supplements the 'jid' attribute.XMPPException
- if the operation failed for some reason.public DiscoverItems discoverItems(java.lang.String entityID) throws XMPPException
entityID
- the address of the XMPP entity.XMPPException
- if the operation failed for some reason.public DiscoverItems discoverItems(java.lang.String entityID, java.lang.String node) throws XMPPException
entityID
- the address of the XMPP entity.node
- the attribute that supplements the 'jid' attribute.XMPPException
- if the operation failed for some reason.public boolean canPublishItems(java.lang.String entityID) throws XMPPException
entityID
- the address of the XMPP entity.XMPPException
- if the operation failed for some reason.public void publishItems(java.lang.String entityID, DiscoverItems discoverItems) throws XMPPException
entityID
- the address of the XMPP entity.discoverItems
- the DiscoveryItems to publish.XMPPException
- if the operation failed for some reason.public void publishItems(java.lang.String entityID, java.lang.String node, DiscoverItems discoverItems) throws XMPPException
entityID
- the address of the XMPP entity.node
- the attribute that supplements the 'jid' attribute.discoverItems
- the DiscoveryItems to publish.XMPPException
- if the operation failed for some reason.Copyright © 2003 Jive Software.