Package org.jivesoftware.smackx.pubsub
Class ItemsExtension
- java.lang.Object
-
- org.jivesoftware.smackx.pubsub.NodeExtension
-
- org.jivesoftware.smackx.pubsub.ItemsExtension
-
- All Implemented Interfaces:
Element,ExtensionElement,FullyQualifiedElement,NamedElement,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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classItemsExtension.ItemsElementType
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<? extends NamedElement>itemsprotected java.lang.Booleannotifyprotected ItemsExtension.ItemsElementTypetype
-
Constructor Summary
Constructors Constructor Description ItemsExtension(java.lang.String nodeId, java.util.List<? extends 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 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 voidaddXml(XmlStringBuilder xml)java.util.List<ExtensionElement>getExtensions()Get the list of embeddedExtensionElementobjects.java.util.List<? extends NamedElement>getItems()Gets the items related to the type of request or event.ItemsExtension.ItemsElementTypegetItemsElementType()Get the type of element.booleangetNotify()Gets the value of the optional attribute related to theItemsExtension.ItemsElementType.java.lang.StringtoString()-
Methods inherited from class org.jivesoftware.smackx.pubsub.NodeExtension
getElementName, getNamespace, getNode, getPubSubNamespace, toXML
-
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.FullyQualifiedElement
getLanguage, getNamespace, getQName
-
Methods inherited from interface org.jivesoftware.smack.packet.NamedElement
getElementName
-
-
-
-
Field Detail
-
type
protected ItemsExtension.ItemsElementType type
-
notify
protected java.lang.Boolean notify
-
items
protected java.util.List<? extends NamedElement> items
-
-
Constructor Detail
-
ItemsExtension
public ItemsExtension(ItemsExtension.ItemsElementType itemsType, java.lang.String nodeId, java.util.List<? extends NamedElement> items)
Construct an instance with a list representing items that have been published or deleted.Valid scenarios are:
- Request items from node - itemsType =
ItemsExtension.ItemsElementType.items, items = list ofItemand an optional value for the max_items attribute. - Request to delete items - itemsType =
ItemsExtension.ItemsElementType.retract, items = list ofItemcontaining only id's and an optional value for the notify attribute. - Items published event - itemsType =
ItemsExtension.ItemsElementType.items, items = list ofItemand attributeValue =null - Items deleted event - itemsType =
ItemsExtension.ItemsElementType.items, items = list ofRetractItemand attributeValue =null
- Parameters:
itemsType- Type of representationnodeId- The node to which the items are being sent or deleteditems- The list ofItemorRetractItem
- Request items from node - itemsType =
-
ItemsExtension
public ItemsExtension(java.lang.String nodeId, java.util.List<? extends ExtensionElement> items, boolean notify)
Construct an instance with a list representing items that have been published or deleted.Valid scenarios are:
- Request items from node - itemsType =
ItemsExtension.ItemsElementType.items, items = list ofItemand an optional value for the max_items attribute. - Request to delete items - itemsType =
ItemsExtension.ItemsElementType.retract, items = list ofItemcontaining only id's and an optional value for the notify attribute. - Items published event - itemsType =
ItemsExtension.ItemsElementType.items, items = list ofItemand attributeValue =null - Items deleted event - itemsType =
ItemsExtension.ItemsElementType.items, items = list ofRetractItemand attributeValue =null
- Parameters:
nodeId- The node to which the items are being sent or deleteditems- The list ofItemorRetractItemnotify- TODO javadoc me please
- Request items from node - itemsType =
-
-
Method Detail
-
getItemsElementType
public ItemsExtension.ItemsElementType getItemsElementType()
Get the type of element.- Returns:
- The element type
-
getExtensions
public java.util.List<ExtensionElement> getExtensions()
Description copied from interface:EmbeddedPacketExtensionGet the list of embeddedExtensionElementobjects.- Specified by:
getExtensionsin interfaceEmbeddedPacketExtension- Returns:
- List of embedded
ExtensionElement
-
getItems
public java.util.List<? extends 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 theItemsExtension.ItemsElementType.- Returns:
- The attribute value
-
addXml
protected void addXml(XmlStringBuilder xml)
- Overrides:
addXmlin classNodeExtension
-
toString
public java.lang.String toString()
- Overrides:
toStringin classNodeExtension
-
-