|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jivesoftware.smackx.pubsub.Item<E>
public class Item<E extends org.jivesoftware.smack.packet.PacketExtension>
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.
Node.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.
Node.send()
or Node.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(java.lang.String itemId)
Create an Item with an id but no payload. |
|
Item(java.lang.String itemId,
E payloadExt)
Create an Item with an id and payload. |
Method Summary | |
---|---|
java.lang.String |
getElementName()
|
java.lang.String |
getId()
Get the item id. |
java.lang.String |
getNamespace()
|
E |
getPayload()
Get the payload associated with this Item. |
java.lang.String |
toString()
|
java.lang.String |
toXML()
|
Methods inherited from class java.lang.Object |
---|
equals, 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 Node.send()
or Node.publish()
methods in this case.
public Item(java.lang.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()
.public Item(java.lang.String itemId, E payloadExt)
itemId
- The id of this item. It can be null if we want the server to set the id.payloadExt
- A PacketExtension
which represents the payload data.Method Detail |
---|
public E getPayload()
ItemProvider
.
PacketExtension
.public java.lang.String getId()
public java.lang.String getElementName()
getElementName
in interface org.jivesoftware.smack.packet.PacketExtension
public java.lang.String getNamespace()
getNamespace
in interface org.jivesoftware.smack.packet.PacketExtension
public java.lang.String toXML()
toXML
in interface org.jivesoftware.smack.packet.PacketExtension
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |