mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-18 08:51:08 +01:00
Merge branch '4.1'
Conflicts: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java smack-core/src/main/java/org/jivesoftware/smack/PacketCollector.java smack-core/src/main/java/org/jivesoftware/smack/PacketListener.java smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java smack-core/src/main/java/org/jivesoftware/smack/packet/Packet.java smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java smack-core/src/test/java/org/jivesoftware/smack/ThreadedDummyConnection.java smack-extensions/src/main/java/org/jivesoftware/smackx/address/provider/MultipleAddressesProvider.java smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/DataListener.java smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FaultTolerantNegotiator.java smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IBBTransferNegotiator.java smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/StreamNegotiator.java smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/packet/PubSub.java smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/VCardManager.java smack-extensions/src/test/java/org/jivesoftware/smackx/receipts/DeliveryReceiptTest.java smack-im/src/main/java/org/jivesoftware/smack/chat/ChatManager.java smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/provider/JingleProvider.java smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/UserID.java smack-legacy/src/main/java/org/jivesoftware/smackx/xroster/provider/RosterExchangeProvider.java smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java version.gradle
This commit is contained in:
commit
701aa7d9c4
298 changed files with 2402 additions and 1562 deletions
|
|
@ -17,7 +17,7 @@
|
|||
package org.jivesoftware.smackx.pubsub;
|
||||
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
|
||||
/**
|
||||
* Represents a affiliation between a user and a node, where the {@link #type} defines
|
||||
|
|
@ -29,7 +29,7 @@ import org.jivesoftware.smack.packet.PacketExtension;
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class Affiliation implements PacketExtension
|
||||
public class Affiliation implements ExtensionElement
|
||||
{
|
||||
protected String node;
|
||||
protected Type type;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import java.util.Arrays;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
|
||||
/**
|
||||
* Represents the <b>configuration</b> element of a pubsub message event which
|
||||
|
|
@ -49,11 +49,11 @@ public class ConfigurationEvent extends NodeExtension implements EmbeddedPacketE
|
|||
return form;
|
||||
}
|
||||
|
||||
public List<PacketExtension> getExtensions()
|
||||
public List<ExtensionElement> getExtensions()
|
||||
{
|
||||
if (getConfiguration() == null)
|
||||
return Collections.emptyList();
|
||||
else
|
||||
return Arrays.asList(((PacketExtension)getConfiguration().getDataFormToSend()));
|
||||
return Arrays.asList(((ExtensionElement)getConfiguration().getDataFormToSend()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ package org.jivesoftware.smackx.pubsub;
|
|||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||
|
||||
/**
|
||||
* This interface defines {@link PacketExtension} implementations that contain other
|
||||
* This interface defines {@link ExtensionElement} implementations that contain other
|
||||
* 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
|
||||
|
|
@ -37,12 +37,12 @@ import org.jivesoftware.smack.util.PacketParserUtils;
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public interface EmbeddedPacketExtension extends PacketExtension
|
||||
public interface EmbeddedPacketExtension extends ExtensionElement
|
||||
{
|
||||
/**
|
||||
* Get the list of embedded {@link PacketExtension} objects.
|
||||
* Get the list of embedded {@link ExtensionElement} objects.
|
||||
*
|
||||
* @return List of embedded {@link PacketExtension}
|
||||
* @return List of embedded {@link ExtensionElement}
|
||||
*/
|
||||
List<PacketExtension> getExtensions();
|
||||
List<ExtensionElement> getExtensions();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
|
||||
|
||||
/**
|
||||
|
|
@ -46,9 +46,9 @@ public class EventElement implements EmbeddedPacketExtension
|
|||
return type;
|
||||
}
|
||||
|
||||
public List<PacketExtension> getExtensions()
|
||||
public List<ExtensionElement> getExtensions()
|
||||
{
|
||||
return Arrays.asList(new PacketExtension[]{getEvent()});
|
||||
return Arrays.asList(new ExtensionElement[]{getEvent()});
|
||||
}
|
||||
|
||||
public NodeExtension getEvent()
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.jivesoftware.smackx.pubsub;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
|
||||
/**
|
||||
* This class is used to for multiple purposes.
|
||||
|
|
@ -36,7 +36,7 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
|
|||
{
|
||||
protected ItemsElementType type;
|
||||
protected Boolean notify;
|
||||
protected List<? extends PacketExtension> items;
|
||||
protected List<? extends ExtensionElement> items;
|
||||
|
||||
public enum ItemsElementType
|
||||
{
|
||||
|
|
@ -83,7 +83,7 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
|
|||
* @param nodeId The node to which the items are being sent or deleted
|
||||
* @param items The list of {@link Item} or {@link RetractItem}
|
||||
*/
|
||||
public ItemsExtension(ItemsElementType itemsType, String nodeId, List<? extends PacketExtension> items)
|
||||
public ItemsExtension(ItemsElementType itemsType, String nodeId, List<? extends ExtensionElement> items)
|
||||
{
|
||||
super(itemsType.getNodeElement(), nodeId);
|
||||
type = itemsType;
|
||||
|
|
@ -106,7 +106,7 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
|
|||
* @param nodeId The node to which the items are being sent or deleted
|
||||
* @param items The list of {@link Item} or {@link RetractItem}
|
||||
*/
|
||||
public ItemsExtension(String nodeId, List<? extends PacketExtension> items, boolean notify)
|
||||
public ItemsExtension(String nodeId, List<? extends ExtensionElement> items, boolean notify)
|
||||
{
|
||||
super(ItemsElementType.retract.getNodeElement(), nodeId);
|
||||
type = ItemsElementType.retract;
|
||||
|
|
@ -125,9 +125,9 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<PacketExtension> getExtensions()
|
||||
public List<ExtensionElement> getExtensions()
|
||||
{
|
||||
return (List<PacketExtension>)getItems();
|
||||
return (List<ExtensionElement>)getItems();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -135,7 +135,7 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
|
|||
*
|
||||
* return List of {@link Item}, {@link RetractItem}, or null
|
||||
*/
|
||||
public List<? extends PacketExtension> getItems()
|
||||
public List<? extends ExtensionElement> getItems()
|
||||
{
|
||||
return items;
|
||||
}
|
||||
|
|
@ -175,7 +175,7 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
|
|||
else
|
||||
{
|
||||
builder.append("'>");
|
||||
for (PacketExtension item : items)
|
||||
for (ExtensionElement item : items)
|
||||
{
|
||||
builder.append(item.toXML());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import org.jivesoftware.smack.SmackException.NotConnectedException;
|
|||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
import org.jivesoftware.smack.packet.IQ.Type;
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
|
||||
import org.jivesoftware.smackx.pubsub.packet.PubSub;
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ public class LeafNode extends Node
|
|||
*/
|
||||
public <T extends Item> List<T> getItems() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException
|
||||
{
|
||||
return getItems((List<PacketExtension>) null, (List<PacketExtension>) null);
|
||||
return getItems((List<ExtensionElement>) null, (List<ExtensionElement>) null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -176,8 +176,8 @@ public class LeafNode extends Node
|
|||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public <T extends Item> List<T> getItems(List<PacketExtension> additionalExtensions,
|
||||
List<PacketExtension> returnedExtensions) throws NoResponseException,
|
||||
public <T extends Item> List<T> getItems(List<ExtensionElement> additionalExtensions,
|
||||
List<ExtensionElement> returnedExtensions) throws NoResponseException,
|
||||
XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId()));
|
||||
request.addExtensions(additionalExtensions);
|
||||
|
|
@ -191,7 +191,7 @@ public class LeafNode extends Node
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
private <T extends Item> List<T> getItems(PubSub request,
|
||||
List<PacketExtension> returnedExtensions) throws NoResponseException,
|
||||
List<ExtensionElement> returnedExtensions) throws NoResponseException,
|
||||
XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
PubSub result = con.createPacketCollectorAndSend(request).nextResultOrThrow();
|
||||
ItemsExtension itemsElem = result.getExtension(PubSubElementType.ITEMS);
|
||||
|
|
@ -219,7 +219,7 @@ public class LeafNode extends Node
|
|||
{
|
||||
PubSub packet = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PUBLISH, getId()));
|
||||
|
||||
con.sendPacket(packet);
|
||||
con.sendStanza(packet);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -266,7 +266,7 @@ public class LeafNode extends Node
|
|||
{
|
||||
PubSub packet = createPubsubPacket(Type.set, new PublishItem<T>(getId(), items));
|
||||
|
||||
con.sendPacket(packet);
|
||||
con.sendStanza(packet);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -21,16 +21,16 @@ import java.util.Collection;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
import org.jivesoftware.smack.StanzaListener;
|
||||
import org.jivesoftware.smack.SmackException.NoResponseException;
|
||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||
import org.jivesoftware.smack.filter.OrFilter;
|
||||
import org.jivesoftware.smack.filter.PacketFilter;
|
||||
import org.jivesoftware.smack.filter.StanzaFilter;
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.IQ.Type;
|
||||
import org.jivesoftware.smackx.delay.DelayInformationManager;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
||||
|
|
@ -51,9 +51,9 @@ abstract public class Node
|
|||
protected String id;
|
||||
protected Jid to;
|
||||
|
||||
protected ConcurrentHashMap<ItemEventListener<Item>, PacketListener> itemEventToListenerMap = new ConcurrentHashMap<ItemEventListener<Item>, PacketListener>();
|
||||
protected ConcurrentHashMap<ItemDeleteListener, PacketListener> itemDeleteToListenerMap = new ConcurrentHashMap<ItemDeleteListener, PacketListener>();
|
||||
protected ConcurrentHashMap<NodeConfigListener, PacketListener> configEventToListenerMap = new ConcurrentHashMap<NodeConfigListener, PacketListener>();
|
||||
protected ConcurrentHashMap<ItemEventListener<Item>, StanzaListener> itemEventToListenerMap = new ConcurrentHashMap<ItemEventListener<Item>, StanzaListener>();
|
||||
protected ConcurrentHashMap<ItemDeleteListener, StanzaListener> itemDeleteToListenerMap = new ConcurrentHashMap<ItemDeleteListener, StanzaListener>();
|
||||
protected ConcurrentHashMap<NodeConfigListener, StanzaListener> configEventToListenerMap = new ConcurrentHashMap<NodeConfigListener, StanzaListener>();
|
||||
|
||||
/**
|
||||
* Construct a node associated to the supplied connection with the specified
|
||||
|
|
@ -170,7 +170,7 @@ abstract public class Node
|
|||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public List<Subscription> getSubscriptions(List<PacketExtension> additionalExtensions, Collection<PacketExtension> returnedExtensions)
|
||||
public List<Subscription> getSubscriptions(List<ExtensionElement> additionalExtensions, Collection<ExtensionElement> returnedExtensions)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return getSubscriptions(additionalExtensions, returnedExtensions, null);
|
||||
}
|
||||
|
|
@ -214,18 +214,18 @@ abstract public class Node
|
|||
* Retrieve Subscriptions List</a>
|
||||
* @since 4.1
|
||||
*/
|
||||
public List<Subscription> getSubscriptionsAsOwner(List<PacketExtension> additionalExtensions,
|
||||
Collection<PacketExtension> returnedExtensions) throws NoResponseException, XMPPErrorException,
|
||||
public List<Subscription> getSubscriptionsAsOwner(List<ExtensionElement> additionalExtensions,
|
||||
Collection<ExtensionElement> returnedExtensions) throws NoResponseException, XMPPErrorException,
|
||||
NotConnectedException, InterruptedException {
|
||||
return getSubscriptions(additionalExtensions, returnedExtensions, PubSubNamespace.OWNER);
|
||||
}
|
||||
|
||||
private List<Subscription> getSubscriptions(List<PacketExtension> additionalExtensions,
|
||||
Collection<PacketExtension> returnedExtensions, PubSubNamespace pubSubNamespace)
|
||||
private List<Subscription> getSubscriptions(List<ExtensionElement> additionalExtensions,
|
||||
Collection<ExtensionElement> returnedExtensions, PubSubNamespace pubSubNamespace)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
PubSub pubSub = createPubsubPacket(Type.get, new NodeExtension(PubSubElementType.SUBSCRIPTIONS, getId()), pubSubNamespace);
|
||||
if (additionalExtensions != null) {
|
||||
for (PacketExtension pe : additionalExtensions) {
|
||||
for (ExtensionElement pe : additionalExtensions) {
|
||||
pubSub.addExtension(pe);
|
||||
}
|
||||
}
|
||||
|
|
@ -267,11 +267,12 @@ abstract public class Node
|
|||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public List<Affiliation> getAffiliations(List<PacketExtension> additionalExtensions, Collection<PacketExtension> returnedExtensions)
|
||||
public List<Affiliation> getAffiliations(List<ExtensionElement> additionalExtensions, Collection<ExtensionElement> returnedExtensions)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
|
||||
PubSub pubSub = createPubsubPacket(Type.get, new NodeExtension(PubSubElementType.AFFILIATIONS, getId()));
|
||||
if (additionalExtensions != null) {
|
||||
for (PacketExtension pe : additionalExtensions) {
|
||||
for (ExtensionElement pe : additionalExtensions) {
|
||||
pubSub.addExtension(pe);
|
||||
}
|
||||
}
|
||||
|
|
@ -413,9 +414,9 @@ abstract public class Node
|
|||
@SuppressWarnings("unchecked")
|
||||
public void addItemEventListener(@SuppressWarnings("rawtypes") ItemEventListener listener)
|
||||
{
|
||||
PacketListener conListener = new ItemEventTranslator(listener);
|
||||
StanzaListener conListener = new ItemEventTranslator(listener);
|
||||
itemEventToListenerMap.put(listener, conListener);
|
||||
con.addSyncPacketListener(conListener, new EventContentFilter(EventElementType.items.toString(), "item"));
|
||||
con.addSyncStanzaListener(conListener, new EventContentFilter(EventElementType.items.toString(), "item"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -425,10 +426,10 @@ abstract public class Node
|
|||
*/
|
||||
public void removeItemEventListener(@SuppressWarnings("rawtypes") ItemEventListener listener)
|
||||
{
|
||||
PacketListener conListener = itemEventToListenerMap.remove(listener);
|
||||
StanzaListener conListener = itemEventToListenerMap.remove(listener);
|
||||
|
||||
if (conListener != null)
|
||||
con.removeSyncPacketListener(conListener);
|
||||
con.removeSyncStanzaListener(conListener);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -439,9 +440,9 @@ abstract public class Node
|
|||
*/
|
||||
public void addConfigurationListener(NodeConfigListener listener)
|
||||
{
|
||||
PacketListener conListener = new NodeConfigTranslator(listener);
|
||||
StanzaListener conListener = new NodeConfigTranslator(listener);
|
||||
configEventToListenerMap.put(listener, conListener);
|
||||
con.addSyncPacketListener(conListener, new EventContentFilter(EventElementType.configuration.toString()));
|
||||
con.addSyncStanzaListener(conListener, new EventContentFilter(EventElementType.configuration.toString()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -451,10 +452,10 @@ abstract public class Node
|
|||
*/
|
||||
public void removeConfigurationListener(NodeConfigListener listener)
|
||||
{
|
||||
PacketListener conListener = configEventToListenerMap .remove(listener);
|
||||
StanzaListener conListener = configEventToListenerMap .remove(listener);
|
||||
|
||||
if (conListener != null)
|
||||
con.removeSyncPacketListener(conListener);
|
||||
con.removeSyncStanzaListener(conListener);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -465,12 +466,12 @@ abstract public class Node
|
|||
*/
|
||||
public void addItemDeleteListener(ItemDeleteListener listener)
|
||||
{
|
||||
PacketListener 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());
|
||||
|
||||
con.addSyncPacketListener(delListener, new OrFilter(deleteItem, purge));
|
||||
con.addSyncStanzaListener(delListener, new OrFilter(deleteItem, purge));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -480,10 +481,10 @@ abstract public class Node
|
|||
*/
|
||||
public void removeItemDeleteListener(ItemDeleteListener listener)
|
||||
{
|
||||
PacketListener conListener = itemDeleteToListenerMap .remove(listener);
|
||||
StanzaListener conListener = itemDeleteToListenerMap .remove(listener);
|
||||
|
||||
if (conListener != null)
|
||||
con.removeSyncPacketListener(conListener);
|
||||
con.removeSyncStanzaListener(conListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -492,12 +493,12 @@ abstract public class Node
|
|||
return super.toString() + " " + getClass().getName() + " id: " + id;
|
||||
}
|
||||
|
||||
protected PubSub createPubsubPacket(Type type, PacketExtension ext)
|
||||
protected PubSub createPubsubPacket(Type type, ExtensionElement ext)
|
||||
{
|
||||
return createPubsubPacket(type, ext, null);
|
||||
}
|
||||
|
||||
protected PubSub createPubsubPacket(Type type, PacketExtension ext, PubSubNamespace ns)
|
||||
protected PubSub createPubsubPacket(Type type, ExtensionElement ext, PubSubNamespace ns)
|
||||
{
|
||||
return PubSub.createPubsubPacket(to, type, ext, ns);
|
||||
}
|
||||
|
|
@ -531,7 +532,7 @@ abstract public class Node
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class ItemEventTranslator implements PacketListener
|
||||
public class ItemEventTranslator implements StanzaListener
|
||||
{
|
||||
@SuppressWarnings("rawtypes")
|
||||
private ItemEventListener listener;
|
||||
|
|
@ -557,7 +558,7 @@ abstract public class Node
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class ItemDeleteTranslator implements PacketListener
|
||||
public class ItemDeleteTranslator implements StanzaListener
|
||||
{
|
||||
private ItemDeleteListener listener;
|
||||
|
||||
|
|
@ -570,7 +571,7 @@ abstract public class Node
|
|||
{
|
||||
EventElement event = (EventElement)packet.getExtension("event", PubSubNamespace.EVENT.getXmlns());
|
||||
|
||||
List<PacketExtension> extList = event.getExtensions();
|
||||
List<ExtensionElement> extList = event.getExtensions();
|
||||
|
||||
if (extList.get(0).getElementName().equals(PubSubElementType.PURGE_EVENT.getElementName()))
|
||||
{
|
||||
|
|
@ -600,7 +601,7 @@ abstract public class Node
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class NodeConfigTranslator implements PacketListener
|
||||
public class NodeConfigTranslator implements StanzaListener
|
||||
{
|
||||
private NodeConfigListener listener;
|
||||
|
||||
|
|
@ -619,12 +620,12 @@ abstract public class Node
|
|||
}
|
||||
|
||||
/**
|
||||
* Filter for {@link PacketListener} 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 implements PacketFilter
|
||||
class EventContentFilter implements StanzaFilter
|
||||
{
|
||||
private String firstElement;
|
||||
private String secondElement;
|
||||
|
|
@ -665,7 +666,7 @@ abstract public class Node
|
|||
|
||||
if (embedEvent instanceof EmbeddedPacketExtension)
|
||||
{
|
||||
List<PacketExtension> secondLevelList = ((EmbeddedPacketExtension)embedEvent).getExtensions();
|
||||
List<ExtensionElement> secondLevelList = ((EmbeddedPacketExtension)embedEvent).getExtensions();
|
||||
|
||||
if (secondLevelList.size() > 0 && secondLevelList.get(0).getElementName().equals(secondElement))
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.pubsub;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
|
||||
/**
|
||||
* A class which represents a common element within the pubsub defined
|
||||
|
|
@ -26,7 +26,7 @@ import org.jivesoftware.smack.packet.PacketExtension;
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class NodeExtension implements PacketExtension
|
||||
public class NodeExtension implements ExtensionElement
|
||||
{
|
||||
private final PubSubElementType element;
|
||||
private final String node;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
package org.jivesoftware.smackx.pubsub;
|
||||
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smackx.pubsub.provider.ItemProvider;
|
||||
|
||||
/**
|
||||
|
|
@ -43,14 +43,14 @@ import org.jivesoftware.smackx.pubsub.provider.ItemProvider;
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class PayloadItem<E extends PacketExtension> extends Item
|
||||
public class PayloadItem<E extends ExtensionElement> extends Item
|
||||
{
|
||||
private E payload;
|
||||
|
||||
/**
|
||||
* Create an <tt>Item</tt> with no id and a payload The id will be set by the server.
|
||||
*
|
||||
* @param payloadExt A {@link PacketExtension} which represents the payload data.
|
||||
* @param payloadExt A {@link ExtensionElement} which represents the payload data.
|
||||
*/
|
||||
public PayloadItem(E payloadExt)
|
||||
{
|
||||
|
|
@ -65,7 +65,7 @@ public class PayloadItem<E extends PacketExtension> extends Item
|
|||
* 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 PacketExtension} which represents the payload data.
|
||||
* @param payloadExt A {@link ExtensionElement} which represents the payload data.
|
||||
*/
|
||||
public PayloadItem(String itemId, E payloadExt)
|
||||
{
|
||||
|
|
@ -87,7 +87,7 @@ public class PayloadItem<E extends PacketExtension> extends Item
|
|||
*
|
||||
* @param itemId The id of this item.
|
||||
* @param nodeId The id of the node the item was published to.
|
||||
* @param payloadExt A {@link PacketExtension} which represents the payload data.
|
||||
* @param payloadExt A {@link ExtensionElement} which represents the payload data.
|
||||
*/
|
||||
public PayloadItem(String itemId, String nodeId, E payloadExt)
|
||||
{
|
||||
|
|
@ -102,7 +102,7 @@ public class PayloadItem<E extends PacketExtension> 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 PacketExtension}.
|
||||
* @return The payload as a {@link ExtensionElement}.
|
||||
*/
|
||||
public E getPayload()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import org.jivesoftware.smack.packet.EmptyResultIQ;
|
|||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.IQ.Type;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
||||
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
|
||||
|
|
@ -314,15 +314,15 @@ final public class PubSubManager
|
|||
return mgr.discoverInfo(to);
|
||||
}
|
||||
|
||||
private PubSub sendPubsubPacket(Type type, PacketExtension ext, PubSubNamespace ns)
|
||||
private PubSub sendPubsubPacket(Type type, ExtensionElement ext, PubSubNamespace ns)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return sendPubsubPacket(con, to, type, Collections.singletonList(ext), ns);
|
||||
}
|
||||
|
||||
static PubSub sendPubsubPacket(XMPPConnection con, Jid to, Type type, List<PacketExtension> extList, PubSubNamespace ns) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException
|
||||
static PubSub sendPubsubPacket(XMPPConnection con, Jid to, Type type, List<ExtensionElement> extList, PubSubNamespace ns) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException
|
||||
{
|
||||
PubSub pubSub = new PubSub(to, type, ns);
|
||||
for (PacketExtension pe : extList) {
|
||||
for (ExtensionElement pe : extList) {
|
||||
pubSub.addExtension(pe);
|
||||
}
|
||||
return sendPubsubPacket(con ,pubSub);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.pubsub;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
|
||||
|
||||
/**
|
||||
|
|
@ -24,7 +24,7 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class RetractItem implements PacketExtension
|
||||
public class RetractItem implements ExtensionElement
|
||||
{
|
||||
private String id;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.pubsub;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
|
||||
/**
|
||||
* The default payload representation for {@link PayloadItem#getPayload()}. It simply
|
||||
|
|
@ -24,7 +24,7 @@ import org.jivesoftware.smack.packet.PacketExtension;
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class SimplePayload implements PacketExtension
|
||||
public class SimplePayload implements ExtensionElement
|
||||
{
|
||||
private final String elemName;
|
||||
private final String ns;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
package org.jivesoftware.smackx.pubsub.packet;
|
||||
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smackx.pubsub.PubSubElementType;
|
||||
import org.jxmpp.jid.Jid;
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ public class PubSub extends IQ
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <PE extends PacketExtension> PE getExtension(PubSubElementType elem)
|
||||
public <PE extends ExtensionElement> PE getExtension(PubSubElementType elem)
|
||||
{
|
||||
return (PE) getExtension(elem.getElementName(), elem.getNamespace().getXmlns());
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@ public class PubSub extends IQ
|
|||
return xml;
|
||||
}
|
||||
|
||||
public static PubSub createPubsubPacket(Jid to, Type type, PacketExtension extension, PubSubNamespace ns) {
|
||||
public static PubSub createPubsubPacket(Jid to, Type type, ExtensionElement extension, PubSubNamespace ns) {
|
||||
PubSub pubSub = new PubSub(to, type, ns);
|
||||
pubSub.addExtension(extension);
|
||||
return pubSub;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
import org.jivesoftware.smackx.pubsub.Affiliation;
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ import org.jivesoftware.smackx.pubsub.Affiliation;
|
|||
public class AffiliationProvider extends EmbeddedExtensionProvider<Affiliation>
|
||||
{
|
||||
@Override
|
||||
protected Affiliation createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends PacketExtension> content)
|
||||
protected Affiliation createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends ExtensionElement> content)
|
||||
{
|
||||
return new Affiliation(attributeMap.get("node"), Affiliation.Type.valueOf(attributeMap.get("affiliation")));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
import org.jivesoftware.smackx.pubsub.Affiliation;
|
||||
import org.jivesoftware.smackx.pubsub.AffiliationsExtension;
|
||||
|
|
@ -33,7 +33,7 @@ import org.jivesoftware.smackx.pubsub.AffiliationsExtension;
|
|||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected AffiliationsExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends PacketExtension> content)
|
||||
protected AffiliationsExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends ExtensionElement> content)
|
||||
{
|
||||
return new AffiliationsExtension((List<Affiliation>)content);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
import org.jivesoftware.smackx.pubsub.ConfigurationEvent;
|
||||
import org.jivesoftware.smackx.pubsub.ConfigureForm;
|
||||
|
|
@ -34,7 +34,7 @@ import org.jivesoftware.smackx.xdata.packet.DataForm;
|
|||
public class ConfigEventProvider extends EmbeddedExtensionProvider<ConfigurationEvent>
|
||||
{
|
||||
@Override
|
||||
protected ConfigurationEvent createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
|
||||
protected ConfigurationEvent createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends ExtensionElement> content)
|
||||
{
|
||||
if (content.size() == 0)
|
||||
return new ConfigurationEvent(attMap.get("node"));
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
import org.jivesoftware.smackx.pubsub.EventElement;
|
||||
import org.jivesoftware.smackx.pubsub.EventElementType;
|
||||
|
|
@ -34,7 +34,7 @@ import org.jivesoftware.smackx.pubsub.NodeExtension;
|
|||
public class EventProvider extends EmbeddedExtensionProvider<EventElement>
|
||||
{
|
||||
@Override
|
||||
protected EventElement createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
|
||||
protected EventElement createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends ExtensionElement> content)
|
||||
{
|
||||
return new EventElement(EventElementType.valueOf(content.get(0).getElementName()), (NodeExtension)content.get(0));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
import org.jivesoftware.smackx.pubsub.FormNode;
|
||||
import org.jivesoftware.smackx.pubsub.FormNodeType;
|
||||
|
|
@ -35,7 +35,7 @@ import org.jivesoftware.smackx.xdata.packet.DataForm;
|
|||
public class FormNodeProvider extends EmbeddedExtensionProvider<FormNode>
|
||||
{
|
||||
@Override
|
||||
protected FormNode createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends PacketExtension> content)
|
||||
protected FormNode createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends ExtensionElement> content)
|
||||
{
|
||||
return new FormNode(FormNodeType.valueOfFromElementName(currentElement, currentNamespace), attributeMap.get("node"), new Form((DataForm)content.iterator().next()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.io.IOException;
|
||||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.provider.PacketExtensionProvider;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
||||
import org.jivesoftware.smack.provider.ProviderManager;
|
||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||
import org.jivesoftware.smackx.pubsub.Item;
|
||||
|
|
@ -33,12 +33,12 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
/**
|
||||
* Parses an <b>item</b> element as is defined in both the {@link PubSubNamespace#BASIC} and
|
||||
* {@link PubSubNamespace#EVENT} namespaces. To parse the item contents, it will use whatever
|
||||
* {@link PacketExtensionProvider} is registered in <b>smack.providers</b> for its element name and namespace. If no
|
||||
* {@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 PacketExtensionProvider<Item>
|
||||
public class ItemProvider extends ExtensionElementProvider<Item>
|
||||
{
|
||||
@Override
|
||||
public Item parse(XmlPullParser parser, int initialDepth)
|
||||
|
|
@ -57,7 +57,7 @@ public class ItemProvider extends PacketExtensionProvider<Item>
|
|||
String payloadElemName = parser.getName();
|
||||
String payloadNS = parser.getNamespace();
|
||||
|
||||
final PacketExtensionProvider<PacketExtension> extensionProvider = ProviderManager.getExtensionProvider(payloadElemName, payloadNS);
|
||||
final ExtensionElementProvider<ExtensionElement> extensionProvider = ProviderManager.getExtensionProvider(payloadElemName, payloadNS);
|
||||
if (extensionProvider == null)
|
||||
{
|
||||
CharSequence payloadText = PacketParserUtils.parseElement(parser, true);
|
||||
|
|
@ -65,7 +65,7 @@ public class ItemProvider extends PacketExtensionProvider<Item>
|
|||
}
|
||||
else
|
||||
{
|
||||
return new PayloadItem<PacketExtension>(id, node, extensionProvider.parse(parser));
|
||||
return new PayloadItem<ExtensionElement>(id, node, extensionProvider.parse(parser));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
import org.jivesoftware.smackx.pubsub.ItemsExtension;
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ public class ItemsProvider extends EmbeddedExtensionProvider<ItemsExtension>
|
|||
{
|
||||
|
||||
@Override
|
||||
protected ItemsExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends PacketExtension> content)
|
||||
protected ItemsExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends ExtensionElement> content)
|
||||
{
|
||||
return new ItemsExtension(ItemsExtension.ItemsElementType.items, attributeMap.get("node"), content);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class PubSubProvider extends IQProvider<PubSub>
|
|||
int eventType = parser.next();
|
||||
switch (eventType) {
|
||||
case XmlPullParser.START_TAG:
|
||||
PacketParserUtils.addPacketExtension(pubsub, parser);
|
||||
PacketParserUtils.addExtensionElement(pubsub, parser);
|
||||
break;
|
||||
case XmlPullParser.END_TAG:
|
||||
if (parser.getDepth() == initialDepth) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
import org.jivesoftware.smackx.pubsub.RetractItem;
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ import org.jivesoftware.smackx.pubsub.RetractItem;
|
|||
public class RetractEventProvider extends EmbeddedExtensionProvider<RetractItem>
|
||||
{
|
||||
@Override
|
||||
protected RetractItem createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends PacketExtension> content)
|
||||
protected RetractItem createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends ExtensionElement> content)
|
||||
{
|
||||
return new RetractItem(attributeMap.get("id"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
import org.jivesoftware.smackx.pubsub.NodeExtension;
|
||||
import org.jivesoftware.smackx.pubsub.PubSubElementType;
|
||||
|
|
@ -33,7 +33,7 @@ import org.jivesoftware.smackx.pubsub.PubSubElementType;
|
|||
public class SimpleNodeProvider extends EmbeddedExtensionProvider<NodeExtension>
|
||||
{
|
||||
@Override
|
||||
protected NodeExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends PacketExtension> content)
|
||||
protected NodeExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends ExtensionElement> content)
|
||||
{
|
||||
return new NodeExtension(PubSubElementType.valueOfFromElemName(currentElement, currentNamespace), attributeMap.get("node"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.jivesoftware.smack.provider.PacketExtensionProvider;
|
||||
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
||||
import org.jivesoftware.smackx.pubsub.Subscription;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
|
@ -29,7 +29,7 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public class SubscriptionProvider extends PacketExtensionProvider<Subscription>
|
||||
public class SubscriptionProvider extends ExtensionElementProvider<Subscription>
|
||||
{
|
||||
@Override
|
||||
public Subscription parse(XmlPullParser parser, int initialDepth)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub.provider;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||
import org.jivesoftware.smackx.pubsub.Subscription;
|
||||
import org.jivesoftware.smackx.pubsub.SubscriptionsExtension;
|
||||
|
|
@ -34,7 +34,7 @@ public class SubscriptionsProvider extends EmbeddedExtensionProvider<Subscriptio
|
|||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected SubscriptionsExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends PacketExtension> content)
|
||||
protected SubscriptionsExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attributeMap, List<? extends ExtensionElement> content)
|
||||
{
|
||||
return new SubscriptionsExtension(attributeMap.get("node"), (List<Subscription>)content);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue