public final class NodeConfiguration
extends java.lang.Object
Represents a standardized DataForm
with form type http://jabber.org/protocol/pubsub#node_config
, which can be used to configure a pubsub node.
DataForm
to retrieve standard data from it, use:
NodeConfiguration nodeConfiguration = new NodeConfiguration(dataForm);
To build a form:
NodeConfiguration nodeConfiguration = NodeConfiguration.builder()
.accessModel(AccessModel.AUTHORIZE)
.bodyXslt(new URL("https://xmpp.org"))
.childrenAssociationPolicy(ChildrenAssociationPolicy.OWNERS)
.childrenAssociationWhitelist(Collections.singleton(Jid.of("domain")))
.children(Collections.singleton("collection1"))
.childrenMax(23)
.collection(Collections.singleton("collections"))
.contacts(Collections.singleton(Jid.of("contact")))
.dataformXslt(new URL("http://www.xmpp.org"))
.deliverNotifications(true)
.deliverPayloads(false)
.description("description")
.itemExpire(2)
.itemReply(ItemReply.OWNER)
.language("de")
.maxItems(4)
.maxPayloadSize(54)
.nodeType(NodeType.LEAF)
.notificationType(AbstractMessage.Type.NORMAL)
.notifyConfig(true)
.notifyDelete(true)
.notifyRetract(true)
.notifySub(true)
.persistItems(true)
.presenceBasedDelivery(true)
.publisherModel(PublisherModel.OPEN)
.purgeOffline(false)
.rosterGroupsAllowed(Arrays.asList("group1", "group2"))
.sendLastPublishedItem(SendLastPublishedItem.ON_SUB_AND_PRESENCE)
.temporarySubscriptions(true)
.allowSubscriptions(true)
.title("Title")
.type("Type")
.build();
Modifier and Type | Class and Description |
---|---|
static class |
NodeConfiguration.Builder
A builder to build node configurations.
|
Constructor and Description |
---|
NodeConfiguration(DataForm dataForm) |
Modifier and Type | Method and Description |
---|---|
static NodeConfiguration.Builder |
builder()
Gets the builder to build a node configuration.
|
AccessModel |
getAccessModel()
Who may subscribe and retrieve items.
|
java.net.URL |
getBodyXslt()
The URL of an XSL transformation which can be applied to payloads in order to generate an appropriate message body element.
|
java.util.List<java.lang.String> |
getChildren()
The child nodes (leaf or collection) associated with a collection.
|
ChildrenAssociationPolicy |
getChildrenAssociationPolicy()
Who may associate leaf nodes with a collection.
|
java.util.List<Jid> |
getChildrenAssociationWhitelist()
The list of JIDs that may associate leaf nodes with a collection.
|
java.lang.Integer |
getChildrenMax()
The maximum number of child nodes that can be associated with a collection.
|
java.util.List<java.lang.String> |
getCollection()
The collection(s) with which a node is affiliated.
|
java.util.List<Jid> |
getContacts()
The JIDs of those to contact with questions.
|
DataForm |
getDataForm()
Gets the underlying data form.
|
java.net.URL |
getDataformXslt()
The URL of an XSL transformation which can be applied to the payload format in order to generate a valid Data Forms result that the client could display using a generic Data Forms rendering engine.
|
java.lang.String |
getDescription()
A description of the node.
|
java.lang.Integer |
getItemExpire()
Number of seconds after which to automatically purge items.
|
ItemReply |
getItemReply()
Whether owners or publisher should receive replies to items.
|
java.lang.String |
getLanguage()
The default language of the node.
|
java.lang.Integer |
getMaxItems()
The maximum number of items to persist.
|
java.lang.Integer |
getMaxPayloadSize()
The maximum payload size in bytes
|
java.lang.String |
getNodeTitle()
A friendly name for the node.
|
NodeType |
getNodeType()
Whether the node is a leaf (default) or a collection.
|
Message.Type |
getNotificationType()
Specifies the delivery style for notifications.
|
java.lang.String |
getPayloadType()
The type of node data, usually specified by the namespace of the payload (if any).
|
PublisherModel |
getPublisherModel()
The publisher model.
|
java.util.List<java.lang.String> |
getRosterGroupsAllowed()
Gets the allowed roster groups.
|
SendLastPublishedItem |
getSendLastPublishedItem()
Gets the value which specifies when to send the last published item.
|
java.lang.Boolean |
isAllowSubscriptions()
Whether to allow subscriptions.
|
java.lang.Boolean |
isDeliverNotifications()
Whether to deliver event notifications.
|
java.lang.Boolean |
isDeliverPayloads()
Whether to deliver payloads with event notifications; applies only to leaf nodes.
|
java.lang.Boolean |
isNotifyConfig()
Whether to notify subscribers when the node configuration changes.
|
java.lang.Boolean |
isNotifyDelete()
Whether to notify subscribers when the node is deleted.
|
java.lang.Boolean |
isNotifyRetract()
Whether to notify subscribers when items are removed from the node.
|
java.lang.Boolean |
isNotifySub()
Whether to notify owners about new subscribers and unsubscribes.
|
java.lang.Boolean |
isPersistItems()
Whether to persist items to storage.
|
java.lang.Boolean |
isPresenceBasedDelivery()
Whether to deliver notifications to available users only.
|
java.lang.Boolean |
isPurgeOffline()
Whether to purge all items when the relevant publisher goes offline.
|
java.lang.Boolean |
isTemporarySubscriptions()
Whether to make all subscriptions temporary, based on subscriber presence.
|
public NodeConfiguration(DataForm dataForm)
public static NodeConfiguration.Builder builder()
Gets the builder to build a node configuration.
public final DataForm getDataForm()
Gets the underlying data form.
public final AccessModel getAccessModel()
Who may subscribe and retrieve items.
public final java.net.URL getBodyXslt()
The URL of an XSL transformation which can be applied to payloads in order to generate an appropriate message body element.
public final ChildrenAssociationPolicy getChildrenAssociationPolicy()
Who may associate leaf nodes with a collection.
public final java.util.List<Jid> getChildrenAssociationWhitelist()
The list of JIDs that may associate leaf nodes with a collection.
public final java.util.List<java.lang.String> getChildren()
The child nodes (leaf or collection) associated with a collection.
public final java.lang.Integer getChildrenMax()
The maximum number of child nodes that can be associated with a collection.
public final java.util.List<java.lang.String> getCollection()
The collection(s) with which a node is affiliated.
public final java.util.List<Jid> getContacts()
The JIDs of those to contact with questions.
public final java.net.URL getDataformXslt()
The URL of an XSL transformation which can be applied to the payload format in order to generate a valid Data Forms result that the client could display using a generic Data Forms rendering engine.
public final java.lang.Boolean isDeliverNotifications()
Whether to deliver event notifications.
public final java.lang.Boolean isDeliverPayloads()
Whether to deliver payloads with event notifications; applies only to leaf nodes.
public final java.lang.String getDescription()
A description of the node.
public final java.lang.Integer getItemExpire()
Number of seconds after which to automatically purge items.
public final ItemReply getItemReply()
Whether owners or publisher should receive replies to items.
public final java.lang.String getLanguage()
The default language of the node.
public final java.lang.Integer getMaxItems()
The maximum number of items to persist.
public final java.lang.Integer getMaxPayloadSize()
The maximum payload size in bytes
public final NodeType getNodeType()
Whether the node is a leaf (default) or a collection.
public final Message.Type getNotificationType()
Specifies the delivery style for notifications.
public final java.lang.Boolean isNotifyConfig()
Whether to notify subscribers when the node configuration changes.
public final java.lang.Boolean isNotifyDelete()
Whether to notify subscribers when the node is deleted.
public final java.lang.Boolean isNotifyRetract()
Whether to notify subscribers when items are removed from the node.
public final java.lang.Boolean isNotifySub()
Whether to notify owners about new subscribers and unsubscribes.
public final java.lang.Boolean isPersistItems()
Whether to persist items to storage.
public final java.lang.Boolean isPresenceBasedDelivery()
Whether to deliver notifications to available users only.
public final PublisherModel getPublisherModel()
The publisher model.
public final java.lang.Boolean isPurgeOffline()
Whether to purge all items when the relevant publisher goes offline.
public final java.util.List<java.lang.String> getRosterGroupsAllowed()
Gets the allowed roster groups.
public final SendLastPublishedItem getSendLastPublishedItem()
Gets the value which specifies when to send the last published item.
public final java.lang.Boolean isTemporarySubscriptions()
Whether to make all subscriptions temporary, based on subscriber presence.
public final java.lang.Boolean isAllowSubscriptions()
Whether to allow subscriptions.
public final java.lang.String getNodeTitle()
A friendly name for the node.
public final java.lang.String getPayloadType()
The type of node data, usually specified by the namespace of the payload (if any).
Copyright © 2014–2019 XMPP.rocks. All rights reserved.