public final class PubSubNode extends Object
It allows you to create the node on the pubsub service, subscribe or unsubscribe from the node, retrieve items from it, publish items to it, etc.
| Modifier and Type | Method and Description |
|---|---|
AsyncResult<IQ> |
configureNode(NodeConfiguration nodeConfiguration)
Configures the node by submitting the configuration form.
|
AsyncResult<IQ> |
configureSubscription(SubscribeOptions subscribeOptions)
Configures the subscription options for this node.
|
AsyncResult<String> |
create()
Creates the node on the remote pubsub service.
|
AsyncResult<String> |
create(NodeConfiguration nodeConfiguration)
Creates and configures this node on the remote pubsub service.
|
AsyncResult<IQ> |
delete()
Deletes this node on the pubsub service.
|
AsyncResult<IQ> |
delete(URI uri)
Deletes this node and specifies a replacement node.
|
AsyncResult<IQ> |
deleteItem(String id,
boolean notify)
Deletes an item from this node.
|
AsyncResult<List<Item>> |
discoverItems()
Discovers the items for this node.
|
AsyncResult<NodeMetaData> |
discoverNodeMetaData()
Discovers the node info, which consists of a node name, type and meta data.
|
AsyncResult<List<PubSubNode>> |
discoverNodes()
Discovers the (sub-)nodes, which hierarchically reside under this node, e.g. the "second-level" nodes.
|
AsyncResult<List<Affiliation>> |
getAffiliations()
Gets the affiliations for this node.
|
String |
getId()
Gets the node id.
|
AsyncResult<List<Item>> |
getItems()
Gets all items for this node.
|
AsyncResult<List<Item>> |
getItems(int maxItems)
Gets the most recent items.
|
AsyncResult<List<Item>> |
getItems(String... ids)
Gets one or more items with a given item id for a specific node.
|
AsyncResult<NodeConfiguration> |
getNodeConfiguration()
Gets the node configuration form.
|
AsyncResult<SubscribeOptions> |
getSubscriptionOptions()
Gets the subscription options for this node.
|
AsyncResult<SubscribeOptions> |
getSubscriptionOptions(boolean defaultOptions)
Gets the (default) subscription options for this node.
|
AsyncResult<SubscribeOptions> |
getSubscriptionOptions(String subId)
Gets the subscription options for this node.
|
AsyncResult<List<Subscription>> |
getSubscriptions()
Gets the subscriptions for this node.
|
NodeType |
getType()
Gets the type of this node.
|
AsyncResult<String> |
publish(Object item)
Publishes an item to this node.
|
AsyncResult<String> |
publish(Object item,
PublishOptions publishOptions)
Publishes an item to this node.
|
AsyncResult<String> |
publish(String id,
Object item)
Publishes an item to this node.
|
AsyncResult<String> |
publish(String id,
Object item,
PublishOptions publishOptions)
Publishes an item to this node.
|
AsyncResult<IQ> |
purge()
Purges this node of all published items.
|
AsyncResult<Subscription> |
subscribe()
Subscribes to this node.
|
AsyncResult<Subscription> |
subscribe(SubscribeOptions subscribeOptions)
Subscribes to and configures this node.
|
String |
toString()
The node id.
|
void |
unsubscribe()
Unsubscribes from this node.
|
AsyncResult<IQ> |
unsubscribe(String subscriptionId)
Unsubscribes from this node.
|
public AsyncResult<NodeMetaData> discoverNodeMetaData()
public AsyncResult<List<Item>> discoverItems()
public AsyncResult<List<Subscription>> getSubscriptions()
public AsyncResult<List<Affiliation>> getAffiliations()
public AsyncResult<Subscription> subscribe()
public AsyncResult<Subscription> subscribe(SubscribeOptions subscribeOptions)
subscribeOptions - The configuration form.public void unsubscribe()
public AsyncResult<IQ> unsubscribe(String subscriptionId)
subscriptionId - The subscription id.public AsyncResult<SubscribeOptions> getSubscriptionOptions(boolean defaultOptions)
defaultOptions - Whether to get the default options or not.configureSubscription(rocks.xmpp.extensions.pubsub.model.SubscribeOptions)public AsyncResult<SubscribeOptions> getSubscriptionOptions()
configureSubscription(rocks.xmpp.extensions.pubsub.model.SubscribeOptions)public AsyncResult<SubscribeOptions> getSubscriptionOptions(String subId)
subId - The subscription id.configureSubscription(rocks.xmpp.extensions.pubsub.model.SubscribeOptions)public AsyncResult<IQ> configureSubscription(SubscribeOptions subscribeOptions)
subscribeOptions - The subscription options form.public AsyncResult<List<Item>> getItems()
public AsyncResult<List<Item>> getItems(String... ids)
ids - The item ids.public AsyncResult<List<Item>> getItems(int maxItems)
maxItems - The maximal number of items.public AsyncResult<String> publish(Object item)
item - The item to be published. Note that this item must be known to the session, so that it can be marshalled into XML.XmppSessionConfiguration.Builder.extensions(Extension...)public AsyncResult<String> publish(Object item, PublishOptions publishOptions)
item - The item to be published. Note that this item must be known to the session, so that it can be marshalled into XML.publishOptions - The optional publish options.XmppSessionConfiguration.Builder.extensions(Extension...)public AsyncResult<String> publish(String id, Object item)
id - The item's id.item - The item to be published. Note that this item must be known to the session, so that it can be marshalled into XML.XmppSessionConfiguration.Builder.extensions(Extension...)public AsyncResult<String> publish(String id, Object item, PublishOptions publishOptions)
id - The item's id.item - The item to be published. Note that this item must be known to the session, so that it can be marshalled into XML.publishOptions - The optional publish options.XmppSessionConfiguration.Builder.extensions(Extension...)public AsyncResult<IQ> deleteItem(String id, boolean notify)
id - The item id.notify - If the pubsub service shall notify the subscribers about the deletion.public AsyncResult<String> create()
public AsyncResult<String> create(NodeConfiguration nodeConfiguration)
nodeConfiguration - The configuration form.public AsyncResult<NodeConfiguration> getNodeConfiguration()
public AsyncResult<IQ> configureNode(NodeConfiguration nodeConfiguration)
nodeConfiguration - The configuration form.public AsyncResult<IQ> delete()
public AsyncResult<IQ> delete(URI uri)
uri - The replacement node.public AsyncResult<IQ> purge()
public AsyncResult<List<PubSubNode>> discoverNodes()
public String getId()
public NodeType getType()
Copyright © 2014–2016 XMPP.rocks. All rights reserved.