mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-12 14:01:08 +01:00
Rename PacketListener to StanzaListener
and add the PacketListener as deprecated interface.
This commit is contained in:
parent
d4a6d8e653
commit
75ec271c6c
40 changed files with 305 additions and 279 deletions
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.bytestreams.ibb;
|
||||
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
import org.jivesoftware.smack.StanzaListener;
|
||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||
import org.jivesoftware.smack.filter.AndFilter;
|
||||
import org.jivesoftware.smack.filter.StanzaFilter;
|
||||
|
|
@ -38,7 +38,7 @@ import org.jivesoftware.smackx.bytestreams.ibb.packet.Data;
|
|||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
class DataListener implements PacketListener {
|
||||
class DataListener implements StanzaListener {
|
||||
|
||||
/* manager containing the listeners and the XMPP connection */
|
||||
private final InBandBytestreamManager manager;
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ public class InBandBytestreamManager implements BytestreamManager {
|
|||
|
||||
// register bytestream data packet listener
|
||||
this.dataListener = new DataListener(this);
|
||||
this.connection.addSyncPacketListener(this.dataListener, this.dataListener.getFilter());
|
||||
this.connection.addSyncStanzaListener(this.dataListener, this.dataListener.getFilter());
|
||||
|
||||
// register bytestream close packet listener
|
||||
this.closeListener = new CloseListener(this);
|
||||
|
|
@ -542,7 +542,7 @@ public class InBandBytestreamManager implements BytestreamManager {
|
|||
|
||||
// remove all listeners registered by this manager
|
||||
connection.unregisterIQRequestHandler(initiationListener);
|
||||
this.connection.removeSyncPacketListener(this.dataListener);
|
||||
this.connection.removeSyncStanzaListener(this.dataListener);
|
||||
connection.unregisterIQRequestHandler(closeListener);
|
||||
|
||||
// shutdown threads
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import java.util.concurrent.TimeUnit;
|
|||
|
||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
import org.jivesoftware.smack.StanzaListener;
|
||||
import org.jivesoftware.smack.filter.AndFilter;
|
||||
import org.jivesoftware.smack.filter.StanzaFilter;
|
||||
import org.jivesoftware.smack.filter.StanzaTypeFilter;
|
||||
|
|
@ -235,7 +235,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
private abstract class IBBInputStream extends InputStream {
|
||||
|
||||
/* the data packet listener to fill the data queue */
|
||||
private final PacketListener dataPacketListener;
|
||||
private final StanzaListener dataPacketListener;
|
||||
|
||||
/* queue containing received In-Band Bytestream data packets */
|
||||
protected final BlockingQueue<DataPacketExtension> dataQueue = new LinkedBlockingQueue<DataPacketExtension>();
|
||||
|
|
@ -264,7 +264,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
public IBBInputStream() {
|
||||
// add data packet listener to connection
|
||||
this.dataPacketListener = getDataPacketListener();
|
||||
connection.addSyncPacketListener(this.dataPacketListener, getDataPacketFilter());
|
||||
connection.addSyncStanzaListener(this.dataPacketListener, getDataPacketFilter());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -272,7 +272,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
*
|
||||
* @return the data packet listener
|
||||
*/
|
||||
protected abstract PacketListener getDataPacketListener();
|
||||
protected abstract StanzaListener getDataPacketListener();
|
||||
|
||||
/**
|
||||
* Returns the packet filter that accepts In-Band Bytestream data packets.
|
||||
|
|
@ -431,7 +431,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
* Invoked if the session is closed.
|
||||
*/
|
||||
private void cleanup() {
|
||||
connection.removeSyncPacketListener(this.dataPacketListener);
|
||||
connection.removeSyncStanzaListener(this.dataPacketListener);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -442,8 +442,8 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
*/
|
||||
private class IQIBBInputStream extends IBBInputStream {
|
||||
|
||||
protected PacketListener getDataPacketListener() {
|
||||
return new PacketListener() {
|
||||
protected StanzaListener getDataPacketListener() {
|
||||
return new StanzaListener() {
|
||||
|
||||
private long lastSequence = -1;
|
||||
|
||||
|
|
@ -505,8 +505,8 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
*/
|
||||
private class MessageIBBInputStream extends IBBInputStream {
|
||||
|
||||
protected PacketListener getDataPacketListener() {
|
||||
return new PacketListener() {
|
||||
protected StanzaListener getDataPacketListener() {
|
||||
return new StanzaListener() {
|
||||
|
||||
public void processPacket(Stanza packet) {
|
||||
// get data packet extension
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue