|
Openfire 3.4.3 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.openfire.pubsub.Node org.jivesoftware.openfire.pubsub.LeafNode
public class LeafNode
A type of node that contains published items only. It is NOT a container for other nodes.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jivesoftware.openfire.pubsub.Node |
---|
Node.ItemReplyPolicy |
Field Summary | |
---|---|
protected Map<String,PublishedItem> |
itemsByID
|
protected List<PublishedItem> |
publishedItems
List of items that were published to the node and that are still active. |
Fields inherited from class org.jivesoftware.openfire.pubsub.Node |
---|
accessModel, affiliates, bodyXSLT, contacts, creationDate, creator, dataformXSLT, deliverPayloads, description, language, name, nodeID, notifyConfigChanges, notifyDelete, notifyRetract, parent, payloadType, presenceBasedDelivery, publisherModel, replyPolicy, replyRooms, replyTo, rosterGroupsAllowed, service, subscriptionConfigurationRequired, subscriptionEnabled, subscriptionsByID, subscriptionsByJID |
Constructor Summary | |
---|---|
LeafNode(PubSubService service,
CollectionNode parentNode,
String nodeID,
JID creator)
|
Method Summary | |
---|---|
protected void |
addFormFields(DataForm form,
boolean isEditing)
Adds the required form fields to the specified form. |
void |
deleteItems(List<PublishedItem> toDelete)
Deletes the list of published items from the node. |
protected void |
deletingNode()
Notification message indicating that the node is being deleted. |
PublishedItem |
getLastPublishedItem()
Returns the last PublishedItem that was published to the node or null if
the node does not have published items. |
int |
getMaxPayloadSize()
|
int |
getMaxPublishedItems()
|
PublishedItem |
getPublishedItem(String itemID)
Returns the PublishedItem whose ID matches the specified item ID or null
if none was found. |
List<PublishedItem> |
getPublishedItems()
Returns the list of PublishedItem that were published to the node. |
List<PublishedItem> |
getPublishedItems(int recentItems)
Returns a list of PublishedItem with the most recent N items published to
the node. |
boolean |
isItemRequired()
Returns true if an item element is required to be included when publishing an item to this node. |
boolean |
isPersistPublishedItems()
|
boolean |
isSendItemSubscribe()
Returns true if the last published item is going to be sent to new subscribers. |
void |
publishItems(JID publisher,
List<org.dom4j.Element> itemElements)
Publishes the list of items to the node. |
void |
purge()
Purges items that were published to the node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final List<PublishedItem> publishedItems
protected Map<String,PublishedItem> itemsByID
Constructor Detail |
---|
public LeafNode(PubSubService service, CollectionNode parentNode, String nodeID, JID creator)
Method Detail |
---|
protected void addFormFields(DataForm form, boolean isEditing)
Node
addFormFields
in class Node
form
- the form containing the node configuration.isEditing
- true when the form will be used to edit the node configuration.protected void deletingNode()
Node
deletingNode
in class Node
public int getMaxPayloadSize()
public boolean isPersistPublishedItems()
public int getMaxPublishedItems()
public boolean isItemRequired()
Leaf nodes that are transient and do not deliver payloads with event notifications do not require an item element. If a user tries to publish an item to a node that does not require items then an error will be returned.
public void publishItems(JID publisher, List<org.dom4j.Element> itemElements)
When an affiliate has many subscriptions to the node, the affiliate will get a notification for each set of items that affected the same list of subscriptions.
When an item is included in the published event then a new PublishedItem
is
going to be created and added to the list of published item. Each published item will
have a unique ID in the node scope. The new published item will be added to the end
of the published list to keep the cronological order. When the max number of published
items is exceeded then the oldest published items will be removed.
For performance reasons the newly added published items and the deleted items (if any) are saved to the database using a background thread. Sending event notifications to node subscribers may also use another thread to ensure good performance.
publisher
- the full JID of the user that sent the new published event.itemElements
- list of dom4j elements that contain info about the published items.public void deleteItems(List<PublishedItem> toDelete)
For performance reasons the deleted published items are saved to the database using a background thread. Sending event notifications to node subscribers may also use another thread to ensure good performance.
toDelete
- list of items that were deleted from the node.public PublishedItem getPublishedItem(String itemID)
Node
PublishedItem
whose ID matches the specified item ID or null
if none was found. Item ID may or may not exist and it depends on the node's configuration.
When the node is configured to not include payloads in event notifications and
published items are not persistent then item ID is not used. In this case a null
value will always be returned.
getPublishedItem
in class Node
itemID
- the ID of the item to retrieve.
public List<PublishedItem> getPublishedItems()
Node
PublishedItem
that were published to the node. The
returned collection cannot be modified. Collection nodes does not support publishing
of items so an empty list will be returned in that case.
getPublishedItems
in class Node
public List<PublishedItem> getPublishedItems(int recentItems)
Node
PublishedItem
with the most recent N items published to
the node. The returned collection cannot be modified. Collection nodes does not
support publishing of items so an empty list will be returned in that case.
getPublishedItems
in class Node
recentItems
- number of recent items to retrieve.
public PublishedItem getLastPublishedItem()
Node
PublishedItem
that was published to the node or null if
the node does not have published items. Collection nodes does not support publishing
of items so a null will be returned in that case.
getLastPublishedItem
in class Node
public boolean isSendItemSubscribe()
isSendItemSubscribe
in class Node
public void purge()
|
Openfire 3.4.3 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |