|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jivesoftware.smackx.pubsub.Item
public class Item
This class represents an item that has been, or will be published to a pubsub node. An Item has several properties that are dependent on the configuration of the node to which it has been or will be published.
LeafNode.getItems()
or Node.addItemEventListener(org.jivesoftware.smackx.pubsub.listener.ItemEventListener)
ConfigureForm.isPersistItems()
and ConfigureForm.isDeliverPayloads()
set to false.
ConfigureForm.isDeliverPayloads()
set
to true, otherwise it will be null.
LeafNode.send()
or LeafNode.publish()
ConfigureForm.isDeliverPayloads()
set
to true.
To customise the payload object being returned from the #getPayload()
method, you can
add a custom parser as explained in ItemProvider
.
Constructor Summary | |
---|---|
Item()
Create an empty Item with no id. |
|
Item(String itemId)
Create an Item with an id but no payload. |
Method Summary | |
---|---|
String |
getElementName()
Returns the root element name. |
String |
getId()
Get the item id. |
String |
getNamespace()
Returns the root element XML namespace. |
String |
toString()
|
String |
toXML()
Returns the XML representation of the PacketExtension. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Item()
ConfigureForm.isDeliverPayloads()
is false. In most cases an id will be generated by the server.
For nodes configured with ConfigureForm.isDeliverPayloads()
and ConfigureForm.isPersistItems()
set to false, no Item is sent to the node, you have to use LeafNode.send()
or LeafNode.publish()
methods in this case.
public Item(String itemId)
ConfigureForm.isDeliverPayloads()
is false.
itemId
- The id if the item. It must be unique within the node unless overwriting and existing item.
Passing null is the equivalent of calling Item()
.Method Detail |
---|
public String getId()
public String getElementName()
PacketExtension
getElementName
in interface PacketExtension
public String getNamespace()
PacketExtension
getNamespace
in interface PacketExtension
public String toXML()
PacketExtension
toXML
in interface PacketExtension
public String toString()
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |