Class PubSubOwner
- java.lang.Object
-
- rocks.xmpp.extensions.pubsub.model.owner.PubSubOwner
-
public final class PubSubOwner extends Object
The implementation of the<pubsub/>element in thehttp://jabber.org/protocol/pubsub#ownernamespace.- See Also:
- XEP-0060: Publish-Subscribe, XML Schema
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Affiliation>getAffiliations()Gets the affiliations, if this pubsub element contains 'affiliations' element.DataFormgetConfigurationForm()Gets the configuration form if the pubsub element contains either a<configure/>or a<default/>element.StringgetNode()Gets the node of the child element.URIgetRedirectUri()Gets the redirect URI, if this pubsub element contains a 'delete' element.List<Subscription>getSubscriptions()Gets the subscriptions, if this pubsub element contains 'subscriptions' element.booleanisAffiliations()Indicates, whether this pubsub element contains a 'subscriptions' child element.booleanisConfigure()Indicates, whether this pubsub element contains a 'configure' child element.booleanisDefault()Indicates, whether this pubsub element contains a 'default' child element.booleanisDelete()Indicates, whether this pubsub element contains a 'delete' child element.booleanisPurge()Indicates, whether this pubsub element contains a 'purge' child element.booleanisSubscriptions()Indicates, whether this pubsub element contains a 'subscriptions' child element.static PubSubOwnerwithAffiliations(String node, Affiliation... affiliationNodes)Creates a pubsub element with a<affiliations/>child element with<affiliation/>elements.static PubSubOwnerwithConfigure(String node)Creates a pubsub element with an<configure/>child element and a 'node' attribute.static PubSubOwnerwithConfigure(String node, DataForm dataForm)Creates a pubsub element with an<configure/>child element and a 'node' attribute and a configuration form.static PubSubOwnerwithDefault()Creates a pubsub element with a<default/>child element.static PubSubOwnerwithDelete(String node)Creates a pubsub element with a<delete/>child element and a 'node' attribute.static PubSubOwnerwithDelete(String node, URI replacementNode)Creates a pubsub element with a<delete/>child element, a 'node' attribute and a replacement node.static PubSubOwnerwithPurge(String node)Creates a pubsub element with a<purge/>child element and a 'node' attribute.static PubSubOwnerwithSubscriptions(String node, Subscription... subscriptions)Creates a pubsub element with a<subscriptions/>child element with<subscription/>elements.
-
-
-
Method Detail
-
withConfigure
public static PubSubOwner withConfigure(String node)
Creates a pubsub element with an<configure/>child element and a 'node' attribute.Sample:
<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'> <configure node='princely_musings'/> </pubsub>- Parameters:
node- The node.- Returns:
- The pubsub instance.
- See Also:
- 8.2 Configure a Node
-
withConfigure
public static PubSubOwner withConfigure(String node, DataForm dataForm)
Creates a pubsub element with an<configure/>child element and a 'node' attribute and a configuration form.Sample:
<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'> <configure node='princely_musings'/> <x xmlns='jabber:x:data' type='submit'> <field var='FORM_TYPE' type='hidden'> ... </pubsub>- Parameters:
dataForm- The configuration form.node- The node.- Returns:
- The pubsub instance.
- See Also:
- 8.2.4 Form Submission
-
withDefault
public static PubSubOwner withDefault()
Creates a pubsub element with a<default/>child element.Sample:
<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'> <default/> </pubsub>- Returns:
- The pubsub instance.
- See Also:
- 8.3 Request Default Node Configuration Options
-
withDelete
public static PubSubOwner withDelete(String node)
Creates a pubsub element with a<delete/>child element and a 'node' attribute.Sample:
<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'> <delete node='princely_musings'/> </pubsub>- Parameters:
node- The node.- Returns:
- The pubsub instance.
- See Also:
- 8.4 Delete a Node
-
withDelete
public static PubSubOwner withDelete(String node, URI replacementNode)
Creates a pubsub element with a<delete/>child element, a 'node' attribute and a replacement node.Sample:
<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'> <delete node='princely_musings'> <redirect uri='xmpp:hamlet@denmark.lit?;node=blog'/> </delete> </pubsub>- Parameters:
node- The node.replacementNode- The replacement node.- Returns:
- The pubsub instance.
- See Also:
- 8.4 Delete a Node
-
withPurge
public static PubSubOwner withPurge(String node)
Creates a pubsub element with a<purge/>child element and a 'node' attribute.Sample:
<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'> <purge node='princely_musings'/> </pubsub>- Parameters:
node- The node.- Returns:
- The pubsub instance.
- See Also:
- 8.5 Purge All Node Items
-
withSubscriptions
public static PubSubOwner withSubscriptions(String node, Subscription... subscriptions)
Creates a pubsub element with a<subscriptions/>child element with<subscription/>elements.Sample:
<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'> <subscriptions node='princely_musings'> <subscription jid='bard@shakespeare.lit' subscription='subscribed'/> </subscriptions> </pubsub>- Parameters:
node- The node.subscriptions- The subscriptions.- Returns:
- The pubsub instance.
- See Also:
- 8.8.2 Modify Subscriptions
-
withAffiliations
public static PubSubOwner withAffiliations(String node, Affiliation... affiliationNodes)
Creates a pubsub element with a<affiliations/>child element with<affiliation/>elements.Sample:
<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'> <affiliations node='princely_musings'> <affiliation jid='bard@shakespeare.lit' affiliation='publisher'/> </affiliations> </pubsub>- Parameters:
node- The node.affiliationNodes- The affiliations.- Returns:
- The pubsub instance.
- See Also:
- 8.9.2 Modify Affiliation
-
getConfigurationForm
public final DataForm getConfigurationForm()
Gets the configuration form if the pubsub element contains either a<configure/>or a<default/>element.- Returns:
- The configuration form or null.
- See Also:
isConfigure(),isDefault()
-
getNode
public final String getNode()
Gets the node of the child element.- Returns:
- The node.
-
isConfigure
public final boolean isConfigure()
Indicates, whether this pubsub element contains a 'configure' child element.- Returns:
- True, if the pubsub element contains a 'configure' child element.
- See Also:
getConfigurationForm()
-
isDefault
public final boolean isDefault()
Indicates, whether this pubsub element contains a 'default' child element.- Returns:
- True, if the pubsub element contains a 'default' child element.
- See Also:
getConfigurationForm()
-
isDelete
public final boolean isDelete()
Indicates, whether this pubsub element contains a 'delete' child element.- Returns:
- True, if the pubsub element contains a 'delete' child element.
-
isPurge
public final boolean isPurge()
Indicates, whether this pubsub element contains a 'purge' child element.- Returns:
- True, if the pubsub element contains a 'purge' child element.
-
isSubscriptions
public final boolean isSubscriptions()
Indicates, whether this pubsub element contains a 'subscriptions' child element.- Returns:
- True, if the pubsub element contains a 'subscriptions' child element.
- See Also:
getSubscriptions()
-
isAffiliations
public final boolean isAffiliations()
Indicates, whether this pubsub element contains a 'subscriptions' child element.- Returns:
- True, if the pubsub element contains a 'subscriptions' child element.
- See Also:
getAffiliations()
-
getSubscriptions
public final List<Subscription> getSubscriptions()
Gets the subscriptions, if this pubsub element contains 'subscriptions' element.- Returns:
- The subscriptions, if the pubsub element contains a 'subscriptions' child element; otherwise an empty list.
-
getAffiliations
public final List<Affiliation> getAffiliations()
Gets the affiliations, if this pubsub element contains 'affiliations' element.- Returns:
- The affiliations, if the pubsub element contains a 'affiliations' child element; otherwise an empty list.
-
getRedirectUri
public final URI getRedirectUri()
Gets the redirect URI, if this pubsub element contains a 'delete' element.- Returns:
- The redirect URI, if this pubsub element contains a 'delete' element; otherwise null.
-
-