Package org.jivesoftware.openfire.pubsub
Class PublishedItem
- java.lang.Object
-
- org.jivesoftware.openfire.pubsub.PublishedItem
-
- All Implemented Interfaces:
Serializable
public class PublishedItem extends Object implements Serializable
A published item to a node. Once an item was published to a node, node subscribers will be notified of the new published item. The item publisher may be allowed to delete published items. After a published item was deleted node subscribers will get an event notification.Published items may be persisted to the database depending on the node configuration. Actually, even when the node is configured to not persist items the last published item is going to be persisted to the database. The reason for this is that the node may need to send the last published item to new subscribers.
- Author:
- Matt Tucker
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDelete(org.xmpp.packet.JID user)Returns true if the user that is trying to delete an item is allowed to delete it.DategetCreationDate()Returns the datetime when the items was published.StringgetID()Returns the ID that uniquely identifies the published item in the node.StringgetItemKey()Returns a string that uniquely identifies this published item in the following format: nodeId:itemIdstatic StringgetItemKey(LeafNode node, String itemId)Returns a string that uniquely identifies this published item in the following format: nodeId:itemIdLeafNodegetNode()Returns theLeafNodewhere this item was published.StringgetNodeID()Returns the id for theLeafNodewhere this item was published.org.dom4j.ElementgetPayload()Returns the payload included when publishing the item.StringgetPayloadXML()Returns a textual representation of the payload ornullif no payload was specified with the item.org.xmpp.packet.JIDgetPublisher()Returns the JID of the entity that published the item to the node.
-
-
-
Method Detail
-
getNodeID
public String getNodeID()
Returns the id for theLeafNodewhere this item was published.- Returns:
- the ID for the leaf node where this item was published.
-
getNode
public LeafNode getNode()
Returns theLeafNodewhere this item was published.- Returns:
- the leaf node where this item was published.
-
getID
public String getID()
Returns the ID that uniquely identifies the published item in the node.- Returns:
- the ID that uniquely identifies the published item in the node.
-
getPublisher
public org.xmpp.packet.JID getPublisher()
Returns the JID of the entity that published the item to the node.- Returns:
- the JID of the entity that published the item to the node.
-
getCreationDate
public Date getCreationDate()
Returns the datetime when the items was published.- Returns:
- the datetime when the items was published.
-
getPayload
public org.dom4j.Element getPayload()
Returns the payload included when publishing the item. A published item may or may not have a payload. Transient nodes that are configured to not broadcast payloads may allow published items to have no payload.- Returns:
- the payload included when publishing the item or
nullif none was found.
-
getPayloadXML
public String getPayloadXML()
Returns a textual representation of the payload ornullif no payload was specified with the item.- Returns:
- a textual representation of the payload or null if no payload was specified with the item.
-
canDelete
public boolean canDelete(org.xmpp.packet.JID user)
Returns true if the user that is trying to delete an item is allowed to delete it. Only the publisher or node admins (i.e. owners and sysadmins) are allowed to delete items.- Parameters:
user- the full JID of the user trying to delete the item.- Returns:
- true if the user that is trying to delete an item is allowed to delete it.
-
getItemKey
public String getItemKey()
Returns a string that uniquely identifies this published item in the following format: nodeId:itemId- Returns:
- Unique identifier for this item
-
getItemKey
public static String getItemKey(LeafNode node, String itemId)
Returns a string that uniquely identifies this published item in the following format: nodeId:itemId- Parameters:
node- Node for the published itemitemId- Id for the published item (unique within the node)- Returns:
- Unique identifier for this item
-
-