Package org.jivesoftware.smackx.pubsub
Class ItemsExtension
java.lang.Object
org.jivesoftware.smackx.pubsub.NodeExtension
org.jivesoftware.smackx.pubsub.ItemsExtension
- All Implemented Interfaces:
Element,NamedElement,XmlElement,XmlLangElement,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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<? extends NamedElement>protected Booleanprotected ItemsExtension.ItemsElementType -
Constructor Summary
ConstructorsConstructorDescriptionItemsExtension(String nodeId, List<? extends ExtensionElement> items, boolean notify) Construct an instance with a list representing items that have been published or deleted.ItemsExtension(ItemsExtension.ItemsElementType itemsType, String nodeId, List<? extends NamedElement> items) Construct an instance with a list representing items that have been published or deleted. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddXml(XmlStringBuilder xml) Get the list of embeddedExtensionElementobjects.List<? extends NamedElement>getItems()Gets the items related to the type of request or event.Get the type of element.booleanGets the value of the optional attribute related to theItemsExtension.ItemsElementType.toString()Methods inherited from class org.jivesoftware.smackx.pubsub.NodeExtension
getElementName, getNamespace, getNode, getPubSubNamespace, toXMLMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jivesoftware.smack.packet.NamedElement
getElementNameMethods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getNamespace, getQName
-
Field Details
-
type
-
notify
-
items
-
-
Constructor Details
-
ItemsExtension
public ItemsExtension(ItemsExtension.ItemsElementType itemsType, String nodeId, 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
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 Details
-
getItemsElementType
Get the type of element.- Returns:
- The element type
-
getExtensions
Description copied from interface:EmbeddedPacketExtensionGet the list of embeddedExtensionElementobjects.- Specified by:
getExtensionsin interfaceEmbeddedPacketExtension- Returns:
- List of embedded
ExtensionElement
-
getItems
Gets the items related to the type of request or event.- Returns:
- List of
Item,RetractItem, or null
-
getNotify
Gets the value of the optional attribute related to theItemsExtension.ItemsElementType.- Returns:
- The attribute value
-
addXml
- Overrides:
addXmlin classNodeExtension
-
toString
- Overrides:
toStringin classNodeExtension
-