001/**
002 *
003 * Copyright the original author or authors
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.jivesoftware.smackx.pubsub;
018
019import java.net.URL;
020
021import org.jivesoftware.smackx.pubsub.form.ConfigureForm;
022import org.jivesoftware.smackx.xdata.form.FilledForm;
023
024/**
025 * This enumeration represents all the fields of a node configuration form.  This enumeration
026 * is not required when using the {@link ConfigureForm} to configure nodes, but may be helpful
027 * for generic UI's using only a {@link FilledForm} for configuration.
028 *
029 * @author Robin Collier
030 */
031public enum ConfigureNodeFields {
032    /**
033     * Determines who may subscribe and retrieve items.
034     *
035     * <p><b>Value: {@link AccessModel}</b></p>
036     */
037    access_model,
038
039    /**
040     * The URL of an XSL transformation which can be applied to
041     * payloads in order to generate an appropriate message
042     * body element.
043     *
044     * <p><b>Value: {@link URL}</b></p>
045     */
046    body_xslt,
047
048    /**
049     * The collection with which a node is affiliated.
050     *
051     * <p><b>Value: String</b></p>
052     */
053    collection,
054
055    /**
056     * The URL of an XSL transformation which can be applied to
057     * payload format in order to generate a valid Data Forms result
058     * that the client could display using a generic Data Forms
059     * rendering engine body element.
060     *
061     * <p><b>Value: {@link URL}</b></p>
062     */
063    dataform_xslt,
064
065    /**
066     * Whether to deliver payloads with event notifications.
067     *
068     * <p><b>Value: boolean</b></p>
069     */
070    deliver_payloads,
071
072    /**
073     * Whether owners or publisher should receive replies to items.
074     *
075     * <p><b>Value: {@link ItemReply}</b></p>
076     */
077    itemreply,
078
079    /**
080     * Who may associate leaf nodes with a collection.
081     *
082     * <p><b>Value: {@link ChildrenAssociationPolicy}</b></p>
083     */
084    children_association_policy,
085
086    /**
087     * The list of JIDs that may associate leaf nodes with a
088     * collection.
089     *
090     * <p><b>Value: List of JIDs as Strings</b></p>
091     */
092    children_association_whitelist,
093
094    /**
095     * The child nodes (leaf or collection) associated with a collection.
096     *
097     * <p><b>Value: List of Strings</b></p>
098     */
099    children,
100
101    /**
102     * The maximum number of child nodes that can be associated with a
103     * collection.
104     *
105     * <p><b>Value: int</b></p>
106     */
107    children_max,
108
109    /**
110     * The maximum number of items to persist.
111     *
112     * <p><b>Value: int</b></p>
113     */
114    max_items,
115
116    /**
117     * The maximum payload size in bytes.
118     *
119     * <p><b>Value: int</b></p>
120     */
121    max_payload_size,
122
123    /**
124     * Whether the node is a leaf (default) or collection.
125     *
126     * <p><b>Value: {@link NodeType}</b></p>
127     */
128    node_type,
129
130    /**
131     * Whether to notify subscribers when the node configuration changes.
132     *
133     * <p><b>Value: boolean</b></p>
134     */
135    notify_config,
136
137    /**
138     * Whether to notify subscribers when the node is deleted.
139     *
140     * <p><b>Value: boolean</b></p>
141     */
142    notify_delete,
143
144    /**
145     * Whether to notify subscribers when items are removed from the node.
146     *
147     * <p><b>Value: boolean</b></p>
148     */
149    notify_retract,
150
151    /**
152     * The type of notification that the nodes sends.
153     *
154     * <p><b>Value:  {@link NotificationType}</b></p>
155     */
156    notification_type,
157
158    /**
159     * Whether to persist items to storage.  This is required to have. multiple
160     * items in the node.
161     *
162     * <p><b>Value: boolean</b></p>
163     */
164    persist_items,
165
166    /**
167     * Whether to deliver notifications to available users only.
168     *
169     * <p><b>Value: boolean</b></p>
170     */
171    presence_based_delivery,
172
173    /**
174     * Defines who can publish to the node.
175     *
176     * <p><b>Value: {@link PublishModel}</b></p>
177     */
178    publish_model,
179
180    /**
181     * The roster group(s) allowed to subscribe and retrieve items.
182     *
183     * <p><b>Value: List of strings</b></p>
184     */
185    roster_groups_allowed,
186
187    /**
188     * Whether to allow subscriptions.
189     *
190     * <p><b>Value: boolean</b></p>
191     */
192    subscribe,
193
194    /**
195     * A friendly name for the node.
196     *
197     * <p><b>Value: String</b></p>
198     */
199    title,
200
201    /**
202     * The type of node data, usually specified by the namespace
203     * of the payload(if any);MAY be a list-single rather than a
204     * text single.
205     *
206     * <p><b>Value: String</b></p>
207     */
208    type;
209
210    public String getFieldName() {
211        return "pubsub#" + toString();
212    }
213}