|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.smackx.ServiceDiscoveryManager
public class ServiceDiscoveryManager
Manages discovery of services in XMPP entities. This class provides:
Constructor Summary | |
---|---|
ServiceDiscoveryManager(Connection connection)
Creates a new ServiceDiscoveryManager for a given Connection. |
Method Summary | |
---|---|
void |
addDiscoverInfoTo(DiscoverInfo response)
Add discover info response data. |
void |
addFeature(java.lang.String feature)
Registers that a new feature is supported by this XMPP entity. |
static boolean |
canPublishItems(DiscoverInfo info)
Returns true if the server supports publishing of items. |
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. |
DataForm |
getExtendedInfo()
Returns the data form that is set as extended information for this Service Discovery instance (XEP-0128) |
java.util.List<PacketExtension> |
getExtendedInfoAsList()
Returns the data form as List of PacketExtensions, or null if no data form is set. |
java.util.Iterator<java.lang.String> |
getFeatures()
Returns the supported features by this XMPP entity. |
java.util.List<java.lang.String> |
getFeaturesList()
Returns the supported features by this XMPP entity. |
static java.util.List<DiscoverInfo.Identity> |
getIdentities()
Returns all identities of this client as unmodifiable Collection |
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(Connection connection)
Returns the ServiceDiscoveryManager instance associated with a given Connection. |
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 |
removeExtendedInfo()
Removes the data form containing extended service discovery information from the information returned by this XMPP entity. |
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. |
void |
setEntityCapsManager(EntityCapsManager manager)
Loads the ServiceDiscoveryManager with an EntityCapsManger that speeds up certain lookups |
void |
setExtendedInfo(DataForm info)
Registers extended discovery information of this XMPP entity. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServiceDiscoveryManager(Connection connection)
connection
- the connection to which a ServiceDiscoveryManager is going to be created.Method Detail |
---|
public static ServiceDiscoveryManager getInstanceFor(Connection 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 static java.util.List<DiscoverInfo.Identity> getIdentities()
public void addDiscoverInfoTo(DiscoverInfo response)
response
- the discover info response packetpublic 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<java.lang.String> getFeatures()
public java.util.List<java.lang.String> getFeaturesList()
public void addFeature(java.lang.String feature)
Since no packet is actually sent to the server it is safe to perform this operation before logging to the server. In fact, you may want to configure the supported features before logging to the server so that the information is already available if it is required upon login.
feature
- the feature to register as supported.public void removeFeature(java.lang.String feature)
Since no packet is actually sent to the server it is safe to perform this operation before logging to the server.
feature
- the feature to remove from the supported features.public boolean includesFeature(java.lang.String feature)
feature
- the feature to look for.
public void setExtendedInfo(DataForm info)
Since no packet is actually sent to the server it is safe to perform this operation before logging to the server. In fact, you may want to configure the extended info before logging to the server so that the information is already available if it is required upon login.
info
- the data form that contains the extend service discovery
information.public DataForm getExtendedInfo()
public java.util.List<PacketExtension> getExtendedInfoAsList()
public void removeExtendedInfo()
Since no packet is actually sent to the server it is safe to perform this operation before logging to the server.
public DiscoverInfo discoverInfo(java.lang.String entityID) throws XMPPException
entityID
- the address of the XMPP entity or null.
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 optional 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 optional 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 static boolean canPublishItems(DiscoverInfo info)
DiscoverInfo
- the discover info packet to check.
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.public void setEntityCapsManager(EntityCapsManager manager)
manager
-
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |