Class DiscoverItems.Item

  • Enclosing class:
    DiscoverItems

    public static class DiscoverItems.Item
    extends java.lang.Object
    An item is associated with an XMPP Entity, usually thought of a children of the parent entity and normally are addressable as a JID.

    An item associated with an entity may not be addressable as a JID. In order to handle such items, Service Discovery uses an optional 'node' attribute that supplements the 'jid' attribute.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String REMOVE_ACTION
      Request to remove the item.
      static java.lang.String UPDATE_ACTION
      Request to create or update the item.
    • Constructor Summary

      Constructors 
      Constructor Description
      Item​(Jid entityID)
      Create a new Item associated with a given entity.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAction()
      Returns the action that specifies the action being taken for this item.
      Jid getEntityID()
      Returns the entity's ID.
      java.lang.String getName()
      Returns the entity's name.
      java.lang.String getNode()
      Returns the node attribute that supplements the 'jid' attribute.
      void setAction​(java.lang.String action)
      Sets the action that specifies the action being taken for this item.
      void setName​(java.lang.String name)
      Sets the entity's name.
      void setNode​(java.lang.String node)
      Sets the node attribute that supplements the 'jid' attribute.
      java.lang.String toString()  
      XmlStringBuilder toXML()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Item

        public Item​(Jid entityID)
        Create a new Item associated with a given entity.
        Parameters:
        entityID - the id of the entity that contains the item
    • Method Detail

      • getEntityID

        public Jid getEntityID()
        Returns the entity's ID.
        Returns:
        the entity's ID.
      • getName

        public java.lang.String getName()
        Returns the entity's name.
        Returns:
        the entity's name.
      • setName

        public void setName​(java.lang.String name)
        Sets the entity's name.
        Parameters:
        name - the entity's name.
      • 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
      • getAction

        public java.lang.String getAction()
        Returns the action that specifies the action being taken for this item. Possible action values are: "update" and "remove". Update should either create a new entry if the node and jid combination does not already exist, or simply update an existing entry. If "remove" is used as the action, the item should be removed from persistent storage.
        Returns:
        the action being taken for this item
      • setAction

        public void setAction​(java.lang.String action)
        Sets the action that specifies the action being taken for this item. Possible action values are: "update" and "remove". Update should either create a new entry if the node and jid combination does not already exist, or simply update an existing entry. If "remove" is used as the action, the item should be removed from persistent storage.
        Parameters:
        action - the action being taken for this item
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object