public class ConfigureForm extends Form
Form
to easily enable reading and updating
of node configuration. All operations read or update the underlying DataForm
.
Unlike the Form
.setAnswer(XXX)} methods, which throw an exception if the field does not
exist, all ConfigureForm.setXXX methods will create the field in the wrapped form
if it does not already exist.
Constructor and Description |
---|
ConfigureForm(DataForm.Type formType)
Create a new form for configuring a node.
|
ConfigureForm(DataForm configDataForm)
Create a decorator from an existing
DataForm that has been
retrieved from parsing a node configuration request. |
ConfigureForm(Form nodeConfigForm)
Create a decorator from an existing
Form for node configuration. |
Modifier and Type | Method and Description |
---|---|
AccessModel |
getAccessModel()
Get the currently configured
AccessModel , null if it is not set. |
String |
getBodyXSLT()
Returns 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 id's of the child nodes associated with a collection node (both leaf and collection).
|
ChildrenAssociationPolicy |
getChildrenAssociationPolicy()
Returns the policy that determines who may associate children with the node.
|
List<String> |
getChildrenAssociationWhitelist()
List of JID's that are on the whitelist that determines who can associate child nodes
with the collection node.
|
int |
getChildrenMax()
Gets the maximum number of child nodes that can be associated with the collection node.
|
String |
getCollection()
Gets the collection node which the node is affiliated with.
|
String |
getDataformXSLT()
Gets 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.
|
String |
getDataType()
The type of node data, usually specified by the namespace of the payload (if any).
|
ItemReply |
getItemReply()
Determines who should get replies to items.
|
int |
getMaxItems()
Gets the maximum number of items to persisted to this node if
isPersistItems() is
true. |
int |
getMaxPayloadSize()
Gets the maximum payload size in bytes.
|
NodeType |
getNodeType()
Gets the node type.
|
NotificationType |
getNotificationType()
Determines the type of notifications which are sent.
|
PublishModel |
getPublishModel()
Gets the publishing model for the node, which determines who may publish to it.
|
List<String> |
getReplyRoom()
List of the multi user chat rooms that are specified as reply rooms.
|
List<String> |
getReplyTo()
Gets the specific JID's for reply to.
|
List<String> |
getRosterGroupsAllowed()
Gets the roster groups that are allowed to subscribe and retrieve items.
|
String |
getTitle()
Gets the human readable node title.
|
boolean |
isDeliverPayloads()
Does the node deliver payloads with event notifications.
|
boolean |
isNotifyConfig()
Determines if subscribers should be notified when the configuration changes.
|
boolean |
isNotifyDelete()
Determines whether subscribers should be notified when the node is deleted.
|
boolean |
isNotifyRetract()
Determines whether subscribers should be notified when items are deleted
from the node.
|
boolean |
isPersistItems()
Determines whether items should be persisted in the node.
|
boolean |
isPresenceBasedDelivery()
Determines whether to deliver notifications to available users only.
|
boolean |
isSubscibe()
Deprecated.
use
isSubscribe() instead |
boolean |
isSubscribe()
Determines if subscriptions are allowed.
|
void |
setAccessModel(AccessModel accessModel)
Sets the value of access model.
|
void |
setBodyXSLT(String bodyXslt)
Set the URL of an XSL transformation which can be applied to payloads in order to
generate an appropriate message body element.
|
void |
setChildren(List<String> children)
Set the list of child node ids that are associated with a collection node.
|
void |
setChildrenAssociationPolicy(ChildrenAssociationPolicy policy)
Sets the policy that determines who may associate children with the node.
|
void |
setChildrenAssociationWhitelist(List<String> whitelist)
Set the JID's in the whitelist of users that can associate child nodes with the collection
node.
|
void |
setChildrenMax(int max)
Set the maximum number of child nodes that can be associated with a collection node.
|
void |
setCollection(String collection)
Sets the collection node which the node is affiliated with.
|
void |
setDataformXSLT(String url)
Sets 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.
|
void |
setDataType(String type)
Sets the type of node data, usually specified by the namespace of the payload (if any).
|
void |
setDeliverPayloads(boolean deliver)
Sets whether the node will deliver payloads with event notifications.
|
void |
setItemReply(ItemReply reply)
Sets who should get the replies to items.
|
void |
setMaxItems(int max)
Set the maximum number of items to persisted to this node if
isPersistItems() is
true. |
void |
setMaxPayloadSize(int max)
Sets the maximum payload size in bytes.
|
void |
setNodeType(NodeType type)
Sets the node type.
|
void |
setNotificationType(NotificationType notificationType)
Sets the NotificationType for the node.
|
void |
setNotifyConfig(boolean notify)
Sets whether subscribers should be notified when the configuration changes.
|
void |
setNotifyDelete(boolean notify)
Sets whether subscribers should be notified when the node is deleted.
|
void |
setNotifyRetract(boolean notify)
Sets whether subscribers should be notified when items are deleted
from the node.
|
void |
setPersistentItems(boolean persist)
Sets whether items should be persisted in the node.
|
void |
setPresenceBasedDelivery(boolean presenceBased)
Sets whether to deliver notifications to available users only.
|
void |
setPublishModel(PublishModel publish)
Sets the publishing model for the node, which determines who may publish to it.
|
void |
setReplyRoom(List<String> replyRooms)
Sets the multi user chat rooms that are specified as reply rooms.
|
void |
setReplyTo(List<String> replyTos)
Sets the specific JID's for reply to.
|
void |
setRosterGroupsAllowed(List<String> groups)
Sets the roster groups that are allowed to subscribe and retrieve items.
|
void |
setSubscribe(boolean subscribe)
Sets whether subscriptions are allowed.
|
void |
setTitle(String title)
Sets a human readable title for the node.
|
String |
toString() |
addField, createAnswerForm, getDataFormToSend, getField, getFields, getFormFrom, getInstructions, getType, hasField, setAnswer, setAnswer, setAnswer, setAnswer, setAnswer, setAnswer, setAnswer, setDefaultAnswer, setInstructions
public ConfigureForm(DataForm configDataForm)
DataForm
that has been
retrieved from parsing a node configuration request.configDataForm
- public ConfigureForm(Form nodeConfigForm)
Form
for node configuration.
Typically, this can be used to create a decorator for an answer form
by using the result of Form.createAnswerForm()
as the input parameter.nodeConfigForm
- public ConfigureForm(DataForm.Type formType)
PubSubManager.createNode(String, Form)
, since
configuration of an existing node is typically accomplished by calling Node.getNodeConfiguration()
and
using the resulting form to create a answer form. See ConfigureForm(Form)
.formType
- public AccessModel getAccessModel()
AccessModel
, null if it is not set.AccessModel
public void setAccessModel(AccessModel accessModel)
accessModel
- public String getBodyXSLT()
public void setBodyXSLT(String bodyXslt)
bodyXslt
- The URL of an XSLpublic List<String> getChildren()
public void setChildren(List<String> children)
children
- public ChildrenAssociationPolicy getChildrenAssociationPolicy()
public void setChildrenAssociationPolicy(ChildrenAssociationPolicy policy)
policy
- The policy being setpublic List<String> getChildrenAssociationWhitelist()
getChildrenAssociationPolicy()
is set to
ChildrenAssociationPolicy.whitelist
.public void setChildrenAssociationWhitelist(List<String> whitelist)
getChildrenAssociationPolicy()
is set to
ChildrenAssociationPolicy.whitelist
.whitelist
- The list of JID'spublic int getChildrenMax()
public void setChildrenMax(int max)
max
- The maximum number of child nodes.public String getCollection()
public void setCollection(String collection)
collection
- The node id of the collection nodepublic String getDataformXSLT()
public void setDataformXSLT(String url)
url
- The URL of an XSL transformationpublic boolean isDeliverPayloads()
public void setDeliverPayloads(boolean deliver)
deliver
- true if the payload will be delivered, false otherwisepublic ItemReply getItemReply()
public void setItemReply(ItemReply reply)
reply
- Defines who should get the replypublic int getMaxItems()
isPersistItems()
is
true.public void setMaxItems(int max)
isPersistItems()
is
true.max
- The maximum number of items to persistpublic int getMaxPayloadSize()
public void setMaxPayloadSize(int max)
max
- The maximum payload sizepublic NodeType getNodeType()
public void setNodeType(NodeType type)
type
- The node typepublic boolean isNotifyConfig()
public void setNotifyConfig(boolean notify)
notify
- true if subscribers should be notified, false otherwisepublic boolean isNotifyDelete()
public void setNotifyDelete(boolean notify)
notify
- true if subscribers should be notified, false otherwisepublic boolean isNotifyRetract()
public void setNotifyRetract(boolean notify)
notify
- true if subscribers should be notified, false otherwisepublic NotificationType getNotificationType()
public void setNotificationType(NotificationType notificationType)
notificationType
- The enum representing the possible optionspublic boolean isPersistItems()
public void setPersistentItems(boolean persist)
persist
- true if items should be persisted, false otherwisepublic boolean isPresenceBasedDelivery()
public void setPresenceBasedDelivery(boolean presenceBased)
presenceBased
- true if user must be available, false otherwisepublic PublishModel getPublishModel()
public void setPublishModel(PublishModel publish)
publish
- The enum representing the possible options for the publishing modelpublic List<String> getReplyRoom()
public void setReplyRoom(List<String> replyRooms)
replyRooms
- The multi user chat room to use as reply roomspublic List<String> getReplyTo()
public void setReplyTo(List<String> replyTos)
replyTos
- The JID's to reply topublic List<String> getRosterGroupsAllowed()
public void setRosterGroupsAllowed(List<String> groups)
groups
- The roster groups@Deprecated public boolean isSubscibe()
isSubscribe()
insteadpublic boolean isSubscribe()
public void setSubscribe(boolean subscribe)
subscribe
- true if they are, false otherwisepublic String getDataType()
public void setDataType(String type)
type
- The type of node data