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
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<? extends NamedElement>
protected Boolean
protected ItemsExtension.ItemsElementType
-
Constructor Summary
ConstructorDescriptionItemsExtension
(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 void
addXml
(XmlStringBuilder xml) Get the list of embeddedExtensionElement
objects.List<? extends NamedElement>
getItems()
Gets the items related to the type of request or event.Get the type of element.boolean
Gets the value of the optional attribute related to theItemsExtension.ItemsElementType
.toString()
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.NamedElement
getElementName
Methods 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 ofItem
and an optional value for the max_items attribute. - Request to delete items - itemsType =
ItemsExtension.ItemsElementType.retract
, items = list ofItem
containing only id's and an optional value for the notify attribute. - Items published event - itemsType =
ItemsExtension.ItemsElementType.items
, items = list ofItem
and attributeValue =null
- Items deleted event - itemsType =
ItemsExtension.ItemsElementType.items
, items = list ofRetractItem
and attributeValue =null
- Parameters:
itemsType
- Type of representationnodeId
- The node to which the items are being sent or deleteditems
- The list ofItem
orRetractItem
- 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 ofItem
and an optional value for the max_items attribute. - Request to delete items - itemsType =
ItemsExtension.ItemsElementType.retract
, items = list ofItem
containing only id's and an optional value for the notify attribute. - Items published event - itemsType =
ItemsExtension.ItemsElementType.items
, items = list ofItem
and attributeValue =null
- Items deleted event - itemsType =
ItemsExtension.ItemsElementType.items
, items = list ofRetractItem
and attributeValue =null
- Parameters:
nodeId
- The node to which the items are being sent or deleteditems
- The list ofItem
orRetractItem
notify
- 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:EmbeddedPacketExtension
Get the list of embeddedExtensionElement
objects.- Specified by:
getExtensions
in 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:
addXml
in classNodeExtension
-
toString
- Overrides:
toString
in classNodeExtension
-