public class PublishedItem extends Object implements Serializable
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
PublishedItem.UniqueIdentifier
A unique identifier for an item, in context of all nodes of all services in the system.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDelete(org.xmpp.packet.JID user)
Returns true if the user that is trying to delete an item is allowed to delete it.
|
Date |
getCreationDate()
Returns the datetime when the items was published.
|
String |
getID()
Returns the ID that uniquely identifies the published item in the node.
|
String |
getItemKey()
Deprecated.
Replaced by
getUniqueIdentifier() which generates more unique values. |
static String |
getItemKey(LeafNode node,
String itemId)
Deprecated.
Replaced by
getUniqueIdentifier(LeafNode, String) which generates more unique values. |
static String |
getItemKey(String serviceId,
String nodeId,
String itemId)
Deprecated.
Replaced by
getUniqueIdentifier(String, String, String) which generates more unique values. |
LeafNode |
getNode()
Returns the
LeafNode where this item was published. |
String |
getNodeID()
Returns the id for the
LeafNode where this item was published. |
org.dom4j.Element |
getPayload()
Returns the payload included when publishing the item.
|
String |
getPayloadXML()
Returns a textual representation of the payload or
null if no payload
was specified with the item. |
org.xmpp.packet.JID |
getPublisher()
Returns the JID of the entity that published the item to the node.
|
PublishedItem.UniqueIdentifier |
getUniqueIdentifier()
Returns a value that uniquely identifies this published item in the XMPP domain.
|
static PublishedItem.UniqueIdentifier |
getUniqueIdentifier(LeafNode node,
String itemId)
Returns a value that uniquely identifies this published item in the XMPP domain.
|
static PublishedItem.UniqueIdentifier |
getUniqueIdentifier(String serviceId,
String nodeId,
String itemId)
Returns a value that uniquely identifies this published item in the XMPP domain.
|
public String getNodeID()
LeafNode where this item was published.public LeafNode getNode()
LeafNode where this item was published.public String getID()
public org.xmpp.packet.JID getPublisher()
public Date getCreationDate()
public org.dom4j.Element getPayload()
null if none was found.public String getPayloadXML()
null if no payload
was specified with the item.public boolean canDelete(org.xmpp.packet.JID user)
user - the full JID of the user trying to delete the item.@Deprecated public String getItemKey()
getUniqueIdentifier() which generates more unique values.getUniqueIdentifier() to obtain an identifier that is
unique for the entire XMPP domain.@Deprecated public static String getItemKey(LeafNode node, String itemId)
getUniqueIdentifier(LeafNode, String) which generates more unique values.getUniqueIdentifier(LeafNode, String) to obtain an
identifier that is unique for the entire XMPP domain.node - Node for the published itemitemId - Id for the published item (unique within the node)@Deprecated public static String getItemKey(String serviceId, String nodeId, String itemId)
getUniqueIdentifier(String, String, String) which generates more unique values.serviceId:nodeId:itemId. This matches the primary key of the ofPubSubItem table.serviceId - Service id for the published itemnodeId - Node id for the published itemitemId - Id for the published item (unique within the node)public PublishedItem.UniqueIdentifier getUniqueIdentifier()
public static PublishedItem.UniqueIdentifier getUniqueIdentifier(LeafNode node, String itemId)
node - Node for the published itemitemId - Id for the published item (unique within the node)public static PublishedItem.UniqueIdentifier getUniqueIdentifier(String serviceId, String nodeId, String itemId)
serviceId - Id of the service that contains the node.nodeId - Node id for the published itemitemId - Id for the published item (unique within the node)Copyright © 2003–2020 Ignite Realtime. All rights reserved.