Class ItemsExtension

  • All Implemented Interfaces:
    org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.XmlElement, org.jivesoftware.smack.packet.XmlLangElement, EmbeddedPacketExtension

    public class ItemsExtension
    extends NodeExtension
    implements EmbeddedPacketExtension
    This class is used for multiple purposes.
    • It can represent an event containing a list of items that have been published
    • It can represent an event containing a list of retracted (deleted) items.
    • It can represent a request to delete a list of items.
    • It can represent a request to get existing items.

    Please note, this class is used for internal purposes, and is not required for usage of pubsub functionality.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<? extends org.jivesoftware.smack.packet.NamedElement> items  
      protected java.lang.Boolean notify  
      protected ItemsExtension.ItemsElementType type  
    • Constructor Summary

      Constructors 
      Constructor Description
      ItemsExtension​(java.lang.String nodeId, java.util.List<? extends org.jivesoftware.smack.packet.ExtensionElement> items, boolean notify)
      Construct an instance with a list representing items that have been published or deleted.
      ItemsExtension​(ItemsExtension.ItemsElementType itemsType, java.lang.String nodeId, java.util.List<? extends org.jivesoftware.smack.packet.NamedElement> items)
      Construct an instance with a list representing items that have been published or deleted.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addXml​(org.jivesoftware.smack.util.XmlStringBuilder xml)  
      java.util.List<org.jivesoftware.smack.packet.XmlElement> getExtensions()
      Get the list of embedded ExtensionElement objects.
      java.util.List<? extends org.jivesoftware.smack.packet.NamedElement> getItems()
      Gets the items related to the type of request or event.
      ItemsExtension.ItemsElementType getItemsElementType()
      Get the type of element.
      boolean getNotify()
      Gets the value of the optional attribute related to the ItemsExtension.ItemsElementType.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.jivesoftware.smack.packet.Element

        toXML, toXML, toXML
      • Methods inherited from interface org.jivesoftware.smack.packet.NamedElement

        getElementName
      • Methods inherited from interface org.jivesoftware.smack.packet.XmlElement

        getLanguage, getNamespace, getQName
    • Field Detail

      • notify

        protected java.lang.Boolean notify
      • items

        protected java.util.List<? extends org.jivesoftware.smack.packet.NamedElement> items
    • Method Detail

      • getExtensions

        public java.util.List<org.jivesoftware.smack.packet.XmlElement> getExtensions()
        Description copied from interface: EmbeddedPacketExtension
        Get the list of embedded ExtensionElement objects.
        Specified by:
        getExtensions in interface EmbeddedPacketExtension
        Returns:
        List of embedded ExtensionElement
      • getItems

        public java.util.List<? extends org.jivesoftware.smack.packet.NamedElement> getItems()
        Gets the items related to the type of request or event.
        Returns:
        List of Item, RetractItem, or null
      • getNotify

        public boolean getNotify()
        Gets the value of the optional attribute related to the ItemsExtension.ItemsElementType.
        Returns:
        The attribute value
      • addXml

        protected void addXml​(org.jivesoftware.smack.util.XmlStringBuilder xml)
        Overrides:
        addXml in class NodeExtension