|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.smackx.pubsub.Node org.jivesoftware.smackx.pubsub.LeafNode
public class LeafNode
The main class for the majority of pubsub functionality. In general almost all pubsub capabilities are related to the concept of a node. All items are published to a node, and typically subscribed to by other users. These users then retrieve events based on this subscription.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jivesoftware.smackx.pubsub.Node |
---|
Node.ItemDeleteTranslator, Node.ItemEventTranslator, Node.NodeConfigTranslator |
Field Summary |
---|
Fields inherited from class org.jivesoftware.smackx.pubsub.Node |
---|
con, configEventToListenerMap, id, itemDeleteToListenerMap, itemEventToListenerMap, to |
Method Summary | ||
---|---|---|
void |
deleteAllItems()
Purges the node of all items. |
|
void |
deleteItem(Collection<String> itemIds)
Delete the items with the specified id's from the node. |
|
void |
deleteItem(String itemId)
Delete the item with the specified id from the node. |
|
DiscoverItems |
discoverItems()
Get information on the items in the node in standard DiscoverItems format. |
|
|
getItems()
Get the current items stored in the node. |
|
|
getItems(Collection<String> ids)
Get the items specified from the node. |
|
|
getItems(int maxItems)
Get items persisted on the node, limited to the specified number. |
|
|
getItems(int maxItems,
String subscriptionId)
Get items persisted on the node, limited to the specified number based on the subscription associated with the provided subscriptionId. |
|
|
getItems(String subscriptionId)
Get the current items stored in the node based on the subscription associated with the provided subscription id. |
|
void |
publish()
Publishes an event to the node. |
|
|
publish(Collection<T> items)
Publishes multiple events to the node. |
|
|
publish(T item)
Publishes an event to the node. |
|
void |
send()
Publishes an event to the node. |
|
|
send(Collection<T> items)
Publishes multiple events to the node. |
|
|
send(T item)
Publishes an event to the node. |
Methods inherited from class org.jivesoftware.smackx.pubsub.Node |
---|
addConfigurationListener, addItemDeleteListener, addItemEventListener, createPubsubPacket, createPubsubPacket, discoverInfo, getId, getNodeConfiguration, getSubscriptionOptions, getSubscriptionOptions, getSubscriptions, removeConfigurationListener, removeItemDeleteListener, removeItemEventListener, sendConfigurationForm, sendPubsubPacket, sendPubsubPacket, subscribe, subscribe, toString, unsubscribe, unsubscribe |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public DiscoverItems discoverItems() throws XMPPException
DiscoverItems
format.
DiscoverItems
format
XMPPException
public <T extends Item> List<T> getItems() throws XMPPException
Item
in the node
XMPPException
public <T extends Item> List<T> getItems(String subscriptionId) throws XMPPException
subscriptionId
- - The subscription id for the
associated subscription.
Item
in the node
XMPPException
public <T extends Item> List<T> getItems(Collection<String> ids) throws XMPPException
getItems()
or an
event, that did not include the payload.
ids
- Item ids of the items to retrieve
Item
with payload
XMPPException
public <T extends Item> List<T> getItems(int maxItems) throws XMPPException
maxItems
- Maximum number of items to return
Item
XMPPException
public <T extends Item> List<T> getItems(int maxItems, String subscriptionId) throws XMPPException
maxItems
- Maximum number of items to returnsubscriptionId
- The subscription which the retrieval is based
on.
Item
XMPPException
public void publish()
ConfigureForm.isPersistItems()
=false
and ConfigureForm.isDeliverPayloads()
=false.
This is an asynchronous call which returns as soon as the
packet has been sent.
For synchronous calls use send()
.
public <T extends Item> void publish(T item)
send()
, which
publishes an event with NO item.
This is an asynchronous call which returns as soon as the
packet has been sent.
For synchronous calls use send(Item))
.
item
- - The item being sentpublic <T extends Item> void publish(Collection<T> items)
publish(Item)
.
In addition, if ConfigureForm.isPersistItems()
=false, only the last item in the input
list will get stored on the node, assuming it stores the last sent item.
This is an asynchronous call which returns as soon as the
packet has been sent.
For synchronous calls use send(Collection))
.
items
- - The collection of items being sentpublic void send() throws XMPPException
ConfigureForm.isPersistItems()
=false
and ConfigureForm.isDeliverPayloads()
=false.
This is a synchronous call which will throw an exception
on failure.
For asynchronous calls, use publish()
.
XMPPException
public <T extends Item> void send(T item) throws XMPPException
send()
, which
publishes an event with NO item.
This is a synchronous call which will throw an exception
on failure.
For asynchronous calls, use publish(Item)
.
item
- - The item being sent
XMPPException
public <T extends Item> void send(Collection<T> items) throws XMPPException
send(Item)
.
In addition, if ConfigureForm.isPersistItems()
=false, only the last item in the input
list will get stored on the node, assuming it stores the last sent item.
This is a synchronous call which will throw an exception
on failure.
For asynchronous calls, use publish(Collection))
.
items
- - The collection of Item
objects being sent
XMPPException
public void deleteAllItems() throws XMPPException
Note: Some implementations may keep the last item sent.
XMPPException
public void deleteItem(String itemId) throws XMPPException
itemId
- The id of the item
XMPPException
public void deleteItem(Collection<String> itemIds) throws XMPPException
itemIds
- The list of id's of items to delete
XMPPException
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |