ConfigureNodeFields.java

  1. /**
  2.  *
  3.  * Copyright the original author or authors
  4.  *
  5.  * Licensed under the Apache License, Version 2.0 (the "License");
  6.  * you may not use this file except in compliance with the License.
  7.  * You may obtain a copy of the License at
  8.  *
  9.  *     http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.jivesoftware.smackx.pubsub;

  18. import java.net.URL;

  19. import org.jivesoftware.smackx.pubsub.form.ConfigureForm;
  20. import org.jivesoftware.smackx.xdata.form.FilledForm;

  21. /**
  22.  * This enumeration represents all the fields of a node configuration form.  This enumeration
  23.  * is not required when using the {@link ConfigureForm} to configure nodes, but may be helpful
  24.  * for generic UI's using only a {@link FilledForm} for configuration.
  25.  *
  26.  * @author Robin Collier
  27.  */
  28. public enum ConfigureNodeFields {
  29.     /**
  30.      * Determines who may subscribe and retrieve items.
  31.      *
  32.      * <p><b>Value: {@link AccessModel}</b></p>
  33.      */
  34.     access_model,

  35.     /**
  36.      * The URL of an XSL transformation which can be applied to
  37.      * payloads in order to generate an appropriate message
  38.      * body element.
  39.      *
  40.      * <p><b>Value: {@link URL}</b></p>
  41.      */
  42.     body_xslt,

  43.     /**
  44.      * The collection with which a node is affiliated.
  45.      *
  46.      * <p><b>Value: String</b></p>
  47.      */
  48.     collection,

  49.     /**
  50.      * The URL of an XSL transformation which can be applied to
  51.      * payload format in order to generate a valid Data Forms result
  52.      * that the client could display using a generic Data Forms
  53.      * rendering engine body element.
  54.      *
  55.      * <p><b>Value: {@link URL}</b></p>
  56.      */
  57.     dataform_xslt,

  58.     /**
  59.      * Whether to deliver payloads with event notifications.
  60.      *
  61.      * <p><b>Value: boolean</b></p>
  62.      */
  63.     deliver_payloads,

  64.     /**
  65.      * Whether owners or publisher should receive replies to items.
  66.      *
  67.      * <p><b>Value: {@link ItemReply}</b></p>
  68.      */
  69.     itemreply,

  70.     /**
  71.      * Who may associate leaf nodes with a collection.
  72.      *
  73.      * <p><b>Value: {@link ChildrenAssociationPolicy}</b></p>
  74.      */
  75.     children_association_policy,

  76.     /**
  77.      * The list of JIDs that may associate leaf nodes with a
  78.      * collection.
  79.      *
  80.      * <p><b>Value: List of JIDs as Strings</b></p>
  81.      */
  82.     children_association_whitelist,

  83.     /**
  84.      * The child nodes (leaf or collection) associated with a collection.
  85.      *
  86.      * <p><b>Value: List of Strings</b></p>
  87.      */
  88.     children,

  89.     /**
  90.      * The maximum number of child nodes that can be associated with a
  91.      * collection.
  92.      *
  93.      * <p><b>Value: int</b></p>
  94.      */
  95.     children_max,

  96.     /**
  97.      * The maximum number of items to persist.
  98.      *
  99.      * <p><b>Value: int</b></p>
  100.      */
  101.     max_items,

  102.     /**
  103.      * The maximum payload size in bytes.
  104.      *
  105.      * <p><b>Value: int</b></p>
  106.      */
  107.     max_payload_size,

  108.     /**
  109.      * Whether the node is a leaf (default) or collection.
  110.      *
  111.      * <p><b>Value: {@link NodeType}</b></p>
  112.      */
  113.     node_type,

  114.     /**
  115.      * Whether to notify subscribers when the node configuration changes.
  116.      *
  117.      * <p><b>Value: boolean</b></p>
  118.      */
  119.     notify_config,

  120.     /**
  121.      * Whether to notify subscribers when the node is deleted.
  122.      *
  123.      * <p><b>Value: boolean</b></p>
  124.      */
  125.     notify_delete,

  126.     /**
  127.      * Whether to notify subscribers when items are removed from the node.
  128.      *
  129.      * <p><b>Value: boolean</b></p>
  130.      */
  131.     notify_retract,

  132.     /**
  133.      * The type of notification that the nodes sends.
  134.      *
  135.      * <p><b>Value:  {@link NotificationType}</b></p>
  136.      */
  137.     notification_type,

  138.     /**
  139.      * Whether to persist items to storage.  This is required to have. multiple
  140.      * items in the node.
  141.      *
  142.      * <p><b>Value: boolean</b></p>
  143.      */
  144.     persist_items,

  145.     /**
  146.      * Whether to deliver notifications to available users only.
  147.      *
  148.      * <p><b>Value: boolean</b></p>
  149.      */
  150.     presence_based_delivery,

  151.     /**
  152.      * Defines who can publish to the node.
  153.      *
  154.      * <p><b>Value: {@link PublishModel}</b></p>
  155.      */
  156.     publish_model,

  157.     /**
  158.      * The roster group(s) allowed to subscribe and retrieve items.
  159.      *
  160.      * <p><b>Value: List of strings</b></p>
  161.      */
  162.     roster_groups_allowed,

  163.     /**
  164.      * Whether to allow subscriptions.
  165.      *
  166.      * <p><b>Value: boolean</b></p>
  167.      */
  168.     subscribe,

  169.     /**
  170.      * A friendly name for the node.
  171.      *
  172.      * <p><b>Value: String</b></p>
  173.      */
  174.     title,

  175.     /**
  176.      * The type of node data, usually specified by the namespace
  177.      * of the payload(if any);MAY be a list-single rather than a
  178.      * text single.
  179.      *
  180.      * <p><b>Value: String</b></p>
  181.      */
  182.     type;

  183.     public String getFieldName() {
  184.         return "pubsub#" + toString();
  185.     }
  186. }