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.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
public 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.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
public 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.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
public <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.NotConnectedException
public 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.XMPPErrorException
SmackException.NoResponseException
- if there was no response from the server.SmackException.NotConnectedException
public List<Subscription> getSubscriptions() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
public List<Affiliation> getAffiliations() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
public void deleteNode(String nodeId) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
nodeId
- XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
public ConfigureForm getDefaultConfiguration() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
public DiscoverInfo getSupportedFeatures() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException
DiscoverInfo
instance.XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException