Class DefaultNodeConfiguration

  • All Implemented Interfaces:
    Serializable, Cacheable

    public class DefaultNodeConfiguration
    extends Object
    implements Cacheable
    A DefaultNodeConfiguration keeps the default configuration values for leaf or collection nodes of a particular publish-subscribe service. New nodes created for the service will be initialized with the values defined in the default configuration.
    Author:
    Matt Tucker
    See Also:
    Serialized Form
    • Constructor Detail

      • DefaultNodeConfiguration

        public DefaultNodeConfiguration​(boolean isLeafType)
    • Method Detail

      • isLeaf

        public boolean isLeaf()
        Returns true if this default configutation belongs to a leaf node.
        Returns:
        true if this default configutation belongs to a leaf node.
      • isDeliverPayloads

        public boolean isDeliverPayloads()
        Returns true if payloads are going to be delivered with event notifications.
        Returns:
        true if payloads are going to be delivered with event notifications.
      • getMaxPayloadSize

        public int getMaxPayloadSize()
        Returns the maximum payload size in bytes.
        Returns:
        the maximum payload size in bytes.
      • isPersistPublishedItems

        public boolean isPersistPublishedItems()
        Returns true if items are going to be persisted in a storage. Note that when the variable is false then the last published item is the only items being saved to the backend storage.
        Returns:
        true if items are going to be persisted in a storage.
      • getMaxPublishedItems

        public int getMaxPublishedItems()
        Returns the maximum number of published items to persist. Note that all nodes are going to persist their published items. The only difference is the number of the last published items to be persisted. Even nodes that are configured to not use persitent items are going to save the last published item.
        Returns:
        the maximum number of published items to persist.
      • isNotifyConfigChanges

        public boolean isNotifyConfigChanges()
        Returns true if subscribers are going to be notified when node configuration changes.
        Returns:
        true if subscribers are going to be notified when node configuration changes.
      • isNotifyDelete

        public boolean isNotifyDelete()
        Returns true if subscribers are going to be notified when node is deleted.
        Returns:
        true if subscribers are going to be notified when node is deleted.
      • isNotifyRetract

        public boolean isNotifyRetract()
        Returns true if subscribers are going to be notified when items are removed from the node.
        Returns:
        true if subscribers are going to be notified when items are removed from the node.
      • isPresenceBasedDelivery

        public boolean isPresenceBasedDelivery()
        Returns true if notifications are going to be delivered only to available users.
        Returns:
        true if notifications are going to be delivered only to available users.
      • isSendItemSubscribe

        public boolean isSendItemSubscribe()
        Returns true if new subscribers are going to receive new items once subscribed.
        Returns:
        true if new subscribers are going to receive new items once subscribed.
      • getPublisherModel

        public PublisherModel getPublisherModel()
        Returnes the publisher model that specifies who is allowed to publish items to the node.
        Returns:
        the publisher model that specifies who is allowed to publish items to the node.
      • isSubscriptionEnabled

        public boolean isSubscriptionEnabled()
        Returns true if subscribing and unsubscribing are enabled.
        Returns:
        true if subscribing and unsubscribing are enabled.
      • getAccessModel

        public AccessModel getAccessModel()
        Returns the access model that specifies who is allowed to subscribe and retrieve items.
        Returns:
        the access model that specifies who is allowed to subscribe and retrieve items.
      • getLanguage

        public String getLanguage()
        Returns the default language of the node.
        Returns:
        the default language of the node.
      • getReplyPolicy

        public Node.ItemReplyPolicy getReplyPolicy()
        Returns the policy that defines whether owners or publisher should receive replies to items.
        Returns:
        the policy that defines whether owners or publisher should receive replies to items.
      • getAssociationPolicy

        public CollectionNode.LeafNodeAssociationPolicy getAssociationPolicy()
        Returns the policy that defines who may associate leaf nodes with a collection.
        Returns:
        the policy that defines who may associate leaf nodes with a collection.
      • getMaxLeafNodes

        public int getMaxLeafNodes()
        Returns the max number of leaf nodes that this collection node might have. A value of -1 means that there is no limit.
        Returns:
        the max number of leaf nodes that this collection node might have.
      • setDeliverPayloads

        public void setDeliverPayloads​(boolean deliverPayloads)
        Sets if payloads are going to be delivered with event notifications.
        Parameters:
        deliverPayloads - true if payloads are going to be delivered with event notifications.
      • setMaxPayloadSize

        public void setMaxPayloadSize​(int maxPayloadSize)
        Sets the maximum payload size in bytes.
        Parameters:
        maxPayloadSize - the maximum payload size in bytes.
      • setPersistPublishedItems

        public void setPersistPublishedItems​(boolean persistPublishedItems)
        Sets if items are going to be persisted in a storage. Note that when the variable is false then the last published item is the only items being saved to the backend storage.
        Parameters:
        persistPublishedItems - true if items are going to be persisted in a storage.
      • setMaxPublishedItems

        public void setMaxPublishedItems​(int maxPublishedItems)
        Sets the maximum number of published items to persist. Note that all nodes are going to persist their published items. The only difference is the number of the last published items to be persisted. Even nodes that are configured to not use persitent items are going to save the last published item.
        Parameters:
        maxPublishedItems - the maximum number of published items to persist.
      • setNotifyConfigChanges

        public void setNotifyConfigChanges​(boolean notifyConfigChanges)
        Sets if subscribers are going to be notified when node configuration changes.
        Parameters:
        notifyConfigChanges - true if subscribers are going to be notified when node configuration changes.
      • setNotifyDelete

        public void setNotifyDelete​(boolean notifyDelete)
        Sets if subscribers are going to be notified when node is deleted.
        Parameters:
        notifyDelete - true if subscribers are going to be notified when node is deleted.
      • setNotifyRetract

        public void setNotifyRetract​(boolean notifyRetract)
        Sets if subscribers are going to be notified when items are removed from the node.
        Parameters:
        notifyRetract - true if subscribers are going to be notified when items are removed from the node.
      • setPresenceBasedDelivery

        public void setPresenceBasedDelivery​(boolean presenceBasedDelivery)
        Sets if notifications are going to be delivered only to available users.
        Parameters:
        presenceBasedDelivery - true if notifications are going to be delivered only to available users.
      • setSendItemSubscribe

        public void setSendItemSubscribe​(boolean sendItemSubscribe)
        Sets if new subscribers are going to receive new items once subscribed.
        Parameters:
        sendItemSubscribe - true if new subscribers are going to receive new items once subscribed.
      • setPublisherModel

        public void setPublisherModel​(PublisherModel publisherModel)
        Sets the publisher model that specifies who is allowed to publish items to the node.
        Parameters:
        publisherModel - the publisher model that specifies who is allowed to publish items to the node.
      • setSubscriptionEnabled

        public void setSubscriptionEnabled​(boolean subscriptionEnabled)
        Sets if subscribing and unsubscribing are enabled.
        Parameters:
        subscriptionEnabled - true if subscribing and unsubscribing are enabled.
      • setAccessModel

        public void setAccessModel​(AccessModel accessModel)
        Sets the access model that specifies who is allowed to subscribe and retrieve items.
        Parameters:
        accessModel - the access model that specifies who is allowed to subscribe and retrieve items.
      • setLanguage

        public void setLanguage​(String language)
        Sets the default language of the node.
        Parameters:
        language - the default language of the node.
      • setReplyPolicy

        public void setReplyPolicy​(Node.ItemReplyPolicy replyPolicy)
        Sets the policy that defines whether owners or publisher should receive replies to items.
        Parameters:
        replyPolicy - the policy that defines whether owners or publisher should receive replies to items.
      • setAssociationPolicy

        public void setAssociationPolicy​(CollectionNode.LeafNodeAssociationPolicy associationPolicy)
        Sets the policy that defines who may associate leaf nodes with a collection.
        Parameters:
        associationPolicy - the policy that defines who may associate leaf nodes with a collection.
      • setMaxLeafNodes

        public void setMaxLeafNodes​(int maxLeafNodes)
        Sets the max number of leaf nodes that this collection node might have. A value of -1 means that there is no limit.
        Parameters:
        maxLeafNodes - the max number of leaf nodes that this collection node might have.
      • getConfigurationForm

        public org.xmpp.forms.DataForm getConfigurationForm()
      • getCachedSize

        public int getCachedSize()
                          throws CannotCalculateSizeException
        Returns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.

        Specified by:
        getCachedSize in interface Cacheable
        Returns:
        the size of the Object in bytes.
        Throws:
        CannotCalculateSizeException - if the size cannot be calculated