diff --git a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
index 8814179db..984f876a2 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
@@ -1476,12 +1476,14 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
streamFeatures.put(key, feature);
}
+ @SuppressWarnings("deprecation")
@Override
public void sendStanzaWithResponseCallback(Stanza stanza, StanzaFilter replyFilter,
StanzaListener callback) throws NotConnectedException, InterruptedException {
sendStanzaWithResponseCallback(stanza, replyFilter, callback, null);
}
+ @SuppressWarnings("deprecation")
@Override
public void sendStanzaWithResponseCallback(Stanza stanza, StanzaFilter replyFilter,
StanzaListener callback, ExceptionCallback exceptionCallback)
@@ -1571,7 +1573,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
return future;
}
- @SuppressWarnings("FutureReturnValueIgnored")
+ @SuppressWarnings({ "FutureReturnValueIgnored", "deprecation" })
@Override
public void sendStanzaWithResponseCallback(Stanza stanza, final StanzaFilter replyFilter,
final StanzaListener callback, final ExceptionCallback exceptionCallback,
@@ -1624,18 +1626,21 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
sendStanza(stanza);
}
+ @SuppressWarnings("deprecation")
@Override
public void sendIqWithResponseCallback(IQ iqRequest, StanzaListener callback)
throws NotConnectedException, InterruptedException {
sendIqWithResponseCallback(iqRequest, callback, null);
}
+ @SuppressWarnings("deprecation")
@Override
public void sendIqWithResponseCallback(IQ iqRequest, StanzaListener callback,
ExceptionCallback exceptionCallback) throws NotConnectedException, InterruptedException {
sendIqWithResponseCallback(iqRequest, callback, exceptionCallback, getReplyTimeout());
}
+ @SuppressWarnings("deprecation")
@Override
public void sendIqWithResponseCallback(IQ iqRequest, final StanzaListener callback,
final ExceptionCallback exceptionCallback, long timeout)
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/ExceptionCallback.java b/smack-core/src/main/java/org/jivesoftware/smack/ExceptionCallback.java
index cc1b98bdb..e13120c83 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/ExceptionCallback.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/ExceptionCallback.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright © 2014 Florian Schmaus
+ * Copyright © 2014-2017 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,12 @@
*/
package org.jivesoftware.smack;
+/**
+ * This interface has been deprecated. Please use org.jivesoftware.smack.util.ExceptionCallback instead.
+ *
+ * @deprecated use {@link org.jivesoftware.smack.util.ExceptionCallback} instead.
+ */
+@Deprecated
public interface ExceptionCallback {
public void processException(Exception exception);
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
index ce4c2f138..393d9fdae 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
@@ -428,7 +428,6 @@ public interface XMPPConnection {
*/
public boolean hasFeature(String element, String namespace);
-
/**
* Send an IQ request asynchronously. The connection's default reply timeout will be used.
*
@@ -447,7 +446,8 @@ public interface XMPPConnection {
public SmackFuturereplyFilter
.
@@ -517,10 +521,12 @@ public interface XMPPConnection {
* @param timeout the timeout in milliseconds to wait for a response
* @throws NotConnectedException
* @throws InterruptedException
+ * @deprecated use {@link #sendAsync(Stanza, StanzaFilter, long)} instead.
*/
- // TODO: Mark deprecated in favor of the new SmackFuture based async API.
+ @Deprecated
+ // TODO: Remove in Smack 4.4.
public void sendStanzaWithResponseCallback(Stanza stanza, StanzaFilter replyFilter,
- final StanzaListener callback, final ExceptionCallback exceptionCallback,
+ final StanzaListener callback, @SuppressWarnings("deprecation") final ExceptionCallback exceptionCallback,
long timeout) throws NotConnectedException, InterruptedException;
/**
@@ -532,8 +538,10 @@ public interface XMPPConnection {
* @param callback the callback invoked if there is result response (required)
* @throws NotConnectedException
* @throws InterruptedException
+ * @deprecated use {@link #sendIqRequestAsync(IQ)} instead.
*/
- // TODO: Mark deprecated in favor of the new SmackFuture based async API.
+ @Deprecated
+ // TODO: Remove in Smack 4.4.
public void sendIqWithResponseCallback(IQ iqRequest, StanzaListener callback) throws NotConnectedException, InterruptedException;
/**
@@ -549,10 +557,12 @@ public interface XMPPConnection {
* @param exceptionCallback the callback invoked if there is an Exception optional
* @throws NotConnectedException
* @throws InterruptedException
+ * @deprecated use {@link #sendIqRequestAsync(IQ)} instead.
*/
- // TODO: Mark deprecated in favor of the new SmackFuture based async API.
+ @Deprecated
+ // TODO: Remove in Smack 4.4.
public void sendIqWithResponseCallback(IQ iqRequest, StanzaListener callback,
- ExceptionCallback exceptionCallback) throws NotConnectedException, InterruptedException;
+ @SuppressWarnings("deprecation") ExceptionCallback exceptionCallback) throws NotConnectedException, InterruptedException;
/**
* Send a IQ stanza and invoke callback
if there is a result of
@@ -568,10 +578,12 @@ public interface XMPPConnection {
* @param timeout the timeout in milliseconds to wait for a response
* @throws NotConnectedException
* @throws InterruptedException
+ * @deprecated use {@link #sendIqRequestAsync(IQ, long)} instead.
*/
- // TODO: Mark deprecated in favor of the new SmackFuture based async API.
+ @Deprecated
+ // TODO: Remove in Smack 4.4.
public void sendIqWithResponseCallback(IQ iqRequest, final StanzaListener callback,
- final ExceptionCallback exceptionCallback, long timeout)
+ @SuppressWarnings("deprecation") final ExceptionCallback exceptionCallback, long timeout)
throws NotConnectedException, InterruptedException;
/**
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/CarbonManager.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/CarbonManager.java
index 83243add5..63fe10749 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/CarbonManager.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/CarbonManager.java
@@ -23,11 +23,11 @@ import java.util.concurrent.CopyOnWriteArraySet;
import org.jivesoftware.smack.AbstractConnectionListener;
import org.jivesoftware.smack.ConnectionCreationListener;
-import org.jivesoftware.smack.ExceptionCallback;
import org.jivesoftware.smack.Manager;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.SmackException.NoResponseException;
import org.jivesoftware.smack.SmackException.NotConnectedException;
+import org.jivesoftware.smack.SmackFuture;
import org.jivesoftware.smack.StanzaListener;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPConnectionRegistry;
@@ -42,6 +42,8 @@ import org.jivesoftware.smack.filter.StanzaTypeFilter;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Stanza;
+import org.jivesoftware.smack.util.ExceptionCallback;
+import org.jivesoftware.smack.util.SuccessCallback;
import org.jivesoftware.smackx.carbons.packet.Carbon;
import org.jivesoftware.smackx.carbons.packet.CarbonExtension;
@@ -245,10 +247,9 @@ public final class CarbonManager extends Manager {
*