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.xdata.Form;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  156.     /**
  157.      * The specific multi-user chat rooms to specify for replyroom.
  158.      *
  159.      * <p><b>Value: List of JIDs as Strings</b></p>
  160.      */
  161.     replyroom,

  162.     /**
  163.      * The specific JID(s) to specify for replyto.
  164.      *
  165.      * <p><b>Value: List of JIDs as Strings</b></p>
  166.      */
  167.     replyto,

  168.     /**
  169.      * The roster group(s) allowed to subscribe and retrieve items.
  170.      *
  171.      * <p><b>Value: List of strings</b></p>
  172.      */
  173.     roster_groups_allowed,

  174.     /**
  175.      * Whether to allow subscriptions.
  176.      *
  177.      * <p><b>Value: boolean</b></p>
  178.      */
  179.     subscribe,

  180.     /**
  181.      * A friendly name for the node.
  182.      *
  183.      * <p><b>Value: String</b></p>
  184.      */
  185.     title,

  186.     /**
  187.      * The type of node data, usually specified by the namespace
  188.      * of the payload(if any);MAY be a list-single rather than a
  189.      * text single.
  190.      *
  191.      * <p><b>Value: String</b></p>
  192.      */
  193.     type;

  194.     public String getFieldName() {
  195.         return "pubsub#" + toString();
  196.     }
  197. }