1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-12-13 06:21:08 +01:00

Enable trailing whitespace checkstyle check

for all source code regions, including javadoc.
This commit is contained in:
Florian Schmaus 2018-05-09 23:06:12 +02:00
parent 9d61a6de7d
commit e8923b9d16
545 changed files with 3713 additions and 3715 deletions

View file

@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub;
/**
* This enumeration represents the access models for the PubSub node
* as defined in the PubSub specification section <a href="http://xmpp.org/extensions/xep-0060.html#registrar-formtypes-config">16.4.3</a>.
*
*
* @author Robin Collier
*/
public enum AccessModel {

View file

@ -29,11 +29,11 @@ import org.jxmpp.jid.BareJid;
/**
* Represents a affiliation between a user and a node, where the {@link Type} defines
* the type of affiliation.
*
* Affiliations are retrieved from the {@link PubSubManager#getAffiliations()} method, which
* gets affiliations for the calling user, based on the identity that is associated with
*
* Affiliations are retrieved from the {@link PubSubManager#getAffiliations()} method, which
* gets affiliations for the calling user, based on the identity that is associated with
* the {@link XMPPConnection}.
*
*
* @author Robin Collier
*/
public class Affiliation implements ExtensionElement {
@ -70,7 +70,7 @@ public class Affiliation implements ExtensionElement {
/**
* Constructs an affiliation.
*
*
* @param node The node the user is affiliated with.
* @param affiliation the optional affiliation.
*/
@ -80,7 +80,7 @@ public class Affiliation implements ExtensionElement {
/**
* Constructs an affiliation.
*
*
* @param node The node the user is affiliated with.
* @param affiliation the optional affiliation.
* @param namespace the affiliation's namespace.

View file

@ -27,7 +27,7 @@ import org.jivesoftware.smackx.pubsub.Affiliation.AffiliationNamespace;
* Represents the <b>affiliations</b> element of the reply to a request for affiliations.
* It is defined in the specification in section <a href="http://xmpp.org/extensions/xep-0060.html#entity-affiliations">5.7 Retrieve Affiliations</a> and
* <a href="http://www.xmpp.org/extensions/xep-0060.html#owner-affiliations">8.9 Manage Affiliations</a>.
*
*
* @author Robin Collier
*/
public class AffiliationsExtension extends NodeExtension {

View file

@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub;
/**
* This enumeration represents the children association policy for associating leaf nodes
* with collection nodes as defined in the PubSub specification section <a href="http://xmpp.org/extensions/xep-0060.html#registrar-formtypes-config">16.4.3</a>.
*
*
* @author Robin Collier
*/
public enum ChildrenAssociationPolicy {

View file

@ -24,9 +24,9 @@ import org.jivesoftware.smack.packet.ExtensionElement;
/**
* Represents the <b>configuration</b> element of a PubSub message event which
* associates a configuration form to the node which was configured. The form
* associates a configuration form to the node which was configured. The form
* contains the current node configuration.
*
*
* @author Robin Collier
*/
public class ConfigurationEvent extends NodeExtension implements EmbeddedPacketExtension {

View file

@ -26,18 +26,18 @@ import org.jivesoftware.smackx.xdata.packet.DataForm;
/**
* A decorator for a {@link Form} to easily enable reading and updating
* of node configuration. All operations read or update the underlying {@link DataForm}.
*
*
* <p>Unlike the {@link Form}.setAnswer(XXX)} methods, which throw an exception if the field does not
* exist, all <b>ConfigureForm.setXXX</b> methods will create the field in the wrapped form
* if it does not already exist.
*
* if it does not already exist.
*
* @author Robin Collier
*/
public class ConfigureForm extends Form {
/**
* Create a decorator from an existing {@link DataForm} that has been
* retrieved from parsing a node configuration request.
*
*
* @param configDataForm
*/
public ConfigureForm(DataForm configDataForm) {
@ -48,7 +48,7 @@ public class ConfigureForm extends Form {
* Create a decorator from an existing {@link Form} for node configuration.
* Typically, this can be used to create a decorator for an answer form
* by using the result of {@link #createAnswerForm()} as the input parameter.
*
*
* @param nodeConfigForm
*/
public ConfigureForm(Form nodeConfigForm) {
@ -56,8 +56,8 @@ public class ConfigureForm extends Form {
}
/**
* Create a new form for configuring a node. This would typically only be used
* when creating and configuring a node at the same time via {@link PubSubManager#createNode(String, Form)}, since
* Create a new form for configuring a node. This would typically only be used
* when creating and configuring a node at the same time via {@link PubSubManager#createNode(String, Form)}, since
* configuration of an existing node is typically accomplished by calling {@link LeafNode#getNodeConfiguration()} and
* using the resulting form to create a answer form. See {@link #ConfigureForm(Form)}.
* @param formType
@ -68,7 +68,7 @@ public class ConfigureForm extends Form {
/**
* Get the currently configured {@link AccessModel}, null if it is not set.
*
*
* @return The current {@link AccessModel}
*/
public AccessModel getAccessModel() {
@ -82,7 +82,7 @@ public class ConfigureForm extends Form {
/**
* Sets the value of access model.
*
*
* @param accessModel
*/
public void setAccessModel(AccessModel accessModel) {
@ -91,9 +91,9 @@ public class ConfigureForm extends Form {
}
/**
* Returns the URL of an XSL transformation which can be applied to payloads in order to
* Returns the URL of an XSL transformation which can be applied to payloads in order to
* generate an appropriate message body element.
*
*
* @return URL to an XSL
*/
public String getBodyXSLT() {
@ -101,9 +101,9 @@ public class ConfigureForm extends Form {
}
/**
* Set the URL of an XSL transformation which can be applied to payloads in order to
* Set the URL of an XSL transformation which can be applied to payloads in order to
* generate an appropriate message body element.
*
*
* @param bodyXslt The URL of an XSL
*/
public void setBodyXSLT(String bodyXslt) {
@ -113,7 +113,7 @@ public class ConfigureForm extends Form {
/**
* The id's of the child nodes associated with a collection node (both leaf and collection).
*
*
* @return list of child nodes.
*/
public List<String> getChildren() {
@ -122,7 +122,7 @@ public class ConfigureForm extends Form {
/**
* Set the list of child node ids that are associated with a collection node.
*
*
* @param children
*/
public void setChildren(List<String> children) {
@ -132,7 +132,7 @@ public class ConfigureForm extends Form {
/**
* Returns the policy that determines who may associate children with the node.
*
*
* @return The current policy
*/
public ChildrenAssociationPolicy getChildrenAssociationPolicy() {
@ -146,7 +146,7 @@ public class ConfigureForm extends Form {
/**
* Sets the policy that determines who may associate children with the node.
*
*
* @param policy The policy being set
*/
public void setChildrenAssociationPolicy(ChildrenAssociationPolicy policy) {
@ -157,10 +157,10 @@ public class ConfigureForm extends Form {
}
/**
* List of JID's that are on the whitelist that determines who can associate child nodes
* List of JID's that are on the whitelist that determines who can associate child nodes
* with the collection node. This is only relevant if {@link #getChildrenAssociationPolicy()} is set to
* {@link ChildrenAssociationPolicy#whitelist}.
*
*
* @return List of the whitelist
*/
public List<String> getChildrenAssociationWhitelist() {
@ -168,10 +168,10 @@ public class ConfigureForm extends Form {
}
/**
* Set the JID's in the whitelist of users that can associate child nodes with the collection
* Set the JID's in the whitelist of users that can associate child nodes with the collection
* node. This is only relevant if {@link #getChildrenAssociationPolicy()} is set to
* {@link ChildrenAssociationPolicy#whitelist}.
*
*
* @param whitelist The list of JID's
*/
public void setChildrenAssociationWhitelist(List<String> whitelist) {
@ -181,7 +181,7 @@ public class ConfigureForm extends Form {
/**
* Gets the maximum number of child nodes that can be associated with the collection node.
*
*
* @return The maximum number of child nodes
*/
public int getChildrenMax() {
@ -190,7 +190,7 @@ public class ConfigureForm extends Form {
/**
* Set the maximum number of child nodes that can be associated with a collection node.
*
*
* @param max The maximum number of child nodes.
*/
public void setChildrenMax(int max) {
@ -200,7 +200,7 @@ public class ConfigureForm extends Form {
/**
* Gets the collection node which the node is affiliated with.
*
*
* @return The collection node id
*/
public String getCollection() {
@ -209,7 +209,7 @@ public class ConfigureForm extends Form {
/**
* Sets the collection node which the node is affiliated with.
*
*
* @param collection The node id of the collection node
*/
public void setCollection(String collection) {
@ -221,7 +221,7 @@ public class ConfigureForm extends Form {
* 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.
*
*
* @return The URL of an XSL transformation
*/
public String getDataformXSLT() {
@ -232,7 +232,7 @@ public class ConfigureForm extends Form {
* 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.
*
*
* @param url The URL of an XSL transformation
*/
public void setDataformXSLT(String url) {
@ -242,7 +242,7 @@ public class ConfigureForm extends Form {
/**
* Does the node deliver payloads with event notifications.
*
*
* @return true if it does, false otherwise
*/
public boolean isDeliverPayloads() {
@ -251,7 +251,7 @@ public class ConfigureForm extends Form {
/**
* Sets whether the node will deliver payloads with event notifications.
*
*
* @param deliver true if the payload will be delivered, false otherwise
*/
public void setDeliverPayloads(boolean deliver) {
@ -261,7 +261,7 @@ public class ConfigureForm extends Form {
/**
* Determines who should get replies to items.
*
*
* @return Who should get the reply
*/
public ItemReply getItemReply() {
@ -275,7 +275,7 @@ public class ConfigureForm extends Form {
/**
* Sets who should get the replies to items.
*
*
* @param reply Defines who should get the reply
*/
public void setItemReply(ItemReply reply) {
@ -286,7 +286,7 @@ public class ConfigureForm extends Form {
/**
* Gets the maximum number of items to persisted to this node if {@link #isPersistItems()} is
* true.
*
*
* @return The maximum number of items to persist
*/
public int getMaxItems() {
@ -296,7 +296,7 @@ public class ConfigureForm extends Form {
/**
* Set the maximum number of items to persisted to this node if {@link #isPersistItems()} is
* true.
*
*
* @param max The maximum number of items to persist
*/
public void setMaxItems(int max) {
@ -306,7 +306,7 @@ public class ConfigureForm extends Form {
/**
* Gets the maximum payload size in bytes.
*
*
* @return The maximum payload size
*/
public int getMaxPayloadSize() {
@ -315,7 +315,7 @@ public class ConfigureForm extends Form {
/**
* Sets the maximum payload size in bytes.
*
*
* @param max The maximum payload size
*/
public void setMaxPayloadSize(int max) {
@ -325,7 +325,7 @@ public class ConfigureForm extends Form {
/**
* Gets the node type.
*
*
* @return The node type
*/
public NodeType getNodeType() {
@ -339,7 +339,7 @@ public class ConfigureForm extends Form {
/**
* Sets the node type.
*
*
* @param type The node type
*/
public void setNodeType(NodeType type) {
@ -349,7 +349,7 @@ public class ConfigureForm extends Form {
/**
* Determines if subscribers should be notified when the configuration changes.
*
*
* @return true if they should be notified, false otherwise
*/
public boolean isNotifyConfig() {
@ -358,7 +358,7 @@ public class ConfigureForm extends Form {
/**
* Sets whether subscribers should be notified when the configuration changes.
*
*
* @param notify true if subscribers should be notified, false otherwise
*/
public void setNotifyConfig(boolean notify) {
@ -368,7 +368,7 @@ public class ConfigureForm extends Form {
/**
* Determines whether subscribers should be notified when the node is deleted.
*
*
* @return true if subscribers should be notified, false otherwise
*/
public boolean isNotifyDelete() {
@ -377,7 +377,7 @@ public class ConfigureForm extends Form {
/**
* Sets whether subscribers should be notified when the node is deleted.
*
*
* @param notify true if subscribers should be notified, false otherwise
*/
public void setNotifyDelete(boolean notify) {
@ -386,9 +386,9 @@ public class ConfigureForm extends Form {
}
/**
* Determines whether subscribers should be notified when items are deleted
* Determines whether subscribers should be notified when items are deleted
* from the node.
*
*
* @return true if subscribers should be notified, false otherwise
*/
public boolean isNotifyRetract() {
@ -396,9 +396,9 @@ public class ConfigureForm extends Form {
}
/**
* Sets whether subscribers should be notified when items are deleted
* Sets whether subscribers should be notified when items are deleted
* from the node.
*
*
* @param notify true if subscribers should be notified, false otherwise
*/
public void setNotifyRetract(boolean notify) {
@ -432,7 +432,7 @@ public class ConfigureForm extends Form {
/**
* Determines whether items should be persisted in the node.
*
*
* @return true if items are persisted
*/
public boolean isPersistItems() {
@ -441,7 +441,7 @@ public class ConfigureForm extends Form {
/**
* Sets whether items should be persisted in the node.
*
*
* @param persist true if items should be persisted, false otherwise
*/
public void setPersistentItems(boolean persist) {
@ -451,7 +451,7 @@ public class ConfigureForm extends Form {
/**
* Determines whether to deliver notifications to available users only.
*
*
* @return true if users must be available
*/
public boolean isPresenceBasedDelivery() {
@ -460,7 +460,7 @@ public class ConfigureForm extends Form {
/**
* Sets whether to deliver notifications to available users only.
*
*
* @param presenceBased true if user must be available, false otherwise
*/
public void setPresenceBasedDelivery(boolean presenceBased) {
@ -470,7 +470,7 @@ public class ConfigureForm extends Form {
/**
* Gets the publishing model for the node, which determines who may publish to it.
*
*
* @return The publishing model
*/
public PublishModel getPublishModel() {
@ -484,7 +484,7 @@ public class ConfigureForm extends Form {
/**
* Sets the publishing model for the node, which determines who may publish to it.
*
*
* @param publish The enum representing the possible options for the publishing model
*/
public void setPublishModel(PublishModel publish) {
@ -494,7 +494,7 @@ public class ConfigureForm extends Form {
/**
* List of the multi user chat rooms that are specified as reply rooms.
*
*
* @return The reply room JID's
*/
public List<String> getReplyRoom() {
@ -503,7 +503,7 @@ public class ConfigureForm extends Form {
/**
* Sets the multi user chat rooms that are specified as reply rooms.
*
*
* @param replyRooms The multi user chat room to use as reply rooms
*/
public void setReplyRoom(List<String> replyRooms) {
@ -513,7 +513,7 @@ public class ConfigureForm extends Form {
/**
* Gets the specific JID's for reply to.
*
*
* @return The JID's
*/
public List<String> getReplyTo() {
@ -522,7 +522,7 @@ public class ConfigureForm extends Form {
/**
* Sets the specific JID's for reply to.
*
*
* @param replyTos The JID's to reply to
*/
public void setReplyTo(List<String> replyTos) {
@ -532,7 +532,7 @@ public class ConfigureForm extends Form {
/**
* Gets the roster groups that are allowed to subscribe and retrieve items.
*
*
* @return The roster groups
*/
public List<String> getRosterGroupsAllowed() {
@ -541,7 +541,7 @@ public class ConfigureForm extends Form {
/**
* Sets the roster groups that are allowed to subscribe and retrieve items.
*
*
* @param groups The roster groups
*/
public void setRosterGroupsAllowed(List<String> groups) {
@ -551,7 +551,7 @@ public class ConfigureForm extends Form {
/**
* Determines if subscriptions are allowed.
*
*
* @return true if subscriptions are allowed, false otherwise
* @deprecated use {@link #isSubscribe()} instead
*/
@ -562,7 +562,7 @@ public class ConfigureForm extends Form {
/**
* Determines if subscriptions are allowed.
*
*
* @return true if subscriptions are allowed, false otherwise
*/
public boolean isSubscribe() {
@ -571,7 +571,7 @@ public class ConfigureForm extends Form {
/**
* Sets whether subscriptions are allowed.
*
*
* @param subscribe true if they are, false otherwise
*/
public void setSubscribe(boolean subscribe) {
@ -581,7 +581,7 @@ public class ConfigureForm extends Form {
/**
* Gets the human readable node title.
*
*
* @return The node title
*/
@Override
@ -591,7 +591,7 @@ public class ConfigureForm extends Form {
/**
* Sets a human readable title for the node.
*
*
* @param title The node title
*/
@Override
@ -602,7 +602,7 @@ public class ConfigureForm extends Form {
/**
* The type of node data, usually specified by the namespace of the payload (if any).
*
*
* @return The type of node data
*/
public String getDataType() {
@ -611,7 +611,7 @@ public class ConfigureForm extends Form {
/**
* Sets the type of node data, usually specified by the namespace of the payload (if any).
*
*
* @param type The type of node data
*/
public void setDataType(String type) {

View file

@ -24,39 +24,39 @@ import org.jivesoftware.smackx.xdata.Form;
* This enumeration represents all the fields of a node configuration form. This enumeration
* is not required when using the {@link ConfigureForm} to configure nodes, but may be helpful
* for generic UI's using only a {@link Form} for configuration.
*
*
* @author Robin Collier
*/
public enum ConfigureNodeFields {
/**
* Determines who may subscribe and retrieve items.
*
*
* <p><b>Value: {@link AccessModel}</b></p>
*/
access_model,
/**
* The URL of an XSL transformation which can be applied to
* The URL of an XSL transformation which can be applied to
* payloads in order to generate an appropriate message
* body element.
*
*
* <p><b>Value: {@link URL}</b></p>
*/
body_xslt,
/**
* The collection with which a node is affiliated.
*
*
* <p><b>Value: String</b></p>
*/
collection,
/**
* The URL of an XSL transformation which can be applied to
* payload format in order to generate a valid Data Forms result
* that the client could display using a generic Data Forms
* The URL of an XSL transformation which can be applied to
* payload format in order to generate a valid Data Forms result
* that the client could display using a generic Data Forms
* rendering engine body element.
*
*
* <p><b>Value: {@link URL}</b></p>
*/
dataform_xslt,
@ -77,72 +77,72 @@ public enum ConfigureNodeFields {
/**
* Who may associate leaf nodes with a collection.
*
*
* <p><b>Value: {@link ChildrenAssociationPolicy}</b></p>
*/
children_association_policy,
/**
* The list of JIDs that may associate leaf nodes with a
* The list of JIDs that may associate leaf nodes with a
* collection.
*
*
* <p><b>Value: List of JIDs as Strings</b></p>
*/
children_association_whitelist,
/**
* The child nodes (leaf or collection) associated with a collection.
*
*
* <p><b>Value: List of Strings</b></p>
*/
children,
/**
* The maximum number of child nodes that can be associated with a
* The maximum number of child nodes that can be associated with a
* collection.
*
*
* <p><b>Value: int</b></p>
*/
children_max,
/**
* The maximum number of items to persist.
*
*
* <p><b>Value: int</b></p>
*/
max_items,
/**
* The maximum payload size in bytes.
*
*
* <p><b>Value: int</b></p>
*/
max_payload_size,
/**
* Whether the node is a leaf (default) or collection.
*
*
* <p><b>Value: {@link NodeType}</b></p>
*/
node_type,
/**
* Whether to notify subscribers when the node configuration changes.
*
*
* <p><b>Value: boolean</b></p>
*/
notify_config,
/**
* Whether to notify subscribers when the node is deleted.
*
*
* <p><b>Value: boolean</b></p>
*/
notify_delete,
/**
* Whether to notify subscribers when items are removed from the node.
*
*
* <p><b>Value: boolean</b></p>
*/
notify_retract,
@ -155,67 +155,67 @@ public enum ConfigureNodeFields {
notification_type,
/**
* Whether to persist items to storage. This is required to have. multiple
* items in the node.
*
* Whether to persist items to storage. This is required to have. multiple
* items in the node.
*
* <p><b>Value: boolean</b></p>
*/
persist_items,
/**
* Whether to deliver notifications to available users only.
*
*
* <p><b>Value: boolean</b></p>
*/
presence_based_delivery,
/**
* Defines who can publish to the node.
*
*
* <p><b>Value: {@link PublishModel}</b></p>
*/
publish_model,
/**
* The specific multi-user chat rooms to specify for replyroom.
*
*
* <p><b>Value: List of JIDs as Strings</b></p>
*/
replyroom,
/**
* The specific JID(s) to specify for replyto.
*
*
* <p><b>Value: List of JIDs as Strings</b></p>
*/
replyto,
/**
* The roster group(s) allowed to subscribe and retrieve items.
*
*
* <p><b>Value: List of strings</b></p>
*/
roster_groups_allowed,
/**
* Whether to allow subscriptions.
*
*
* <p><b>Value: boolean</b></p>
*/
subscribe,
/**
* A friendly name for the node.
*
*
* <p><b>Value: String</b></p>
*/
title,
/**
* The type of node data, usually specified by the namespace
* of the payload(if any);MAY be a list-single rather than a
* of the payload(if any);MAY be a list-single rather than a
* text single.
*
*
* <p><b>Value: String</b></p>
*/
type;

View file

@ -24,23 +24,23 @@ import org.jivesoftware.smack.util.PacketParserUtils;
/**
* This interface defines {@link ExtensionElement} implementations that contain other
* extensions. This effectively extends the idea of an extension within one of the
* extensions. This effectively extends the idea of an extension within one of the
* top level {@link Stanza} types to consider any embedded element to be an extension
* of its parent. This more easily enables the usage of some of Smacks parsing
* utilities such as {@link PacketParserUtils#parseExtensionElement(String, String, org.xmlpull.v1.XmlPullParser)} to be used
* to parse any element of the XML being parsed.
*
*
* <p>Top level extensions have only one element, but they can have multiple children, or
* their children can have multiple children. This interface is a way of allowing extensions
* to be embedded within one another as a partial or complete one to one mapping of extension
* their children can have multiple children. This interface is a way of allowing extensions
* to be embedded within one another as a partial or complete one to one mapping of extension
* to element.
*
*
* @author Robin Collier
*/
public interface EmbeddedPacketExtension extends ExtensionElement {
/**
* Get the list of embedded {@link ExtensionElement} objects.
*
*
* @return List of embedded {@link ExtensionElement}
*/
List<ExtensionElement> getExtensions();

View file

@ -27,10 +27,10 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
/**
* Represents the top level element of a PubSub event extension. All types of PubSub events are
* represented by this class. The specific type can be found by {@link #getEventType()}. The
* represented by this class. The specific type can be found by {@link #getEventType()}. The
* embedded event information, which is specific to the event type, can be retrieved by the {@link #getEvent()}
* method.
*
*
* @author Robin Collier
*/
public class EventElement implements EmbeddedPacketExtension {

View file

@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub;
/**
* This enumeration defines the possible event types that are supported within PubSub
* event messages.
*
*
* @author Robin Collier
*/
public enum EventElementType {

View file

@ -21,9 +21,9 @@ import org.jivesoftware.smackx.xdata.Form;
/**
* Generic stanza extension which represents any PubSub form that is
* parsed from the incoming stream or being sent out to the server.
*
*
* Form types are defined in {@link FormNodeType}.
*
*
* @author Robin Collier
*/
public class FormNode extends NodeExtension {
@ -31,7 +31,7 @@ public class FormNode extends NodeExtension {
/**
* Create a {@link FormNode} which contains the specified form.
*
*
* @param formType The type of form being sent
* @param submitForm The form
*/
@ -44,9 +44,9 @@ public class FormNode extends NodeExtension {
}
/**
* Create a {@link FormNode} which contains the specified form, which is
* Create a {@link FormNode} which contains the specified form, which is
* associated with the specified node.
*
*
* @param formType The type of form being sent
* @param nodeId The node the form is associated with
* @param submitForm The form
@ -61,7 +61,7 @@ public class FormNode extends NodeExtension {
/**
* Get the Form that is to be sent, or was retrieved from the server.
*
*
* @return The form
*/
public Form getForm() {

View file

@ -22,7 +22,7 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
/**
* The types of forms supported by the PubSub specification.
*
*
* @author Robin Collier
*/
public enum FormNodeType {

View file

@ -20,7 +20,7 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
/**
* Represents a request to subscribe to a node.
*
*
* @author Robin Collier
*/
public class GetItemsRequest extends NodeExtension {

View file

@ -25,29 +25,29 @@ import org.jivesoftware.smackx.pubsub.provider.ItemProvider;
* This class represents an item that has been, or will be published to a
* PubSub node. An <tt>Item</tt> has several properties that are dependent
* on the configuration of the node to which it has been or will be published.
*
*
* <h3>An Item received from a node (via {@link LeafNode#getItems()} or {@link LeafNode#addItemEventListener(org.jivesoftware.smackx.pubsub.listener.ItemEventListener)}</h3>
* <ul>
* <li>Will always have an id (either user or server generated) unless node configuration has both
* {@link ConfigureForm#isPersistItems()} and {@link ConfigureForm#isDeliverPayloads()}set to false.
* <li>Will have a payload if the node configuration has {@link ConfigureForm#isDeliverPayloads()} set
* <li>Will have a payload if the node configuration has {@link ConfigureForm#isDeliverPayloads()} set
* to true, otherwise it will be null.
* </ul>
*
*
* <h3>An Item created to send to a node (via {@link LeafNode#publish()} or {@link LeafNode#publish()}</h3>
* <ul>
* <li>The id is optional, since the server will generate one if necessary, but should be used if it is
* <li>The id is optional, since the server will generate one if necessary, but should be used if it is
* meaningful in the context of the node. This value must be unique within the node that it is sent to, since
* resending an item with the same id will overwrite the one that already exists if the items are persisted.
* <li>Will require payload if the node configuration has {@link ConfigureForm#isDeliverPayloads()} set
* to true.
* </ul>
*
*
* <p>
* To customise the payload object being returned from the {@link PayloadItem#getPayload()} method, you can
* add a custom parser as explained in {@link ItemProvider}.
* </p>
*
*
* @author Robin Collier
*/
public class Item extends NodeExtension {

View file

@ -21,7 +21,7 @@ import java.util.List;
/**
* Represents an event in which items have been deleted from the node.
*
*
* @author Robin Collier
*/
public class ItemDeleteEvent extends SubscriptionEvent {
@ -30,9 +30,9 @@ public class ItemDeleteEvent extends SubscriptionEvent {
/**
* Constructs an <tt>ItemDeleteEvent</tt> that indicates the the supplied
* items (by id) have been deleted, and that the event matches the listed
* subscriptions. The subscriptions would have been created by calling
* subscriptions. The subscriptions would have been created by calling
* {@link LeafNode#subscribe(String)}.
*
*
* @param nodeId The id of the node the event came from
* @param deletedItemIds The item ids of the items that were deleted.
* @param subscriptionIds The subscriptions that match the event.
@ -47,7 +47,7 @@ public class ItemDeleteEvent extends SubscriptionEvent {
/**
* Get the item id's of the items that have been deleted.
*
*
* @return List of item id's
*/
public List<String> getItemIds() {

View file

@ -22,7 +22,7 @@ import java.util.List;
/**
* Represents an event generated by an item(s) being published to a node.
*
*
* @author Robin Collier
*/
public class ItemPublishEvent<T extends Item> extends SubscriptionEvent {
@ -32,9 +32,9 @@ public class ItemPublishEvent<T extends Item> extends SubscriptionEvent {
/**
* Constructs an <tt>ItemPublishEvent</tt> with the provided list
* of {@link Item} that were published.
*
*
* @param nodeId The id of the node the event came from
* @param eventItems The list of {@link Item} that were published
* @param eventItems The list of {@link Item} that were published
*/
public ItemPublishEvent(String nodeId, List<T> eventItems) {
super(nodeId);
@ -44,11 +44,11 @@ public class ItemPublishEvent<T extends Item> extends SubscriptionEvent {
/**
* Constructs an <tt>ItemPublishEvent</tt> with the provided list
* of {@link Item} that were published. The list of subscription ids
* represents the subscriptions that matched the event, in the case
* represents the subscriptions that matched the event, in the case
* of the user having multiple subscriptions.
*
*
* @param nodeId The id of the node the event came from
* @param eventItems The list of {@link Item} that were published
* @param eventItems The list of {@link Item} that were published
* @param subscriptionIds The list of subscriptionIds
*/
public ItemPublishEvent(String nodeId, List<T> eventItems, List<String> subscriptionIds) {
@ -60,11 +60,11 @@ public class ItemPublishEvent<T extends Item> extends SubscriptionEvent {
* Constructs an <tt>ItemPublishEvent</tt> with the provided list
* of {@link Item} that were published in the past. The published
* date signifies that this is delayed event. The list of subscription ids
* represents the subscriptions that matched the event, in the case
* of the user having multiple subscriptions.
* represents the subscriptions that matched the event, in the case
* of the user having multiple subscriptions.
*
* @param nodeId The id of the node the event came from
* @param eventItems The list of {@link Item} that were published
* @param eventItems The list of {@link Item} that were published
* @param subscriptionIds The list of subscriptionIds
* @param publishedDate date of publication.
*/
@ -78,7 +78,7 @@ public class ItemPublishEvent<T extends Item> extends SubscriptionEvent {
/**
* Get the list of {@link Item} that were published.
*
*
* @return The list of published {@link Item}
*/
public List<T> getItems() {
@ -87,12 +87,12 @@ public class ItemPublishEvent<T extends Item> extends SubscriptionEvent {
/**
* Indicates whether this event was delayed. That is, the items
* were published to the node at some time in the past. This will
* were published to the node at some time in the past. This will
* typically happen if there is an item already published to the node
* before a user subscribes to it. In this case, when the user
* before a user subscribes to it. In this case, when the user
* subscribes, the server may send the last item published to the node
* with a delay date showing its time of original publication.
*
*
* @return true if the items are delayed, false otherwise.
*/
public boolean isDelayed() {
@ -100,7 +100,7 @@ public class ItemPublishEvent<T extends Item> extends SubscriptionEvent {
}
/**
* Gets the original date the items were published. This is only
* Gets the original date the items were published. This is only
* valid if {@link #isDelayed()} is true.
*
* @return date of publication.
@ -111,7 +111,7 @@ public class ItemPublishEvent<T extends Item> extends SubscriptionEvent {
@Override
public String toString() {
return getClass().getName() + " [subscriptions: " + getSubscriptions() + "], [Delayed: " +
return getClass().getName() + " [subscriptions: " + getSubscriptions() + "], [Delayed: " +
(isDelayed() ? originalDate.toString() : "false") + ']';
}

View file

@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub;
/**
* These are the options for the node configuration setting {@link ConfigureForm#setItemReply(ItemReply)},
* which defines who should receive replies to items.
*
*
* @author Robin Collier
*/
public enum ItemReply {

View file

@ -29,10 +29,10 @@ import org.jivesoftware.smack.packet.NamedElement;
* <li>It can represent a request to delete a list of items.
* <li>It can represent a request to get existing items.
* </ul>
*
* <p><b>Please note, this class is used for internal purposes, and is not required for usage of
*
* <p><b>Please note, this class is used for internal purposes, and is not required for usage of
* pubsub functionality.</b></p>
*
*
* @author Robin Collier
*/
public class ItemsExtension extends NodeExtension implements EmbeddedPacketExtension {
@ -66,19 +66,19 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
/**
* Construct an instance with a list representing items that have been published or deleted.
*
*
* <p>Valid scenarios are:</p>
* <ul>
* <li>Request items from node - itemsType = {@link ItemsElementType#items}, items = list of {@link Item} and an
* optional value for the <b>max_items</b> attribute.
* <li>Request to delete items - itemsType = {@link ItemsElementType#retract}, items = list of {@link Item} containing
* only id's and an optional value for the <b>notify</b> attribute.
* <li>Items published event - itemsType = {@link ItemsElementType#items}, items = list of {@link Item} and
* <li>Items published event - itemsType = {@link ItemsElementType#items}, items = list of {@link Item} and
* attributeValue = <code>null</code>
* <li>Items deleted event - itemsType = {@link ItemsElementType#items}, items = list of {@link RetractItem} and
* attributeValue = <code>null</code>
* <li>Items deleted event - itemsType = {@link ItemsElementType#items}, items = list of {@link RetractItem} and
* attributeValue = <code>null</code>
* </ul>
*
*
* @param itemsType Type of representation
* @param nodeId The node to which the items are being sent or deleted
* @param items The list of {@link Item} or {@link RetractItem}
@ -91,19 +91,19 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
/**
* Construct an instance with a list representing items that have been published or deleted.
*
*
* <p>Valid scenarios are:</p>
* <ul>
* <li>Request items from node - itemsType = {@link ItemsElementType#items}, items = list of {@link Item} and an
* optional value for the <b>max_items</b> attribute.
* <li>Request to delete items - itemsType = {@link ItemsElementType#retract}, items = list of {@link Item} containing
* only id's and an optional value for the <b>notify</b> attribute.
* <li>Items published event - itemsType = {@link ItemsElementType#items}, items = list of {@link Item} and
* <li>Items published event - itemsType = {@link ItemsElementType#items}, items = list of {@link Item} and
* attributeValue = <code>null</code>
* <li>Items deleted event - itemsType = {@link ItemsElementType#items}, items = list of {@link RetractItem} and
* <li>Items deleted event - itemsType = {@link ItemsElementType#items}, items = list of {@link RetractItem} and
* attributeValue = <code>null</code>
* </ul>
*
*
* @param nodeId The node to which the items are being sent or deleted
* @param items The list of {@link Item} or {@link RetractItem}
* @param notify
@ -111,13 +111,13 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
public ItemsExtension(String nodeId, List<? extends ExtensionElement> items, boolean notify) {
super(ItemsElementType.retract.getNodeElement(), nodeId);
type = ItemsElementType.retract;
this.items = items;
this.items = items;
this.notify = notify;
}
/**
* Get the type of element.
*
*
* @return The element type
*/
public ItemsElementType getItemsElementType() {
@ -132,7 +132,7 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
/**
* Gets the items related to the type of request or event.
*
*
* @return List of {@link Item}, {@link RetractItem}, or null
*/
public List<? extends NamedElement> getItems() {
@ -141,7 +141,7 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
/**
* Gets the value of the optional attribute related to the {@link ItemsElementType}.
*
*
* @return The attribute value
*/
public boolean getNotify() {

View file

@ -34,7 +34,7 @@ import org.jivesoftware.smackx.pubsub.packet.PubSub;
* almost all PubSub capabilities are related to the concept of a node.
* All items are published to a node, and typically subscribed to by other
* users. These users then retrieve events based on this subscription.
*
*
* @author Robin Collier
*/
public class LeafNode extends Node {
@ -45,12 +45,12 @@ public class LeafNode extends Node {
/**
* Get information on the items in the node in standard
* {@link DiscoverItems} format.
*
*
* @return The item details in {@link DiscoverItems} format
* @throws XMPPErrorException
* @throws XMPPErrorException
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public DiscoverItems discoverItems() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
DiscoverItems items = new DiscoverItems();
@ -66,8 +66,8 @@ public class LeafNode extends Node {
* @return List of {@link Item} in the node
* @throws XMPPErrorException
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public <T extends Item> List<T> getItems() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return getItems((List<ExtensionElement>) null, null);
@ -75,18 +75,18 @@ public class LeafNode extends Node {
/**
* Get the current items stored in the node based
* on the subscription associated with the provided
* on the subscription associated with the provided
* subscription id.
*
* @param subscriptionId - The subscription id for the
*
* @param subscriptionId - The subscription id for the
* associated subscription.
* @param <T> type of the items.
*
* @return List of {@link Item} in the node
* @throws XMPPErrorException
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public <T extends Item> List<T> getItems(String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId(), subscriptionId));
@ -95,19 +95,19 @@ public class LeafNode extends Node {
/**
* Get the items specified from the node. This would typically be
* used when the server does not return the payload due to size
* constraints. The user would be required to retrieve the payload
* used when the server does not return the payload due to size
* constraints. The user would be required to retrieve the payload
* after the items have been retrieved via {@link #getItems()} or an
* event, that did not include the payload.
*
*
* @param ids Item ids of the items to retrieve
* @param <T> type of the items.
*
* @return The list of {@link Item} with payload
* @throws XMPPErrorException
* @throws XMPPErrorException
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public <T extends Item> List<T> getItems(Collection<String> ids) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
List<Item> itemList = new ArrayList<>(ids.size());
@ -121,15 +121,15 @@ public class LeafNode extends Node {
/**
* Get items persisted on the node, limited to the specified number.
*
*
* @param maxItems Maximum number of items to return
* @param <T> type of the items.
*
* @return List of {@link Item}
* @throws XMPPErrorException
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public <T extends Item> List<T> getItems(int maxItems) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId(), maxItems));
@ -139,18 +139,18 @@ public class LeafNode extends Node {
/**
* Get items persisted on the node, limited to the specified number
* based on the subscription associated with the provided subscriptionId.
*
*
* @param maxItems Maximum number of items to return
* @param subscriptionId The subscription which the retrieval is based
* on.
*
*
* @return List of {@link Item}
* @param <T> type of the items.
*
* @throws XMPPErrorException
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public <T extends Item> List<T> getItems(int maxItems, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId(), subscriptionId, maxItems));
@ -163,7 +163,7 @@ public class LeafNode extends Node {
* {@code additionalExtensions} can be used e.g. to add a "Result Set Management" extension.
* {@code returnedExtensions} will be filled with the stanza extensions found in the answer.
* </p>
*
*
* @param additionalExtensions additional {@code PacketExtensions} to be added to the request.
* This is an optional argument, if provided as null no extensions will be added.
* @param returnedExtensions a collection that will be filled with the returned packet
@ -174,7 +174,7 @@ public class LeafNode extends Node {
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
* @throws InterruptedException
*/
public <T extends Item> List<T> getItems(List<ExtensionElement> additionalExtensions,
List<ExtensionElement> returnedExtensions) throws NoResponseException,
@ -204,12 +204,12 @@ public class LeafNode extends Node {
/**
* Publishes an event to the node. This is an empty event
* with no item.
*
*
* This is only acceptable for nodes with {@link ConfigureForm#isPersistItems()}=false
* and {@link ConfigureForm#isDeliverPayloads()}=false.
*
* @throws NotConnectedException
* @throws InterruptedException
*
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @deprecated use {@link #publish()} instead.
@ -222,16 +222,16 @@ public class LeafNode extends Node {
/**
* Publishes an event to the node. This is a simple item
* with no payload.
*
*
* If the id is null, an empty item (one without an id) will be sent.
* Please note that this is not the same as {@link #send()}, which
* publishes an event with NO item.
*
*
* @param item - The item being sent
* @param <T> type of the items.
*
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @deprecated use {@link #publish(Item)} instead.
@ -244,15 +244,15 @@ public class LeafNode extends Node {
/**
* Publishes multiple events to the node. Same rules apply as in {@link #publish(Item)}.
*
*
* In addition, if {@link ConfigureForm#isPersistItems()}=false, only the last item in the input
* list will get stored on the node, assuming it stores the last sent item.
*
*
* @param items - The collection of items being sent
* @param <T> type of the items.
*
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @deprecated use {@link #publish(Collection)} instead.
@ -265,15 +265,15 @@ public class LeafNode extends Node {
/**
* Publishes an event to the node. This is an empty event
* with no item.
*
*
* This is only acceptable for nodes with {@link ConfigureForm#isPersistItems()}=false
* and {@link ConfigureForm#isDeliverPayloads()}=false.
*
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
*
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
*/
public void publish() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub packet = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PUBLISH, getId()));
@ -285,22 +285,22 @@ public class LeafNode extends Node {
* Publishes an event to the node. This can be either a simple item
* with no payload, or one with it. This is determined by the Node
* configuration.
*
*
* If the node has <b>deliver_payload=false</b>, the Item must not
* have a payload.
*
*
* If the id is null, an empty item (one without an id) will be sent.
* Please note that this is not the same as {@link #send()}, which
* publishes an event with NO item.
*
*
* @param item - The item being sent
* @param <T> type of the items.
*
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
*/
@SuppressWarnings("unchecked")
public <T extends Item> void publish(T item) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
@ -311,18 +311,18 @@ public class LeafNode extends Node {
/**
* Publishes multiple events to the node. Same rules apply as in {@link #send(Item)}.
*
*
* In addition, if {@link ConfigureForm#isPersistItems()}=false, only the last item in the input
* list will get stored on the node, assuming it stores the last sent item.
*
*
* @param items - The collection of {@link Item} objects being sent
* @param <T> type of the items.
*
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
*/
public <T extends Item> void publish(Collection<T> items) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub packet = createPubsubPacket(Type.set, new PublishItem<>(getId(), items));
@ -332,13 +332,13 @@ public class LeafNode extends Node {
/**
* Purges the node of all items.
*
*
* <p>Note: Some implementations may keep the last item
* sent.
* @throws XMPPErrorException
* @throws XMPPErrorException
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void deleteAllItems() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub request = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PURGE_OWNER, getId()));
@ -348,12 +348,12 @@ public class LeafNode extends Node {
/**
* Delete the item with the specified id from the node.
*
*
* @param itemId The id of the item
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void deleteItem(String itemId) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
Collection<String> items = new ArrayList<>(1);
@ -363,12 +363,12 @@ public class LeafNode extends Node {
/**
* Delete the items with the specified id's from the node.
*
*
* @param itemIds The list of id's of items to delete
* @throws XMPPErrorException
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void deleteItem(Collection<String> itemIds) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
List<Item> items = new ArrayList<>(itemIds.size());

View file

@ -55,9 +55,9 @@ public abstract class Node {
protected ConcurrentHashMap<NodeConfigListener, StanzaListener> configEventToListenerMap = new ConcurrentHashMap<>();
/**
* Construct a node associated to the supplied connection with the specified
* Construct a node associated to the supplied connection with the specified
* node id.
*
*
* @param pubSubManager The PubSubManager for the connection the node is associated with
* @param nodeId The node id
*/
@ -68,7 +68,7 @@ public abstract class Node {
/**
* Get the NodeId.
*
*
* @return the node id
*/
public String getId() {
@ -77,12 +77,12 @@ public abstract class Node {
/**
* Returns a configuration form, from which you can create an answer form to be submitted
* via the {@link #sendConfigurationForm(Form)}.
*
*
* @return the configuration form
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public ConfigureForm getNodeConfiguration() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub pubSub = createPubsubPacket(Type.get, new NodeExtension(
@ -93,12 +93,12 @@ public abstract class Node {
/**
* Update the configuration with the contents of the new {@link Form}.
*
*
* @param submitForm
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void sendConfigurationForm(Form submitForm) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub packet = createPubsubPacket(Type.set, new FormNode(FormNodeType.CONFIGURE_OWNER,
@ -108,12 +108,12 @@ public abstract class Node {
/**
* Discover node information in standard {@link DiscoverInfo} format.
*
*
* @return The discovery information about the node.
* @throws XMPPErrorException
* @throws XMPPErrorException
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public DiscoverInfo discoverInfo() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
DiscoverInfo info = new DiscoverInfo();
@ -124,13 +124,13 @@ public abstract class Node {
/**
* Get the subscriptions currently associated with this node.
*
*
* @return List of {@link Subscription}
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
*/
public List<Subscription> getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return getSubscriptions(null, null);
@ -150,7 +150,7 @@ public abstract class Node {
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
* @throws InterruptedException
*/
public List<Subscription> getSubscriptions(List<ExtensionElement> additionalExtensions, Collection<ExtensionElement> returnedExtensions)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
@ -164,7 +164,7 @@ public abstract class Node {
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws InterruptedException
* @see #getSubscriptionsAsOwner(List, Collection)
* @since 4.1
*/
@ -191,7 +191,7 @@ public abstract class Node {
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
* @throws InterruptedException
* @see <a href="http://www.xmpp.org/extensions/xep-0060.html#owner-subscriptions-retrieve">XEP-60 § 8.8.1 -
* Retrieve Subscriptions List</a>
* @since 4.1
@ -252,7 +252,7 @@ public abstract class Node {
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
* @throws InterruptedException
*/
public List<Affiliation> getAffiliations() throws NoResponseException, XMPPErrorException,
NotConnectedException, InterruptedException {
@ -273,7 +273,7 @@ public abstract class Node {
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
* @throws InterruptedException
*/
public List<Affiliation> getAffiliations(List<ExtensionElement> additionalExtensions, Collection<ExtensionElement> returnedExtensions)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
@ -346,7 +346,7 @@ public abstract class Node {
* <p>
* Note that this is an <b>optional</b> PubSub feature ('pubsub#modify-affiliations').
* </p>
*
*
* @param affiliations
* @return <code>null</code> or a PubSub stanza with additional information on success.
* @throws NoResponseException
@ -371,20 +371,20 @@ public abstract class Node {
/**
* The user subscribes to the node using the supplied jid. The
* bare jid portion of this one must match the jid for the connection.
*
* Please note that the {@link Subscription.State} should be checked
*
* Please note that the {@link Subscription.State} should be checked
* on return since more actions may be required by the caller.
* {@link Subscription.State#pending} - The owner must approve the subscription
* {@link Subscription.State#pending} - The owner must approve the subscription
* request before messages will be received.
* {@link Subscription.State#unconfigured} - If the {@link Subscription#isConfigRequired()} is true,
* {@link Subscription.State#unconfigured} - If the {@link Subscription#isConfigRequired()} is true,
* the caller must configure the subscription before messages will be received. If it is false
* the caller can configure it but is not required to do so.
* @param jid The jid to subscribe as.
* @return The subscription
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public Subscription subscribe(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub pubSub = createPubsubPacket(Type.set, new SubscribeExtension(jid, getId()));
@ -394,14 +394,14 @@ public abstract class Node {
/**
* The user subscribes to the node using the supplied jid and subscription
* options. The bare jid portion of this one must match the jid for the
* options. The bare jid portion of this one must match the jid for the
* connection.
*
* Please note that the {@link Subscription.State} should be checked
*
* Please note that the {@link Subscription.State} should be checked
* on return since more actions may be required by the caller.
* {@link Subscription.State#pending} - The owner must approve the subscription
* {@link Subscription.State#pending} - The owner must approve the subscription
* request before messages will be received.
* {@link Subscription.State#unconfigured} - If the {@link Subscription#isConfigRequired()} is true,
* {@link Subscription.State#unconfigured} - If the {@link Subscription#isConfigRequired()} is true,
* the caller must configure the subscription before messages will be received. If it is false
* the caller can configure it but is not required to do so.
*
@ -409,10 +409,10 @@ public abstract class Node {
* @param subForm
*
* @return The subscription
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public Subscription subscribe(String jid, SubscribeForm subForm) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub request = createPubsubPacket(Type.set, new SubscribeExtension(jid, getId()));
@ -422,16 +422,16 @@ public abstract class Node {
}
/**
* Remove the subscription related to the specified JID. This will only
* Remove the subscription related to the specified JID. This will only
* work if there is only 1 subscription. If there are multiple subscriptions,
* use {@link #unsubscribe(String, String)}.
*
*
* @param jid The JID used to subscribe to the node
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
*/
public void unsubscribe(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
unsubscribe(jid, null);
@ -439,13 +439,13 @@ public abstract class Node {
/**
* Remove the specific subscription related to the specified JID.
*
*
* @param jid The JID used to subscribe to the node
* @param subscriptionId The id of the subscription being removed
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void unsubscribe(String jid, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
sendPubsubPacket(createPubsubPacket(Type.set, new UnsubscribeExtension(jid, getId(), subscriptionId)));
@ -458,10 +458,10 @@ public abstract class Node {
* @param jid
*
* @return A subscription options form
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public SubscribeForm getSubscriptionOptions(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return getSubscriptionOptions(jid, null);
@ -470,16 +470,16 @@ public abstract class Node {
/**
* Get the options for configuring the specified subscription.
*
*
* @param jid JID the subscription is registered under
* @param subscriptionId The subscription id
*
*
* @return The subscription option form
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
*/
public SubscribeForm getSubscriptionOptions(String jid, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub packet = sendPubsubPacket(createPubsubPacket(Type.get, new OptionsExtension(jid, getId(), subscriptionId)));
@ -488,22 +488,22 @@ public abstract class Node {
}
/**
* Register a listener for item publication events. This
* listener will get called whenever an item is published to
* Register a listener for item publication events. This
* listener will get called whenever an item is published to
* this node.
*
*
* @param listener The handler for the event
*/
@SuppressWarnings("unchecked")
public void addItemEventListener(@SuppressWarnings("rawtypes") ItemEventListener listener) {
StanzaListener conListener = new ItemEventTranslator(listener);
StanzaListener conListener = new ItemEventTranslator(listener);
itemEventToListenerMap.put(listener, conListener);
pubSubManager.getConnection().addSyncStanzaListener(conListener, new EventContentFilter(EventElementType.items.toString(), "item"));
}
/**
* Unregister a listener for publication events.
*
*
* @param listener The handler to unregister
*/
public void removeItemEventListener(@SuppressWarnings("rawtypes") ItemEventListener listener) {
@ -516,18 +516,18 @@ public abstract class Node {
/**
* Register a listener for configuration events. This listener
* will get called whenever the node's configuration changes.
*
*
* @param listener The handler for the event
*/
public void addConfigurationListener(NodeConfigListener listener) {
StanzaListener conListener = new NodeConfigTranslator(listener);
StanzaListener conListener = new NodeConfigTranslator(listener);
configEventToListenerMap.put(listener, conListener);
pubSubManager.getConnection().addSyncStanzaListener(conListener, new EventContentFilter(EventElementType.configuration.toString()));
}
/**
* Unregister a listener for configuration events.
*
*
* @param listener The handler to unregister
*/
public void removeConfigurationListener(NodeConfigListener listener) {
@ -540,11 +540,11 @@ public abstract class Node {
/**
* Register an listener for item delete events. This listener
* gets called whenever an item is deleted from the node.
*
*
* @param listener The handler for the event
*/
public void addItemDeleteListener(ItemDeleteListener listener) {
StanzaListener delListener = new ItemDeleteTranslator(listener);
StanzaListener delListener = new ItemDeleteTranslator(listener);
itemDeleteToListenerMap.put(listener, delListener);
EventContentFilter deleteItem = new EventContentFilter(EventElementType.items.toString(), "retract");
EventContentFilter purge = new EventContentFilter(EventElementType.purge.toString());
@ -555,7 +555,7 @@ public abstract class Node {
/**
* Unregister a listener for item delete events.
*
*
* @param listener The handler to unregister
*/
public void removeItemDeleteListener(ItemDeleteListener listener) {
@ -594,9 +594,9 @@ public abstract class Node {
}
/**
* This class translates low level item publication events into api level objects for
* This class translates low level item publication events into api level objects for
* user consumption.
*
*
* @author Robin Collier
*/
public static class ItemEventTranslator implements StanzaListener {
@ -619,9 +619,9 @@ public abstract class Node {
}
/**
* This class translates low level item deletion events into api level objects for
* This class translates low level item deletion events into api level objects for
* user consumption.
*
*
* @author Robin Collier
*/
public static class ItemDeleteTranslator implements StanzaListener {
@ -659,9 +659,9 @@ public abstract class Node {
}
/**
* This class translates low level node configuration events into api level objects for
* This class translates low level node configuration events into api level objects for
* user consumption.
*
*
* @author Robin Collier
*/
public static class NodeConfigTranslator implements StanzaListener {
@ -682,9 +682,9 @@ public abstract class Node {
}
/**
* Filter for {@link StanzaListener} to filter out events not specific to the
* Filter for {@link StanzaListener} to filter out events not specific to the
* event type expected for this node.
*
*
* @author Robin Collier
*/
class EventContentFilter extends FlexibleStanzaTypeFilter<Message> {

View file

@ -22,10 +22,10 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
/**
* A class which represents a common element within the pubsub defined
* schemas. One which has a <b>node</b> as an attribute. This class is
* used on its own as well as a base class for many others, since the
* schemas. One which has a <b>node</b> as an attribute. This class is
* used on its own as well as a base class for many others, since the
* node is a central concept to most pubsub functionality.
*
*
* @author Robin Collier
*/
public class NodeExtension implements ExtensionElement {
@ -35,7 +35,7 @@ public class NodeExtension implements ExtensionElement {
/**
* Constructs a <tt>NodeExtension</tt> with an element name specified
* by {@link PubSubElementType} and the specified node id.
*
*
* @param elem Defines the element name and namespace
* @param nodeId Specifies the id of the node
*/
@ -47,7 +47,7 @@ public class NodeExtension implements ExtensionElement {
/**
* Constructs a <tt>NodeExtension</tt> with an element name specified
* by {@link PubSubElementType}.
*
*
* @param elem Defines the element name and namespace
*/
public NodeExtension(PubSubElementType elem) {
@ -56,7 +56,7 @@ public class NodeExtension implements ExtensionElement {
/**
* Gets the node id.
*
*
* @return The node id
*/
public String getNode() {

View file

@ -18,7 +18,7 @@ package org.jivesoftware.smackx.pubsub;
/**
* Defines the available types of nodes.
*
*
* @author Robin Collier
*/
public enum NodeType {

View file

@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub;
/**
* Specify the delivery style for event notifications. Denotes possible values
* for {@link ConfigureForm#setNotificationType(NotificationType)}.
*
*
* @author Timothy Pitt
*/
public enum NotificationType {

View file

@ -19,8 +19,8 @@ package org.jivesoftware.smackx.pubsub;
import org.jivesoftware.smack.util.XmlStringBuilder;
/**
* A stanza extension representing the <b>options</b> element.
*
* A stanza extension representing the <b>options</b> element.
*
* @author Robin Collier
*/
public class OptionsExtension extends NodeExtension {

View file

@ -26,35 +26,35 @@ import org.jivesoftware.smackx.pubsub.provider.ItemProvider;
* This class represents an item that has been, or will be published to a
* pubsub node. An <tt>Item</tt> has several properties that are dependent
* on the configuration of the node to which it has been or will be published.
*
*
* <h3>An Item received from a node (via {@link LeafNode#getItems()} or {@link LeafNode#addItemEventListener(org.jivesoftware.smackx.pubsub.listener.ItemEventListener)}</h3>
* <ul>
* <li>Will always have an id (either user or server generated) unless node configuration has both
* {@link ConfigureForm#isPersistItems()} and {@link ConfigureForm#isDeliverPayloads()}set to false.</li>
* <li>Will have a payload if the node configuration has {@link ConfigureForm#isDeliverPayloads()} set
* <li>Will have a payload if the node configuration has {@link ConfigureForm#isDeliverPayloads()} set
* to true, otherwise it will be null.</li>
* </ul>
*
*
* <h3>An Item created to send to a node (via {@link LeafNode#publish()}</h3>
* <ul>
* <li>The id is optional, since the server will generate one if necessary, but should be used if it is
* <li>The id is optional, since the server will generate one if necessary, but should be used if it is
* meaningful in the context of the node. This value must be unique within the node that it is sent to, since
* resending an item with the same id will overwrite the one that already exists if the items are persisted.</li>
* <li>Will require payload if the node configuration has {@link ConfigureForm#isDeliverPayloads()} set
* to true.</li>
* </ul>
*
*
* <p>To customise the payload object being returned from the {@link #getPayload()} method, you can
* add a custom parser as explained in {@link ItemProvider}.</p>
*
*
* @author Robin Collier
*/
public class PayloadItem<E extends ExtensionElement> extends Item {
private final E payload;
/**
* Create an <tt>Item</tt> with no id and a payload The id will be set by the server.
*
* Create an <tt>Item</tt> with no id and a payload The id will be set by the server.
*
* @param payloadExt A {@link ExtensionElement} which represents the payload data.
*/
public PayloadItem(E payloadExt) {
@ -66,8 +66,8 @@ public class PayloadItem<E extends ExtensionElement> extends Item {
}
/**
* Create an <tt>Item</tt> with an id and payload.
*
* Create an <tt>Item</tt> with an id and payload.
*
* @param itemId The id of this item. It can be null if we want the server to set the id.
* @param payloadExt A {@link ExtensionElement} which represents the payload data.
*/
@ -80,15 +80,15 @@ public class PayloadItem<E extends ExtensionElement> extends Item {
}
/**
* Create an <tt>Item</tt> with an id, node id and payload.
*
* Create an <tt>Item</tt> with an id, node id and payload.
*
* <p>
* <b>Note:</b> This is not valid for publishing an item to a node, only receiving from
* one as part of {@link Message}. If used to create an Item to publish
* <b>Note:</b> This is not valid for publishing an item to a node, only receiving from
* one as part of {@link Message}. If used to create an Item to publish
* (via {@link LeafNode#publish(Item)}, the server <i>may</i> return an
* error for an invalid packet.
* </p>
*
*
* @param itemId The id of this item.
* @param nodeId The id of the node the item was published to.
* @param payloadExt A {@link ExtensionElement} which represents the payload data.
@ -122,7 +122,7 @@ public class PayloadItem<E extends ExtensionElement> extends Item {
/**
* Get the payload associated with this <tt>Item</tt>. Customising the payload
* parsing from the server can be accomplished as described in {@link ItemProvider}.
*
*
* @return The payload as a {@link ExtensionElement}.
*/
public E getPayload() {

View file

@ -16,10 +16,10 @@
*/
package org.jivesoftware.smackx.pubsub;
/**
/**
* Defines the possible valid presence states for node subscription via
* {@link SubscribeForm#getShowValues()}.
*
*
* @author Robin Collier
*/
public enum PresenceState {

View file

@ -23,7 +23,7 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
/**
* Defines all the possible element types as defined for all the pubsub
* schemas in all 3 namespaces.
*
*
* @author Robin Collier
*/
public enum PubSubElementType {

View file

@ -25,7 +25,7 @@ import org.jxmpp.jid.BareJid;
public abstract class PubSubException extends SmackException {
/**
*
*
*/
private static final long serialVersionUID = 1L;
@ -42,7 +42,7 @@ public abstract class PubSubException extends SmackException {
public static class NotALeafNodeException extends PubSubException {
/**
*
*
*/
private static final long serialVersionUID = 1L;
@ -62,7 +62,7 @@ public abstract class PubSubException extends SmackException {
public static class NotAPubSubNodeException extends PubSubException {
/**
*
*
*/
private static final long serialVersionUID = 1L;

View file

@ -58,10 +58,10 @@ import org.jxmpp.stringprep.XmppStringprepException;
/**
* This is the starting point for access to the pubsub service. It
* will provide access to general information about the service, as
* well as create or retrieve pubsub {@link LeafNode} instances. These
* instances provide the bulk of the functionality as defined in the
* well as create or retrieve pubsub {@link LeafNode} instances. These
* instances provide the bulk of the functionality as defined in the
* pubsub specification <a href="http://xmpp.org/extensions/xep-0060.html">XEP-0060</a>.
*
*
* @author Robin Collier
*/
public final class PubSubManager extends Manager {
@ -84,7 +84,7 @@ public final class PubSubManager extends Manager {
/**
* Get a PubSub manager for the default PubSub service of the connection.
*
*
* @param connection
* @return the default PubSub manager.
*/
@ -115,7 +115,7 @@ public final class PubSubManager extends Manager {
/**
* Get the PubSub manager for the given connection and PubSub service.
*
*
* @param connection the XMPP connection.
* @param pubSubService the PubSub service.
* @return a PubSub manager for the connection and service.
@ -137,7 +137,7 @@ public final class PubSubManager extends Manager {
/**
* Create a pubsub manager associated to the specified connection where
* the pubsub requests require a specific to address for packets.
*
*
* @param connection The XMPP connection
* @param toAddress The pubsub specific to address (required for some servers)
*/
@ -148,12 +148,12 @@ public final class PubSubManager extends Manager {
/**
* Creates an instant node, if supported.
*
*
* @return The node that was created
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public LeafNode createNode() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub reply = sendPubsubPacket(Type.set, new NodeExtension(PubSubElementType.CREATE), null);
@ -167,14 +167,14 @@ public final class PubSubManager extends Manager {
/**
* Creates a node with default configuration.
*
* @param nodeId The id of the node, which must be unique within the
*
* @param nodeId The id of the node, which must be unique within the
* pubsub service
* @return The node that was created
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public LeafNode createNode(String nodeId) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return (LeafNode) createNode(nodeId, null);
@ -182,17 +182,17 @@ public final class PubSubManager extends Manager {
/**
* Creates a node with specified configuration.
*
*
* Note: This is the only way to create a collection node.
*
* @param nodeId The name of the node, which must be unique within the
*
* @param nodeId The name of the node, which must be unique within the
* pubsub service
* @param config The configuration for the node
* @return The node that was created
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public Node createNode(String nodeId, Form config) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub request = PubSub.createPubsubPacket(pubSubService, Type.set, new NodeExtension(PubSubElementType.CREATE, nodeId));
@ -216,18 +216,18 @@ public final class PubSubManager extends Manager {
}
/**
* Retrieves the requested node, if it exists. It will throw an
* Retrieves the requested node, if it exists. It will throw an
* exception if it does not.
*
*
* @param id - The unique id of the node
* @param <T> type of the node.
*
* @return the node
* @throws XMPPErrorException The node does not exist
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotAPubSubNodeException
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotAPubSubNodeException
*/
public <T extends Node> T getNode(String id) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException, NotAPubSubNodeException {
Node node = nodeMap.get(id);
@ -316,7 +316,7 @@ public final class PubSubManager extends Manager {
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NotAPubSubNodeException
* @throws NotAPubSubNodeException
* @since 4.2.1
*/
public LeafNode getLeafNode(String id) throws NotALeafNodeException, NoResponseException, NotConnectedException,
@ -410,17 +410,17 @@ public final class PubSubManager extends Manager {
* Get all the nodes that currently exist as a child of the specified
* collection node. If the service does not support collection nodes
* then all nodes will be returned.
*
* To retrieve contents of the root collection node (if it exists),
*
* To retrieve contents of the root collection node (if it exists),
* or there is no root collection node, pass null as the nodeId.
*
* @param nodeId - The id of the collection node for which the child
* nodes will be returned.
*
* @param nodeId - The id of the collection node for which the child
* nodes will be returned.
* @return {@link DiscoverItems} representing the existing nodes
* @throws XMPPErrorException
* @throws XMPPErrorException
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public DiscoverItems discoverNodes(String nodeId) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
DiscoverItems items = new DiscoverItems();
@ -434,12 +434,12 @@ public final class PubSubManager extends Manager {
/**
* Gets the subscriptions on the root node.
*
*
* @return List of exceptions
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public List<Subscription> getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
Stanza reply = sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.SUBSCRIPTIONS), null);
@ -449,13 +449,13 @@ public final class PubSubManager extends Manager {
/**
* Gets the affiliations on the root node.
*
*
* @return List of affiliations
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*
*/
public List<Affiliation> getAffiliations() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub reply = sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.AFFILIATIONS), null);
@ -465,12 +465,12 @@ public final class PubSubManager extends Manager {
/**
* Delete the specified node.
*
*
* @param nodeId
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void deleteNode(String nodeId) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
sendPubsubPacket(Type.set, new NodeExtension(PubSubElementType.DELETE, nodeId), PubSubElementType.DELETE.getNamespace());
@ -479,12 +479,12 @@ public final class PubSubManager extends Manager {
/**
* Returns the default settings for Node configuration.
*
*
* @return configuration form containing the default settings.
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public ConfigureForm getDefaultConfiguration() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// Errors will cause exceptions in getReply, so it only returns
@ -505,12 +505,12 @@ public final class PubSubManager extends Manager {
/**
* Gets the supported features of the servers pubsub implementation
* as a standard {@link DiscoverInfo} instance.
*
*
* @return The supported features
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws NotConnectedException
* @throws InterruptedException
*/
public DiscoverInfo getSupportedFeatures() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
ServiceDiscoveryManager mgr = ServiceDiscoveryManager.getInstanceFor(connection());
@ -602,7 +602,7 @@ public final class PubSubManager extends Manager {
* Get the "default" PubSub service for a given XMPP connection. The default PubSub service is
* simply an arbitrary XMPP service with the PubSub feature and an identity of category "pubsub"
* and type "service".
*
*
* @param connection
* @return the default PubSub service or <code>null</code>.
* @throws NoResponseException

View file

@ -21,7 +21,7 @@ import java.util.Collection;
/**
* Represents a request to publish an item(s) to a specific node.
*
*
* @author Robin Collier
*/
public class PublishItem<T extends Item> extends NodeExtension {
@ -29,7 +29,7 @@ public class PublishItem<T extends Item> extends NodeExtension {
/**
* Construct a request to publish an item to a node.
*
*
* @param nodeId The node to publish to
* @param toPublish The {@link Item} to publish
*/
@ -41,7 +41,7 @@ public class PublishItem<T extends Item> extends NodeExtension {
/**
* Construct a request to publish multiple items to a node.
*
*
* @param nodeId The node to publish to
* @param toPublish The list of {@link Item} to publish
*/

View file

@ -17,9 +17,9 @@
package org.jivesoftware.smackx.pubsub;
/**
* Determines who may publish to a node. Denotes possible values
* Determines who may publish to a node. Denotes possible values
* for {@link ConfigureForm#setPublishModel(PublishModel)}.
*
*
* @author Robin Collier
*/
public enum PublishModel {

View file

@ -22,7 +22,7 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
/**
* Represents and item that has been deleted from a node.
*
*
* @author Robin Collier
*/
public class RetractItem implements ExtensionElement {
@ -30,7 +30,7 @@ public class RetractItem implements ExtensionElement {
/**
* Construct a <tt>RetractItem</tt> with the specified id.
*
*
* @param itemId The id if the item deleted
*/
public RetractItem(String itemId) {

View file

@ -29,9 +29,9 @@ import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
/**
* The default payload representation for {@link PayloadItem#getPayload()}. It simply
* The default payload representation for {@link PayloadItem#getPayload()}. It simply
* stores the XML payload as a string.
*
*
* @author Robin Collier
*/
public class SimplePayload implements ExtensionElement {
@ -62,9 +62,9 @@ public class SimplePayload implements ExtensionElement {
}
/**
* Construct a <tt>SimplePayload</tt> object with the specified element name,
* Construct a <tt>SimplePayload</tt> object with the specified element name,
* namespace and content. The content must be well formed XML.
*
*
* @param elementName The root element name (of the payload)
* @param namespace The namespace of the payload, null if there is none
* @param xmlPayload The payload data

View file

@ -18,7 +18,7 @@ package org.jivesoftware.smackx.pubsub;
/**
* Represents a request to subscribe to a node.
*
*
* @author Robin Collier
*/
public class SubscribeExtension extends NodeExtension {

View file

@ -32,11 +32,11 @@ import org.jxmpp.util.XmppDateTime;
/**
* A decorator for a {@link Form} to easily enable reading and updating
* of subscription options. All operations read or update the underlying {@link DataForm}.
*
*
* <p>Unlike the {@link Form}.setAnswer(XXX)} methods, which throw an exception if the field does not
* exist, all <b>SubscribeForm.setXXX</b> methods will create the field in the wrapped form
* if it does not already exist.
*
*
* @author Robin Collier
*/
public class SubscribeForm extends Form {
@ -54,7 +54,7 @@ public class SubscribeForm extends Form {
/**
* Determines if an entity wants to receive notifications.
*
*
* @return true if want to receive, false otherwise
*/
public boolean isDeliverOn() {
@ -73,7 +73,7 @@ public class SubscribeForm extends Form {
/**
* Determines if notifications should be delivered as aggregations or not.
*
*
* @return true to aggregate, false otherwise
*/
public boolean isDigestOn() {
@ -82,8 +82,8 @@ public class SubscribeForm extends Form {
/**
* Sets whether notifications should be delivered as aggregations or not.
*
* @param digestOn true to aggregate, false otherwise
*
* @param digestOn true to aggregate, false otherwise
*/
public void setDigestOn(boolean digestOn) {
addField(SubscribeOptionFields.deliver, FormField.Type.bool);
@ -92,7 +92,7 @@ public class SubscribeForm extends Form {
/**
* Gets the minimum number of milliseconds between sending notification digests.
*
*
* @return The frequency in milliseconds
*/
public int getDigestFrequency() {
@ -101,7 +101,7 @@ public class SubscribeForm extends Form {
/**
* Sets the minimum number of milliseconds between sending notification digests.
*
*
* @param frequency The frequency in milliseconds
*/
public void setDigestFrequency(int frequency) {
@ -111,7 +111,7 @@ public class SubscribeForm extends Form {
/**
* Get the time at which the leased subscription will expire, or has expired.
*
*
* @return The expiry date
*/
public Date getExpiry() {
@ -128,7 +128,7 @@ public class SubscribeForm extends Form {
/**
* Sets the time at which the leased subscription will expire, or has expired.
*
*
* @param expire The expiry date
*/
public void setExpiry(Date expire) {
@ -137,9 +137,9 @@ public class SubscribeForm extends Form {
}
/**
* Determines whether the entity wants to receive an XMPP message body in
* Determines whether the entity wants to receive an XMPP message body in
* addition to the payload format.
*
*
* @return true to receive the message body, false otherwise
*/
public boolean isIncludeBody() {
@ -147,9 +147,9 @@ public class SubscribeForm extends Form {
}
/**
* Sets whether the entity wants to receive an XMPP message body in
* Sets whether the entity wants to receive an XMPP message body in
* addition to the payload format.
*
*
* @param include true to receive the message body, false otherwise
*/
public void setIncludeBody(boolean include) {
@ -158,9 +158,9 @@ public class SubscribeForm extends Form {
}
/**
* Gets the {@link PresenceState} for which an entity wants to receive
* Gets the {@link PresenceState} for which an entity wants to receive
* notifications.
*
*
* @return the list of states
*/
public List<PresenceState> getShowValues() {
@ -175,7 +175,7 @@ public class SubscribeForm extends Form {
/**
* Sets the list of {@link PresenceState} for which an entity wants
* to receive notifications.
*
*
* @param stateValues The list of states
*/
public void setShowValues(Collection<PresenceState> stateValues) {

View file

@ -19,30 +19,30 @@ package org.jivesoftware.smackx.pubsub;
import java.util.Calendar;
/**
* Defines the possible field options for a subscribe options form as defined
* Defines the possible field options for a subscribe options form as defined
* by <a href="http://xmpp.org/extensions/xep-0060.html#registrar-formtypes-subscribe">Section 16.4.2</a>.
*
*
* @author Robin Collier
*/
public enum SubscribeOptionFields {
/**
* Whether an entity wants to receive or disable notifications.
*
*
* <p><b>Value: boolean</b></p>
*/
deliver,
/**
* Whether an entity wants to receive digests (aggregations) of
* Whether an entity wants to receive digests (aggregations) of
* notifications or all notifications individually.
*
*
* <p><b>Value: boolean</b></p>
*/
digest,
/**
* The minimum number of seconds between sending any two notifications digests.
*
*
* <p><b>Value: int</b></p>
*/
digest_frequency,
@ -54,7 +54,7 @@ public enum SubscribeOptionFields {
expire,
/**
* Whether an entity wants to receive an XMPP message body in addition to
* Whether an entity wants to receive an XMPP message body in addition to
* the payload format.
*
* <p><b>Value: boolean</b></p>
@ -70,7 +70,7 @@ public enum SubscribeOptionFields {
/**
* Subscription type.
*
*
* <p><b>Value: </b></p>
*/
subscription_type,

View file

@ -22,7 +22,7 @@ import org.jxmpp.jid.Jid;
/**
* Represents a subscription to node for both requests and replies.
*
*
* @author Robin Collier
*/
public class Subscription extends NodeExtension {
@ -32,13 +32,13 @@ public class Subscription extends NodeExtension {
protected boolean configRequired = false;
public enum State {
subscribed, unconfigured, pending, none
subscribed, unconfigured, pending, none
}
/**
* Used to constructs a subscription request to the root node with the specified
* JID.
*
*
* @param subscriptionJid The subscriber JID
*/
public Subscription(Jid subscriptionJid) {
@ -48,7 +48,7 @@ public class Subscription extends NodeExtension {
/**
* Used to constructs a subscription request to the specified node with the specified
* JID.
*
*
* @param subscriptionJid The subscriber JID
* @param nodeId The node id
*/
@ -67,9 +67,9 @@ public class Subscription extends NodeExtension {
}
/**
* Constructs a representation of a subscription reply to the specified node
* Constructs a representation of a subscription reply to the specified node
* and JID. The server will have supplied the subscription id and current state.
*
*
* @param jid The JID the request was made under
* @param nodeId The node subscribed to
* @param subscriptionId The id of this subscription
@ -83,15 +83,15 @@ public class Subscription extends NodeExtension {
}
/**
* Constructs a representation of a subscription reply to the specified node
* Constructs a representation of a subscription reply to the specified node
* and JID. The server will have supplied the subscription id and current state
* and whether the subscription need to be configured.
*
*
* @param jid The JID the request was made under
* @param nodeId The node subscribed to
* @param subscriptionId The id of this subscription
* @param state The current state of the subscription
* @param configRequired Is configuration required to complete the subscription
* @param configRequired Is configuration required to complete the subscription
*/
public Subscription(Jid jid, String nodeId, String subscriptionId, State state, boolean configRequired) {
super(PubSubElementType.SUBSCRIPTION, nodeId);
@ -103,7 +103,7 @@ public class Subscription extends NodeExtension {
/**
* Gets the JID the subscription is created for.
*
*
* @return The JID
*/
public Jid getJid() {
@ -112,7 +112,7 @@ public class Subscription extends NodeExtension {
/**
* Gets the subscription id.
*
*
* @return The subscription id
*/
public String getId() {
@ -121,7 +121,7 @@ public class Subscription extends NodeExtension {
/**
* Gets the current subscription state.
*
*
* @return Current subscription state
*/
public State getState() {
@ -130,7 +130,7 @@ public class Subscription extends NodeExtension {
/**
* This value is only relevant when the {@link #getState()} is {@link State#unconfigured}.
*
*
* @return true if configuration is required, false otherwise
*/
public boolean isConfigRequired() {

View file

@ -21,18 +21,18 @@ import java.util.List;
/**
* Base class to represents events that are associated to subscriptions.
*
*
* @author Robin Collier
*/
public abstract class SubscriptionEvent extends NodeEvent {
private List<String> subIds = Collections.emptyList();
/**
* Construct an event with no subscription id's. This can
* Construct an event with no subscription id's. This can
* occur when there is only one subscription to a node. The
* event may or may not report the subscription id along
* event may or may not report the subscription id along
* with the event.
*
*
* @param nodeId The id of the node the event came from
*/
protected SubscriptionEvent(String nodeId) {
@ -41,7 +41,7 @@ public abstract class SubscriptionEvent extends NodeEvent {
/**
* Construct an event with multiple subscriptions.
*
*
* @param nodeId The id of the node the event came from
* @param subscriptionIds The list of subscription id's
*/
@ -52,9 +52,9 @@ public abstract class SubscriptionEvent extends NodeEvent {
subIds = subscriptionIds;
}
/**
/**
* Get the subscriptions this event is associated with.
*
*
* @return List of subscription id's
*/
public List<String> getSubscriptions() {
@ -63,7 +63,7 @@ public abstract class SubscriptionEvent extends NodeEvent {
/**
* Set the list of subscription id's for this event.
*
*
* @param subscriptionIds The list of subscription id's
*/
protected void setSubscriptions(List<String> subscriptionIds) {

View file

@ -21,7 +21,7 @@ import java.util.List;
/**
* Represents the element holding the list of subscription elements.
*
*
* @author Robin Collier
*/
public class SubscriptionsExtension extends NodeExtension {
@ -49,7 +49,7 @@ public class SubscriptionsExtension extends NodeExtension {
/**
* Subscriptions to the root node.
*
*
* @param subList The list of subscriptions
*/
public SubscriptionsExtension(List<Subscription> subList) {
@ -58,7 +58,7 @@ public class SubscriptionsExtension extends NodeExtension {
/**
* Subscriptions to the specified node.
*
*
* @param nodeId The node subscribed to
* @param subList The list of subscriptions
*/
@ -68,7 +68,7 @@ public class SubscriptionsExtension extends NodeExtension {
/**
* Subscriptions to the specified node.
*
*
* @param subscriptionsNamespace the namespace used by this element
* @param nodeId The node subscribed to
* @param subList The list of subscriptions
@ -83,7 +83,7 @@ public class SubscriptionsExtension extends NodeExtension {
/**
* Gets the list of subscriptions.
*
*
* @return List of subscriptions
*/
public List<Subscription> getSubscriptions() {

View file

@ -21,7 +21,7 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
/**
* Represents an unsubscribe element.
*
*
* @author Robin Collier
*/
public class UnsubscribeExtension extends NodeExtension {

View file

@ -21,23 +21,23 @@ import org.jivesoftware.smackx.pubsub.LeafNode;
/**
* Defines the listener for item deletion events from a node.
*
*
* @see LeafNode#addItemDeleteListener(ItemDeleteListener)
*
*
* @author Robin Collier
*/
public interface ItemDeleteListener {
/**
* Called when items are deleted from a node the listener is
* Called when items are deleted from a node the listener is
* registered with.
*
*
* @param items The event with item deletion details
*/
void handleDeletedItems(ItemDeleteEvent items);
/**
* Called when <b>all</b> items are deleted from a node the listener is
* registered with.
* Called when <b>all</b> items are deleted from a node the listener is
* registered with.
*/
void handlePurge();
}

View file

@ -22,7 +22,7 @@ import org.jivesoftware.smackx.pubsub.LeafNode;
/**
* Defines the listener for items being published to a node.
*
*
* @see LeafNode#addItemEventListener(ItemEventListener)
*
* @author Robin Collier
@ -31,7 +31,7 @@ public interface ItemEventListener<T extends Item> {
/**
* Called whenever an item is published to the node the listener
* is registered with.
*
*
* @param items The publishing details.
*/
void handlePublishedItems(ItemPublishEvent<T> items);

View file

@ -21,7 +21,7 @@ import org.jivesoftware.smackx.pubsub.LeafNode;
/**
* Defines the listener for a node being configured.
*
*
* @see LeafNode#addConfigurationListener(NodeConfigListener)
*
* @author Robin Collier
@ -30,7 +30,7 @@ public interface NodeConfigListener {
/**
* Called whenever the node the listener
* is registered with is configured.
*
*
* @param config The configuration details.
*/
void handleNodeConfiguration(ConfigurationEvent config);

View file

@ -26,9 +26,9 @@ import org.jxmpp.jid.Jid;
/**
* The standard PubSub extension of an {@link IQ} packet. This is the topmost
* element of all pubsub requests and replies as defined in the <a href="http://xmpp.org/extensions/xep-0060">Publish-Subscribe</a>
* element of all pubsub requests and replies as defined in the <a href="http://xmpp.org/extensions/xep-0060">Publish-Subscribe</a>
* specification.
*
*
* @author Robin Collier
*/
public class PubSub extends IQ {
@ -56,7 +56,7 @@ public class PubSub extends IQ {
/**
* Returns the XML representation of a pubsub element according the specification.
*
*
* The XML representation will be inside of an iq stanza like
* in the following example:
* <pre>
@ -68,7 +68,7 @@ public class PubSub extends IQ {
* &lt;/pubsub&gt;
* &lt;/iq&gt;
* </pre>
*
*
*/
@Override
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {

View file

@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.packet;
/**
* Defines all the valid namespaces that are used with the {@link PubSub} packet
* as defined by the specification.
*
*
* @author Robin Collier
*/
public enum PubSubNamespace {

View file

@ -29,7 +29,7 @@ import org.xmlpull.v1.XmlPullParser;
/**
* Parses the affiliation element out of the reply stanza from the server
* as specified in the <a href="http://xmpp.org/extensions/xep-0060.html#schemas-pubsub">affiliation schema</a>.
*
*
* @author Robin Collier
*/
public class AffiliationProvider extends ExtensionElementProvider<Affiliation> {

View file

@ -29,7 +29,7 @@ import org.jivesoftware.smackx.pubsub.AffiliationsExtension;
/**
* Parses the affiliations element out of the reply stanza from the server
* as specified in the <a href="http://xmpp.org/extensions/xep-0060.html#schemas-pubsub">affiliation schema</a>.
*
*
* @author Robin Collier
*/public class AffiliationsProvider extends EmbeddedExtensionProvider<AffiliationsExtension> {
@SuppressWarnings("unchecked")

View file

@ -27,9 +27,9 @@ import org.jivesoftware.smackx.pubsub.ConfigureForm;
import org.jivesoftware.smackx.xdata.packet.DataForm;
/**
* Parses the node configuration element out of the message event stanza from
* Parses the node configuration element out of the message event stanza from
* the server as specified in the <a href="http://xmpp.org/extensions/xep-0060.html#schemas-event">configuration schema</a>.
*
*
* @author Robin Collier
*/
public class ConfigEventProvider extends EmbeddedExtensionProvider<ConfigurationEvent> {

View file

@ -27,9 +27,9 @@ import org.jivesoftware.smackx.pubsub.EventElementType;
import org.jivesoftware.smackx.pubsub.NodeExtension;
/**
* Parses the event element out of the message stanza from
* Parses the event element out of the message stanza from
* the server as specified in the <a href="http://xmpp.org/extensions/xep-0060.html#schemas-event">event schema</a>.
*
*
* @author Robin Collier
*/
public class EventProvider extends EmbeddedExtensionProvider<EventElement> {

View file

@ -30,7 +30,7 @@ import org.jivesoftware.smackx.xdata.packet.DataForm;
/**
* Parses one of several elements used in PubSub that contain a form of some kind as a child element. The
* elements and namespaces supported is defined in {@link FormNodeType}.
*
*
* @author Robin Collier
*/
public class FormNodeProvider extends EmbeddedExtensionProvider<FormNode> {

View file

@ -34,7 +34,7 @@ import org.xmlpull.v1.XmlPullParser;
* {@link PubSubNamespace#event} namespaces. To parse the item contents, it will use whatever
* {@link ExtensionElementProvider} is registered in <b>smack.providers</b> for its element name and namespace. If no
* provider is registered, it will return a {@link SimplePayload}.
*
*
* @author Robin Collier
*/
public class ItemProvider extends ExtensionElementProvider<Item> {

View file

@ -25,9 +25,9 @@ import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
import org.jivesoftware.smackx.pubsub.ItemsExtension;
/**
* Parses the <b>items</b> element out of the message event stanza from
* Parses the <b>items</b> element out of the message event stanza from
* the server as specified in the <a href="http://xmpp.org/extensions/xep-0060.html#schemas-event">items schema</a>.
*
*
* @author Robin Collier
*/
public class ItemsProvider extends EmbeddedExtensionProvider<ItemsExtension> {

View file

@ -28,7 +28,7 @@ import org.xmlpull.v1.XmlPullParser;
/**
* Parses the root PubSub stanza extensions of the {@link IQ} stanza and returns
* a {@link PubSub} instance.
*
*
* @author Robin Collier
*/
public class PubSubProvider extends IQProvider<PubSub> {

View file

@ -25,10 +25,10 @@ import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
import org.jivesoftware.smackx.pubsub.RetractItem;
/**
* Parses the <b>retract</b> element out of the message event stanza from
* Parses the <b>retract</b> element out of the message event stanza from
* the server as specified in the <a href="http://xmpp.org/extensions/xep-0060.html#schemas-event">retract schema</a>.
* This element is a child of the <b>items</b> element.
*
*
* @author Robin Collier
*/
public class RetractEventProvider extends EmbeddedExtensionProvider<RetractItem> {

View file

@ -28,7 +28,7 @@ import org.jivesoftware.smackx.pubsub.PubSubElementType;
/**
* Parses simple elements that only contain a <b>node</b> attribute. This is common amongst many of the
* elements defined in the PubSub specification. For this common case a {@link NodeExtension} is returned.
*
*
* @author Robin Collier
*/
public class SimpleNodeProvider extends EmbeddedExtensionProvider<NodeExtension> {

View file

@ -30,7 +30,7 @@ import org.xmlpull.v1.XmlPullParserException;
/**
* Parses the <b>subscription</b> element out of the PubSub IQ message from
* the server as specified in the <a href="http://xmpp.org/extensions/xep-0060.html#schemas-pubsub">subscription schema</a>.
*
*
* @author Robin Collier
*/
public class SubscriptionProvider extends ExtensionElementProvider<Subscription> {

View file

@ -29,7 +29,7 @@ import org.jivesoftware.smackx.pubsub.SubscriptionsExtension.SubscriptionsNamesp
/**
* Parses the <b>subscriptions</b> element out of the PubSub IQ message from
* the server as specified in the <a href="http://xmpp.org/extensions/xep-0060.html#schemas-pubsub">subscriptions schema</a>.
*
*
* @author Robin Collier
*/
public class SubscriptionsProvider extends EmbeddedExtensionProvider<SubscriptionsExtension> {

View file

@ -25,13 +25,13 @@ import org.jivesoftware.smackx.xdata.Form;
/**
* Utility for extracting information from packets.
*
*
* @author Robin Collier
*/
public class NodeUtils {
/**
/**
* Get a {@link ConfigureForm} from a packet.
*
*
* @param packet
* @param elem
* @return The configuration form