Class NodeConfiguration
- java.lang.Object
-
- rocks.xmpp.extensions.pubsub.model.NodeConfiguration
-
- All Implemented Interfaces:
StandardizedDataForm
public final class NodeConfiguration extends Object implements StandardizedDataForm
Represents a standardizedDataFormwith form typehttp://jabber.org/protocol/pubsub#node_config, which can be used to configure a pubsub node.Usage
To wrap an existingDataFormto retrieve standard data from it, use:
To build a form:NodeConfiguration nodeConfiguration = new NodeConfiguration(dataForm);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();- See Also:
- 16.4.4 pubsub#node_config FORM_TYPE
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNodeConfiguration.BuilderA builder to build node configurations.
-
Constructor Summary
Constructors Constructor Description NodeConfiguration(DataForm dataForm)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NodeConfiguration.Builderbuilder()Gets the builder to build a node configuration.AccessModelgetAccessModel()Who may subscribe and retrieve items.URLgetBodyXslt()The URL of an XSL transformation which can be applied to payloads in order to generate an appropriate message body element.List<String>getChildren()The child nodes (leaf or collection) associated with a collection.ChildrenAssociationPolicygetChildrenAssociationPolicy()Who may associate leaf nodes with a collection.List<Jid>getChildrenAssociationWhitelist()The list of JIDs that may associate leaf nodes with a collection.IntegergetChildrenMax()The maximum number of child nodes that can be associated with a collection.List<String>getCollection()The collection(s) with which a node is affiliated.List<Jid>getContacts()The JIDs of those to contact with questions.DataFormgetDataForm()Gets the underlying data form.URLgetDataformXslt()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.StringgetDescription()A description of the node.StringgetFormType()Gets the form type of the data form.IntegergetItemExpire()Number of seconds after which to automatically purge items.ItemReplygetItemReply()Whether owners or publisher should receive replies to items.StringgetLanguage()The default language of the node.IntegergetMaxItems()The maximum number of items to persist.IntegergetMaxPayloadSize()The maximum payload size in bytesStringgetNodeTitle()A friendly name for the node.NodeTypegetNodeType()Whether the node is a leaf (default) or a collection.Message.TypegetNotificationType()Specifies the delivery style for notifications.StringgetPayloadType()The type of node data, usually specified by the namespace of the payload (if any).PublisherModelgetPublisherModel()The publisher model.List<String>getRosterGroupsAllowed()Gets the allowed roster groups.SendLastPublishedItemgetSendLastPublishedItem()Gets the value which specifies when to send the last published item.BooleanisAllowSubscriptions()Whether to allow subscriptions.BooleanisDeliverNotifications()Whether to deliver event notifications.BooleanisDeliverPayloads()Whether to deliver payloads with event notifications; applies only to leaf nodes.BooleanisNotifyConfig()Whether to notify subscribers when the node configuration changes.BooleanisNotifyDelete()Whether to notify subscribers when the node is deleted.BooleanisNotifyRetract()Whether to notify subscribers when items are removed from the node.BooleanisNotifySub()Whether to notify owners about new subscribers and unsubscribes.BooleanisPersistItems()Whether to persist items to storage.BooleanisPresenceBasedDelivery()Whether to deliver notifications to available users only.BooleanisPurgeOffline()Whether to purge all items when the relevant publisher goes offline.BooleanisTemporarySubscriptions()Whether to make all subscriptions temporary, based on subscriber presence.NodeConfiguration.BuildertoBuilder()Converts this (immutable) data form to a builder, so that a modified form can be created.
-
-
-
Constructor Detail
-
NodeConfiguration
public NodeConfiguration(DataForm dataForm)
-
-
Method Detail
-
builder
public static NodeConfiguration.Builder builder()
Gets the builder to build a node configuration.- Returns:
- The builder.
-
getFormType
public final String getFormType()
Description copied from interface:StandardizedDataFormGets the form type of the data form.- Specified by:
getFormTypein interfaceStandardizedDataForm- Returns:
- The form type.
-
getDataForm
public final DataForm getDataForm()
Gets the underlying data form.- Specified by:
getDataFormin interfaceStandardizedDataForm- Returns:
- The underlying data form.
-
getAccessModel
public final AccessModel getAccessModel()
Who may subscribe and retrieve items.- Returns:
- The access model.
-
getBodyXslt
public final URL getBodyXslt()
The URL of an XSL transformation which can be applied to payloads in order to generate an appropriate message body element.- Returns:
- The URL.
-
getChildrenAssociationPolicy
public final ChildrenAssociationPolicy getChildrenAssociationPolicy()
Who may associate leaf nodes with a collection.- Returns:
- The children association policy.
-
getChildrenAssociationWhitelist
public final List<Jid> getChildrenAssociationWhitelist()
The list of JIDs that may associate leaf nodes with a collection.- Returns:
- The whitelist.
-
getChildren
public final List<String> getChildren()
The child nodes (leaf or collection) associated with a collection.- Returns:
- The child nodes.
-
getChildrenMax
public final Integer getChildrenMax()
The maximum number of child nodes that can be associated with a collection.- Returns:
- The max child nodes.
-
getCollection
public final List<String> getCollection()
The collection(s) with which a node is affiliated.- Returns:
- The collection(s).
-
getContacts
public final List<Jid> getContacts()
The JIDs of those to contact with questions.- Returns:
- The contacts.
-
getDataformXslt
public final 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.- Returns:
- The URL.
-
isDeliverNotifications
public final Boolean isDeliverNotifications()
Whether to deliver event notifications.- Returns:
- True, if whether event notifications are delivered.
-
isDeliverPayloads
public final Boolean isDeliverPayloads()
Whether to deliver payloads with event notifications; applies only to leaf nodes.- Returns:
- True, if payloads are delivered.
-
getDescription
public final String getDescription()
A description of the node.- Returns:
- The description.
-
getItemExpire
public final Integer getItemExpire()
Number of seconds after which to automatically purge items.- Returns:
- The seconds.
-
getItemReply
public final ItemReply getItemReply()
Whether owners or publisher should receive replies to items.- Returns:
- The item reply.
-
getLanguage
public final String getLanguage()
The default language of the node.- Returns:
- The language.
-
getMaxItems
public final Integer getMaxItems()
The maximum number of items to persist.- Returns:
- The max items.
-
getMaxPayloadSize
public final Integer getMaxPayloadSize()
The maximum payload size in bytes- Returns:
- The max payload size.
-
getNodeType
public final NodeType getNodeType()
Whether the node is a leaf (default) or a collection.- Returns:
- The node type.
-
getNotificationType
public final Message.Type getNotificationType()
Specifies the delivery style for notifications.- Returns:
- The notification type.
-
isNotifyConfig
public final Boolean isNotifyConfig()
Whether to notify subscribers when the node configuration changes.- Returns:
- True, if subscribers are notified when the node configuration changes.
-
isNotifyDelete
public final Boolean isNotifyDelete()
Whether to notify subscribers when the node is deleted.- Returns:
- True, if subscribers are notified when the node is deleted.
-
isNotifyRetract
public final Boolean isNotifyRetract()
Whether to notify subscribers when items are removed from the node.- Returns:
- True, if subscribers are notified when items are removed from the node.
-
isNotifySub
public final Boolean isNotifySub()
Whether to notify owners about new subscribers and unsubscribes.- Returns:
- True, if owners are notified about new subscribers and unsubscribes.
-
isPersistItems
public final Boolean isPersistItems()
Whether to persist items to storage.- Returns:
- True if items are persisted to storage.
-
isPresenceBasedDelivery
public final Boolean isPresenceBasedDelivery()
Whether to deliver notifications to available users only.- Returns:
- True, if notifications are only delivered to available users.
-
getPublisherModel
public final PublisherModel getPublisherModel()
The publisher model.- Returns:
- The publisher model.
-
isPurgeOffline
public final Boolean isPurgeOffline()
Whether to purge all items when the relevant publisher goes offline.- Returns:
- True, if all items are purged, when the relevant publisher goes offline.
-
getRosterGroupsAllowed
public final List<String> getRosterGroupsAllowed()
Gets the allowed roster groups.- Returns:
- The allowed roster groups.
-
getSendLastPublishedItem
public final SendLastPublishedItem getSendLastPublishedItem()
Gets the value which specifies when to send the last published item.- Returns:
- When to send the last published item.
-
isTemporarySubscriptions
public final Boolean isTemporarySubscriptions()
Whether to make all subscriptions temporary, based on subscriber presence.- Returns:
- True, if subscriptions are temporary.
-
isAllowSubscriptions
public final Boolean isAllowSubscriptions()
Whether to allow subscriptions.- Returns:
- True, if subscriptions are allowed.
-
getNodeTitle
public final String getNodeTitle()
A friendly name for the node.- Returns:
- The title.
-
getPayloadType
public final String getPayloadType()
The type of node data, usually specified by the namespace of the payload (if any).- Returns:
- The payload type.
-
toBuilder
public final NodeConfiguration.Builder toBuilder()
Converts this (immutable) data form to a builder, so that a modified form can be created.- Returns:
- The builder.
-
-