public final class PubSubManager extends Object
| Constructor and Description |
|---|
PubSubManager(XMPPConnection connection)
Create a pubsub manager associated to the specified connection.
|
PubSubManager(XMPPConnection connection,
String toAddress)
Create a pubsub manager associated to the specified connection where
the pubsub requests require a specific to address for packets.
|
| Modifier and Type | Method and Description |
|---|---|
LeafNode |
createNode()
Creates an instant node, if supported.
|
LeafNode |
createNode(String id)
Creates a node with default configuration.
|
Node |
createNode(String name,
Form config)
Creates a node with specified configuration.
|
void |
deleteNode(String nodeId)
Delete the specified node
|
DiscoverItems |
discoverNodes(String nodeId)
Get all the nodes that currently exist as a child of the specified
collection node.
|
List<Affiliation> |
getAffiliations()
Gets the affiliations on the root node.
|
ConfigureForm |
getDefaultConfiguration()
Returns the default settings for Node configuration.
|
<T extends Node> |
getNode(String id)
Retrieves the requested node, if it exists.
|
List<Subscription> |
getSubscriptions()
Gets the subscriptions on the root node.
|
DiscoverInfo |
getSupportedFeatures()
Gets the supported features of the servers pubsub implementation
as a standard
DiscoverInfo instance. |
public PubSubManager(XMPPConnection connection)
connection - The XMPP connectionpublic PubSubManager(XMPPConnection connection, String toAddress)
connection - The XMPP connectiontoAddress - The pubsub specific to address (required for some servers)public LeafNode createNode() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic LeafNode createNode(String id) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
id - The id of the node, which must be unique within the
pubsub serviceXMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic Node createNode(String name, Form config) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
name - The name of the node, which must be unique within the
pubsub serviceconfig - The configuration for the nodeXMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic <T extends Node> T getNode(String id) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
id - - The unique id of the nodeXMPPException.XMPPErrorException - The node does not existSmackException.NoResponseException - if there was no response from the server.SmackException.NotConnectedExceptionpublic DiscoverItems discoverNodes(String nodeId) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
nodeId - - The id of the collection node for which the child
nodes will be returned.DiscoverItems representing the existing nodesXMPPException.XMPPErrorExceptionSmackException.NoResponseException - if there was no response from the server.SmackException.NotConnectedExceptionpublic List<Subscription> getSubscriptions() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic List<Affiliation> getAffiliations() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic void deleteNode(String nodeId) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
nodeId - XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic ConfigureForm getDefaultConfiguration() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedExceptionpublic DiscoverInfo getSupportedFeatures() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
DiscoverInfo instance.XMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionSmackException.NotConnectedException