Smack

org.jivesoftware.smackx.packet
Class DiscoverInfo

java.lang.Object
  extended by org.jivesoftware.smack.packet.Packet
      extended by org.jivesoftware.smack.packet.IQ
          extended by org.jivesoftware.smackx.packet.DiscoverInfo

public class DiscoverInfo
extends IQ

A DiscoverInfo IQ packet, which is used by XMPP clients to request and receive information to/from other XMPP entities.

The received information may contain one or more identities of the requested XMPP entity, and a list of supported features by the requested XMPP entity.

Author:
Gaston Dombiak

Nested Class Summary
static class DiscoverInfo.Feature
          Represents the features offered by the item.
static class DiscoverInfo.Identity
          Represents the identity of a given XMPP entity.
 
Nested classes/interfaces inherited from class org.jivesoftware.smack.packet.IQ
IQ.Type
 
Field Summary
static java.lang.String NAMESPACE
           
 
Fields inherited from class org.jivesoftware.smack.packet.Packet
DEFAULT_LANGUAGE, ID_NOT_AVAILABLE
 
Constructor Summary
DiscoverInfo()
           
DiscoverInfo(DiscoverInfo d)
          Copy constructor
 
Method Summary
 void addFeature(java.lang.String feature)
          Adds a new feature to the discovered information.
 void addFeatures(java.util.Collection<java.lang.String> featuresToAdd)
          Adds a collection of features to the packet.
 void addIdentities(java.util.Collection<DiscoverInfo.Identity> identitiesToAdd)
          Adds identities to the DiscoverInfo stanza
 void addIdentity(DiscoverInfo.Identity identity)
          Adds a new identity of the requested entity to the discovered information.
 boolean containsDuplicateFeatures()
          Test if a DiscoverInfo response contains duplicate features.
 boolean containsDuplicateIdentities()
          Test if a DiscoverInfo response contains duplicate identities.
 boolean containsFeature(java.lang.String feature)
          Returns true if the specified feature is part of the discovered information.
 java.lang.String getChildElementXML()
          Returns the sub-element XML section of the IQ packet, or null if there isn't one.
 java.util.Iterator<DiscoverInfo.Feature> getFeatures()
          Returns the discovered features of an XMPP entity.
 java.util.Iterator<DiscoverInfo.Identity> getIdentities()
          Returns the discovered identities of an XMPP entity.
 java.lang.String getNode()
          Returns the node attribute that supplements the 'jid' attribute.
 void setNode(java.lang.String node)
          Sets the node attribute that supplements the 'jid' attribute.
 
Methods inherited from class org.jivesoftware.smack.packet.IQ
createErrorResponse, createResultIQ, getType, setType, toXML
 
Methods inherited from class org.jivesoftware.smack.packet.Packet
addExtension, addExtensions, deleteProperty, equals, getDefaultLanguage, getError, getExtension, getExtension, getExtensions, getExtensionsXML, getFrom, getPacketID, getProperty, getPropertyNames, getTo, getXmlns, hashCode, nextID, removeExtension, setDefaultXmlns, setError, setFrom, setPacketID, setProperty, setTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final java.lang.String NAMESPACE
See Also:
Constant Field Values
Constructor Detail

DiscoverInfo

public DiscoverInfo()

DiscoverInfo

public DiscoverInfo(DiscoverInfo d)
Copy constructor

Parameters:
d -
Method Detail

addFeature

public void addFeature(java.lang.String feature)
Adds a new feature to the discovered information.

Parameters:
feature - the discovered feature

addFeatures

public void addFeatures(java.util.Collection<java.lang.String> featuresToAdd)
Adds a collection of features to the packet. Does noting if featuresToAdd is null.

Parameters:
featuresToAdd -

getFeatures

public java.util.Iterator<DiscoverInfo.Feature> getFeatures()
Returns the discovered features of an XMPP entity.

Returns:
an Iterator on the discovered features of an XMPP entity

addIdentity

public void addIdentity(DiscoverInfo.Identity identity)
Adds a new identity of the requested entity to the discovered information.

Parameters:
identity - the discovered entity's identity

addIdentities

public void addIdentities(java.util.Collection<DiscoverInfo.Identity> identitiesToAdd)
Adds identities to the DiscoverInfo stanza

Parameters:
identitiesToAdd -

getIdentities

public java.util.Iterator<DiscoverInfo.Identity> getIdentities()
Returns the discovered identities of an XMPP entity.

Returns:
an Iterator on the discoveted identities

getNode

public java.lang.String getNode()
Returns the node attribute that supplements the 'jid' attribute. A node is merely something that is associated with a JID and for which the JID can provide information.

Node attributes SHOULD be used only when trying to provide or query information which is not directly addressable.

Returns:
the node attribute that supplements the 'jid' attribute

setNode

public void setNode(java.lang.String node)
Sets the node attribute that supplements the 'jid' attribute. A node is merely something that is associated with a JID and for which the JID can provide information.

Node attributes SHOULD be used only when trying to provide or query information which is not directly addressable.

Parameters:
node - the node attribute that supplements the 'jid' attribute

containsFeature

public boolean containsFeature(java.lang.String feature)
Returns true if the specified feature is part of the discovered information.

Parameters:
feature - the feature to check
Returns:
true if the requestes feature has been discovered

getChildElementXML

public java.lang.String getChildElementXML()
Description copied from class: IQ
Returns the sub-element XML section of the IQ packet, or null if there isn't one. Packet extensions must be included, if any are defined.

Extensions of this class must override this method.

Specified by:
getChildElementXML in class IQ
Returns:
the child element section of the IQ XML.

containsDuplicateIdentities

public boolean containsDuplicateIdentities()
Test if a DiscoverInfo response contains duplicate identities.

Returns:
true if duplicate identities where found, otherwise false

containsDuplicateFeatures

public boolean containsDuplicateFeatures()
Test if a DiscoverInfo response contains duplicate features.

Returns:
true if duplicate identities where found, otherwise false

Smack

Copyright © 2003-2007 Jive Software.