Package rocks.xmpp.extensions.pubsub
Class PubSubService
- java.lang.Object
-
- rocks.xmpp.extensions.pubsub.PubSubService
-
- All Implemented Interfaces:
Addressable
public final class PubSubService extends Object implements Addressable
This class acts a facade to deal with a remote pubsub service.E.g. it lets you get all your subscriptions on the service, let's you work with nodes (e.g. subscribe to nodes) or let's you discover the features provided by the remote service.
To work with pubsub nodes, create a local node instance, which can be used to work the remote node (e.g. subscribe to the node).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AsyncResult<Collection<PubSubFeature>>
discoverFeatures()
Discovers the features, which are supported by the pubsub service.AsyncResult<List<PubSubNode>>
discoverNodes()
Discovers the first-level nodes of this pubsub service.Jid
getAddress()
Deprecated.UsegetJid()
AsyncResult<List<Affiliation>>
getAffiliations()
Gets the affiliations for all nodes.AsyncResult<DataForm>
getDefaultNodeConfiguration()
Gets the default node configuration form for this pubsub service.AsyncResult<DataForm>
getDefaultSubscriptionOptions()
Gets the default subscription options for this pubsub service.Jid
getJid()
Gets the service address.String
getName()
Gets the name of this service.AsyncResult<List<Subscription>>
getSubscriptions()
Gets the subscriptions for all nodes.PubSubNode
node(String node)
Creates a pubsub node locally, which can be used to work with a node at the pubsub service.String
toString()
Returns the service address.
-
-
-
Method Detail
-
discoverFeatures
public AsyncResult<Collection<PubSubFeature>> discoverFeatures()
Discovers the features, which are supported by the pubsub service.- Returns:
- The async result with the set of supported features.
- See Also:
- 5.1 Discover Features
-
discoverNodes
public AsyncResult<List<PubSubNode>> discoverNodes()
Discovers the first-level nodes of this pubsub service.- Returns:
- The async result with the list of nodes.
- See Also:
- 5.2 Discover Nodes
-
node
public PubSubNode node(String node)
Creates a pubsub node locally, which can be used to work with a node at the pubsub service.- Parameters:
node
- The node.- Returns:
- The node.
-
getSubscriptions
public AsyncResult<List<Subscription>> getSubscriptions()
Gets the subscriptions for all nodes.- Returns:
- The async result with the subscriptions for all nodes.
- See Also:
- 5.6 Retrieve Subscriptions
-
getAffiliations
public AsyncResult<List<Affiliation>> getAffiliations()
Gets the affiliations for all nodes.- Returns:
- The async result with the affiliations for all nodes.
- See Also:
- 5.7 Retrieve Affiliations
-
getDefaultSubscriptionOptions
public AsyncResult<DataForm> getDefaultSubscriptionOptions()
Gets the default subscription options for this pubsub service.- Returns:
- The async result with the default subscription options.
- See Also:
- 6.4 Request Default Subscription Configuration Options
-
getDefaultNodeConfiguration
public AsyncResult<DataForm> getDefaultNodeConfiguration()
Gets the default node configuration form for this pubsub service.- Returns:
- The async result with the configuration form.
- See Also:
- 8.3 Request Default Node Configuration Options
-
getAddress
@Deprecated public Jid getAddress()
Deprecated.UsegetJid()
Gets the service address.- Returns:
- The service address.
-
getJid
public Jid getJid()
Gets the service address.- Specified by:
getJid
in interfaceAddressable
- Returns:
- The service address.
-
toString
public String toString()
Returns the service address.
-
getName
public String getName()
Gets the name of this service.- Returns:
- The name or null, if the name is unknown.
-
-