Package org.jivesoftware.smackx.pubsub
Class ItemPublishEvent<T extends Item>
java.lang.Object
org.jivesoftware.smackx.pubsub.NodeEvent
org.jivesoftware.smackx.pubsub.SubscriptionEvent
org.jivesoftware.smackx.pubsub.ItemPublishEvent<T>
Represents an event generated by an item(s) being published to a node.
-
Constructor Summary
ConstructorDescriptionItemPublishEvent
(String nodeId, List<T> eventItems) Constructs anItemPublishEvent
with the provided list ofItem
that were published.Constructs anItemPublishEvent
with the provided list ofItem
that were published.ItemPublishEvent
(String nodeId, List<T> eventItems, List<String> subscriptionIds, Date publishedDate) Constructs anItemPublishEvent
with the provided list ofItem
that were published in the past. -
Method Summary
Methods inherited from class org.jivesoftware.smackx.pubsub.SubscriptionEvent
getSubscriptions, setSubscriptions
-
Constructor Details
-
ItemPublishEvent
Constructs anItemPublishEvent
with the provided list ofItem
that were published.- Parameters:
nodeId
- The id of the node the event came fromeventItems
- The list ofItem
that were published
-
ItemPublishEvent
Constructs anItemPublishEvent
with the provided list ofItem
that were published. The list of subscription ids represents the subscriptions that matched the event, in the case of the user having multiple subscriptions.- Parameters:
nodeId
- The id of the node the event came fromeventItems
- The list ofItem
that were publishedsubscriptionIds
- The list of subscriptionIds
-
ItemPublishEvent
public ItemPublishEvent(String nodeId, List<T> eventItems, List<String> subscriptionIds, Date publishedDate) Constructs anItemPublishEvent
with the provided list ofItem
that were published in the past. The published date signifies that this is delayed event. The list of subscription ids represents the subscriptions that matched the event, in the case of the user having multiple subscriptions.- Parameters:
nodeId
- The id of the node the event came fromeventItems
- The list ofItem
that were publishedsubscriptionIds
- The list of subscriptionIdspublishedDate
- date of publication.
-
-
Method Details
-
getItems
Get the list ofItem
that were published.- Returns:
- The list of published
Item
-
isDelayed
Indicates whether this event was delayed. That is, the items were published to the node at some time in the past. This will typically happen if there is an item already published to the node before a user subscribes to it. In this case, when the user subscribes, the server may send the last item published to the node with a delay date showing its time of original publication.- Returns:
- true if the items are delayed, false otherwise.
-
getPublishedDate
Gets the original date the items were published. This is only valid ifisDelayed()
is true.- Returns:
- date of publication.
-
toString
-