mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Rename and deprecate XMPPConnection methods
Rename and deprecate XMPPConnections methods as described in SMACK-802
This commit is contained in:
parent
72a2014572
commit
a70063dc89
15 changed files with 103 additions and 23 deletions
|
@ -840,8 +840,14 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
|||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void addPacketSendingListener(StanzaListener packetListener, StanzaFilter packetFilter) {
|
||||
addStanzaSendingListener(packetListener, packetFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addStanzaSendingListener(StanzaListener packetListener, StanzaFilter packetFilter) {
|
||||
if (packetListener == null) {
|
||||
throw new NullPointerException("Packet listener is null.");
|
||||
}
|
||||
|
@ -851,8 +857,14 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
|||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void removePacketSendingListener(StanzaListener packetListener) {
|
||||
removeStanzaSendingListener(packetListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeStanzaSendingListener(StanzaListener packetListener) {
|
||||
synchronized (sendListeners) {
|
||||
sendListeners.remove(packetListener);
|
||||
}
|
||||
|
@ -896,8 +908,15 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
|||
});
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void addPacketInterceptor(StanzaListener packetInterceptor,
|
||||
StanzaFilter packetFilter) {
|
||||
addStanzaInterceptor(packetInterceptor, packetFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addStanzaInterceptor(StanzaListener packetInterceptor,
|
||||
StanzaFilter packetFilter) {
|
||||
if (packetInterceptor == null) {
|
||||
throw new NullPointerException("Packet interceptor is null.");
|
||||
|
@ -908,8 +927,14 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
|||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public void removePacketInterceptor(StanzaListener packetInterceptor) {
|
||||
removeStanzaInterceptor(packetInterceptor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeStanzaInterceptor(StanzaListener packetInterceptor) {
|
||||
synchronized (interceptors) {
|
||||
interceptors.remove(packetInterceptor);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.jivesoftware.smack.packet.Stanza;
|
|||
* <p>
|
||||
* Additionally you are able to intercept Packets that are going to be send and
|
||||
* make modifications to them. You can register a PacketListener as interceptor
|
||||
* by using {@link XMPPConnection#addPacketInterceptor(StanzaListener,
|
||||
* by using {@link XMPPConnection#addStanzaInterceptor(StanzaListener,
|
||||
* org.jivesoftware.smack.filter.StanzaFilter)}
|
||||
* </p>
|
||||
*
|
||||
|
|
|
@ -319,7 +319,7 @@ public interface XMPPConnection {
|
|||
*
|
||||
* @param packetListener the stanza(/packet) listener to notify of new received packets.
|
||||
* @param packetFilter the stanza(/packet) filter to use.
|
||||
* @see #addPacketInterceptor(StanzaListener, StanzaFilter)
|
||||
* @see #addStanzaInterceptor(StanzaListener, StanzaFilter)
|
||||
* @since 4.1
|
||||
*/
|
||||
public void addSyncStanzaListener(StanzaListener packetListener, StanzaFilter packetFilter);
|
||||
|
@ -345,7 +345,7 @@ public interface XMPPConnection {
|
|||
*
|
||||
* @param packetListener the stanza(/packet) listener to notify of new received packets.
|
||||
* @param packetFilter the stanza(/packet) filter to use.
|
||||
* @see #addPacketInterceptor(StanzaListener, StanzaFilter)
|
||||
* @see #addStanzaInterceptor(StanzaListener, StanzaFilter)
|
||||
* @since 4.1
|
||||
*/
|
||||
public void addAsyncStanzaListener(StanzaListener packetListener, StanzaFilter packetFilter);
|
||||
|
@ -369,16 +369,42 @@ public interface XMPPConnection {
|
|||
*
|
||||
* @param packetListener the stanza(/packet) listener to notify of sent packets.
|
||||
* @param packetFilter the stanza(/packet) filter to use.
|
||||
* @deprecated use {@link #addStanzaSendingListener} instead
|
||||
*/
|
||||
// TODO Remove in Smack 4.4
|
||||
@Deprecated
|
||||
public void addPacketSendingListener(StanzaListener packetListener, StanzaFilter packetFilter);
|
||||
|
||||
/**
|
||||
* Registers a stanza(/packet) listener with this connection. The listener will be
|
||||
* notified of every stanza(/packet) that this connection sends. A stanza(/packet) filter determines
|
||||
* which packets will be delivered to the listener. Note that the thread
|
||||
* that writes packets will be used to invoke the listeners. Therefore, each
|
||||
* stanza(/packet) listener should complete all operations quickly or use a different
|
||||
* thread for processing.
|
||||
*
|
||||
* @param packetListener the stanza(/packet) listener to notify of sent packets.
|
||||
* @param packetFilter the stanza(/packet) filter to use.
|
||||
*/
|
||||
public void addStanzaSendingListener(StanzaListener packetListener, StanzaFilter packetFilter);
|
||||
|
||||
/**
|
||||
* Removes a stanza(/packet) listener for sending packets from this connection.
|
||||
*
|
||||
* @param packetListener the stanza(/packet) listener to remove.
|
||||
* @deprecated use {@link #removeStanzaSendingListener} instead
|
||||
*/
|
||||
// TODO Remove in Smack 4.4
|
||||
@Deprecated
|
||||
public void removePacketSendingListener(StanzaListener packetListener);
|
||||
|
||||
/**
|
||||
* Removes a stanza(/packet) listener for sending packets from this connection.
|
||||
*
|
||||
* @param packetListener the stanza(/packet) listener to remove.
|
||||
*/
|
||||
public void removeStanzaSendingListener(StanzaListener packetListener);
|
||||
|
||||
/**
|
||||
* Registers a stanza(/packet) interceptor with this connection. The interceptor will be
|
||||
* invoked every time a stanza(/packet) is about to be sent by this connection. Interceptors
|
||||
|
@ -387,18 +413,47 @@ public interface XMPPConnection {
|
|||
*
|
||||
* <p>
|
||||
* NOTE: For a similar functionality on incoming packets, see {@link #addAsyncStanzaListener(StanzaListener, StanzaFilter)}.
|
||||
* </p>
|
||||
*
|
||||
* @param packetInterceptor the stanza(/packet) interceptor to notify of packets about to be sent.
|
||||
* @param packetFilter the stanza(/packet) filter to use.
|
||||
* @deprecated use {@link #addStanzaInterceptor} instead
|
||||
*/
|
||||
// TODO Remove in Smack 4.4
|
||||
@Deprecated
|
||||
public void addPacketInterceptor(StanzaListener packetInterceptor, StanzaFilter packetFilter);
|
||||
|
||||
/**
|
||||
* Registers a stanza(/packet) interceptor with this connection. The interceptor will be
|
||||
* invoked every time a stanza(/packet) is about to be sent by this connection. Interceptors
|
||||
* may modify the stanza(/packet) to be sent. A stanza(/packet) filter determines which packets
|
||||
* will be delivered to the interceptor.
|
||||
*
|
||||
* <p>
|
||||
* NOTE: For a similar functionality on incoming packets, see {@link #addAsyncStanzaListener(StanzaListener, StanzaFilter)}.
|
||||
* </p>
|
||||
*
|
||||
* @param packetInterceptor the stanza(/packet) interceptor to notify of packets about to be sent.
|
||||
* @param packetFilter the stanza(/packet) filter to use.
|
||||
*/
|
||||
public void addPacketInterceptor(StanzaListener packetInterceptor, StanzaFilter packetFilter);
|
||||
public void addStanzaInterceptor(StanzaListener packetInterceptor, StanzaFilter packetFilter);
|
||||
|
||||
/**
|
||||
* Removes a stanza(/packet) interceptor.
|
||||
*
|
||||
* @param packetInterceptor the stanza(/packet) interceptor to remove.
|
||||
* @deprecated user {@link #removeStanzaInterceptor} instead
|
||||
*/
|
||||
// TODO Remove in Smack 4.4
|
||||
@Deprecated
|
||||
public void removePacketInterceptor(StanzaListener packetInterceptor);
|
||||
|
||||
/**
|
||||
* Removes a stanza(/packet) interceptor.
|
||||
*
|
||||
* @param packetInterceptor the stanza(/packet) interceptor to remove.
|
||||
*/
|
||||
public void removePacketInterceptor(StanzaListener packetInterceptor);
|
||||
public void removeStanzaInterceptor(StanzaListener packetInterceptor);
|
||||
|
||||
/**
|
||||
* Returns the current value of the reply timeout in milliseconds for request for this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue