true
if this is an affiliation element to modify affiliations on a node, false
otherwise.
+ * @since 4.2
+ */
+ public boolean isAffiliationModification() {
+ if (jid != null && affiliation != null) {
+ assert(node == null && namespace == PubSubNamespace.OWNER);
+ return true;
+ }
+ return false;
+ }
+
@Override
public XmlStringBuilder toXML() {
XmlStringBuilder xml = new XmlStringBuilder(this);
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/AffiliationsExtension.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/AffiliationsExtension.java
index 9a3f50725..b365adc47 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/AffiliationsExtension.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/AffiliationsExtension.java
@@ -19,26 +19,33 @@ package org.jivesoftware.smackx.pubsub;
import java.util.Collections;
import java.util.List;
+import org.jivesoftware.smack.util.XmlStringBuilder;
+
/**
* Represents the affiliations element of the reply to a request for affiliations.
- * It is defined in the specification in section 5.7 Retrieve Affiliations.
+ * It is defined in the specification in section 5.7 Retrieve Affiliations and
+ * 8.9 Manage Affiliations.
*
* @author Robin Collier
*/
public class AffiliationsExtension extends NodeExtension
{
protected List+ * Note that this is an optional PubSub feature ('pubusb#modify-affiliations'). + *
+ * + * @param additionalExtensions optional additional extension elements add to the request. + * @param returnedExtensions an optional collection that will be filled with the returned + * extension elements. + * @return list of entities whose affiliation is not 'none'. + * @throws NoResponseException + * @throws XMPPErrorException + * @throws NotConnectedException + * @throws InterruptedException + * @see XEP-60 § 8.9.1 Retrieve Affiliations List + * @since 4.2 + */ + public List+ * Note that this is an optional PubSub feature ('pubusb#modify-affiliations'). + *
+ * + * @param affiliations + * @returnnull
or a PubSub stanza with additional information on success.
+ * @throws NoResponseException
+ * @throws XMPPErrorException
+ * @throws NotConnectedException
+ * @throws InterruptedException
+ * @see XEP-60 § 8.9.2 Modify Affiliation
+ * @since 4.2
+ */
+ public PubSub modifyAffiliationAsOwner(List