mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-13 04:09:41 +02:00
Renamed Connection to XMPPConnection
This commit is contained in:
parent
f3e007bad5
commit
489816c61f
145 changed files with 639 additions and 641 deletions
|
@ -167,7 +167,7 @@ public class MessageTest extends SmackTestCase {
|
|||
// Send the first message
|
||||
getConnection(0).sendPacket(msg);
|
||||
// Check that the connection that sent the message is still connected
|
||||
assertTrue("Connection was closed", getConnection(0).isConnected());
|
||||
assertTrue("XMPPConnection was closed", getConnection(0).isConnected());
|
||||
// Check that the message was received
|
||||
Message rcv = (Message) collector.nextResult(1000);
|
||||
assertNotNull("No Message was received", rcv);
|
||||
|
@ -175,7 +175,7 @@ public class MessageTest extends SmackTestCase {
|
|||
// Send the second message
|
||||
getConnection(0).sendPacket(msg);
|
||||
// Check that the connection that sent the message is still connected
|
||||
assertTrue("Connection was closed", getConnection(0).isConnected());
|
||||
assertTrue("XMPPConnection was closed", getConnection(0).isConnected());
|
||||
// Check that the second message was received
|
||||
rcv = (Message) collector.nextResult(1000);
|
||||
assertNotNull("No Message was received", rcv);
|
||||
|
|
|
@ -35,8 +35,8 @@ public class PresenceTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Connection(0) will send messages to the bareJID of Connection(1) where the user of
|
||||
* Connection(1) has logged from two different places with different presence priorities.
|
||||
* XMPPConnection(0) will send messages to the bareJID of XMPPConnection(1) where the user of
|
||||
* XMPPConnection(1) has logged from two different places with different presence priorities.
|
||||
*/
|
||||
public void testMessageToHighestPriority() {
|
||||
TCPConnection conn = null;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.jivesoftware.smack.util;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.Roster;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
|
||||
|
@ -8,7 +8,7 @@ public class ConnectionUtils {
|
|||
|
||||
private ConnectionUtils() {}
|
||||
|
||||
public static void becomeFriends(Connection con0, Connection con1) throws XMPPException {
|
||||
public static void becomeFriends(XMPPConnection con0, XMPPConnection con1) throws XMPPException {
|
||||
Roster r0 = con0.getRoster();
|
||||
Roster r1 = con1.getRoster();
|
||||
r0.setSubscriptionMode(Roster.SubscriptionMode.accept_all);
|
||||
|
@ -17,9 +17,9 @@ public class ConnectionUtils {
|
|||
r1.createEntry(con0.getUser(), "u1", null);
|
||||
}
|
||||
|
||||
public static void letsAllBeFriends(Connection[] connections) throws XMPPException {
|
||||
for (Connection c1 : connections) {
|
||||
for (Connection c2 : connections) {
|
||||
public static void letsAllBeFriends(XMPPConnection[] connections) throws XMPPException {
|
||||
for (XMPPConnection c1 : connections) {
|
||||
for (XMPPConnection c2 : connections) {
|
||||
if (c1 == c2)
|
||||
continue;
|
||||
becomeFriends(c1, c2);
|
||||
|
|
|
@ -31,13 +31,13 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||
/**
|
||||
* Allows creation and management of accounts on an XMPP server.
|
||||
*
|
||||
* @see Connection#getAccountManager()
|
||||
* @see XMPPConnection#getAccountManager()
|
||||
* @author Matt Tucker
|
||||
*/
|
||||
public class AccountManager {
|
||||
private static final Logger LOGGER = Logger.getLogger(AccountManager.class.getName());
|
||||
|
||||
private Connection connection;
|
||||
private XMPPConnection connection;
|
||||
private Registration info = null;
|
||||
|
||||
/**
|
||||
|
@ -53,7 +53,7 @@ public class AccountManager {
|
|||
*
|
||||
* @param connection a connection to a XMPP server.
|
||||
*/
|
||||
public AccountManager(Connection connection) {
|
||||
public AccountManager(XMPPConnection connection) {
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ public class Chat {
|
|||
/**
|
||||
* Delivers a message directly to this chat, which will add the message
|
||||
* to the collector and deliver it to all listeners registered with the
|
||||
* Chat. This is used by the Connection class to deliver messages
|
||||
* Chat. This is used by the XMPPConnection class to deliver messages
|
||||
* without a thread ID.
|
||||
*
|
||||
* @param message the message.
|
||||
|
|
|
@ -108,9 +108,9 @@ public class ChatManager {
|
|||
private Map<PacketInterceptor, PacketFilter> interceptors
|
||||
= new WeakHashMap<PacketInterceptor, PacketFilter>();
|
||||
|
||||
private Connection connection;
|
||||
private XMPPConnection connection;
|
||||
|
||||
ChatManager(Connection connection) {
|
||||
ChatManager(XMPPConnection connection) {
|
||||
this.connection = connection;
|
||||
|
||||
PacketFilter filter = new PacketFilter() {
|
||||
|
|
|
@ -63,7 +63,7 @@ public class ConnectionConfiguration implements Cloneable {
|
|||
*/
|
||||
private CallbackHandler callbackHandler;
|
||||
|
||||
private boolean debuggerEnabled = Connection.DEBUG_ENABLED;
|
||||
private boolean debuggerEnabled = XMPPConnection.DEBUG_ENABLED;
|
||||
|
||||
// Flag that indicates if a reconnection should be attempted when abruptly disconnected
|
||||
private boolean reconnectionAllowed = true;
|
||||
|
@ -368,7 +368,7 @@ public class ConnectionConfiguration implements Cloneable {
|
|||
|
||||
/**
|
||||
* Returns true if the new connection about to be establish is going to be debugged. By
|
||||
* default the value of {@link Connection#DEBUG_ENABLED} is used.
|
||||
* default the value of {@link XMPPConnection#DEBUG_ENABLED} is used.
|
||||
*
|
||||
* @return true if the new connection about to be establish is going to be debugged.
|
||||
*/
|
||||
|
@ -378,7 +378,7 @@ public class ConnectionConfiguration implements Cloneable {
|
|||
|
||||
/**
|
||||
* Sets if the new connection about to be establish is going to be debugged. By
|
||||
* default the value of {@link Connection#DEBUG_ENABLED} is used.
|
||||
* default the value of {@link XMPPConnection#DEBUG_ENABLED} is used.
|
||||
*
|
||||
* @param debuggerEnabled if the new connection about to be establish is going to be debugged.
|
||||
*/
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
package org.jivesoftware.smack;
|
||||
|
||||
/**
|
||||
* Implementors of this interface will be notified when a new {@link Connection}
|
||||
* Implementors of this interface will be notified when a new {@link XMPPConnection}
|
||||
* has been created. The newly created connection will not be actually connected to
|
||||
* the server. Use {@link Connection#addConnectionCreationListener(ConnectionCreationListener)}
|
||||
* the server. Use {@link XMPPConnection#addConnectionCreationListener(ConnectionCreationListener)}
|
||||
* to add new listeners.
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
|
@ -33,6 +33,6 @@ public interface ConnectionCreationListener {
|
|||
*
|
||||
* @param connection the newly created connection.
|
||||
*/
|
||||
public void connectionCreated(Connection connection);
|
||||
public void connectionCreated(XMPPConnection connection);
|
||||
|
||||
}
|
||||
|
|
|
@ -19,10 +19,10 @@ package org.jivesoftware.smack;
|
|||
|
||||
/**
|
||||
* Interface that allows for implementing classes to listen for connection closing
|
||||
* and reconnection events. Listeners are registered with Connection objects.
|
||||
* and reconnection events. Listeners are registered with XMPPConnection objects.
|
||||
*
|
||||
* @see Connection#addConnectionListener
|
||||
* @see Connection#removeConnectionListener
|
||||
* @see XMPPConnection#addConnectionListener
|
||||
* @see XMPPConnection#removeConnectionListener
|
||||
*
|
||||
* @author Matt Tucker
|
||||
*/
|
||||
|
|
|
@ -20,13 +20,13 @@ import java.lang.ref.WeakReference;
|
|||
|
||||
public abstract class Manager {
|
||||
|
||||
final WeakReference<Connection> weakConnection;
|
||||
final WeakReference<XMPPConnection> weakConnection;
|
||||
|
||||
public Manager(Connection connection) {
|
||||
weakConnection = new WeakReference<Connection>(connection);
|
||||
public Manager(XMPPConnection connection) {
|
||||
weakConnection = new WeakReference<XMPPConnection>(connection);
|
||||
}
|
||||
|
||||
protected final Connection connection() {
|
||||
protected final XMPPConnection connection() {
|
||||
return weakConnection.get();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,14 +35,14 @@ import org.jivesoftware.smack.packet.XMPPError;
|
|||
* older packets are automatically dropped. The default number is retrieved by
|
||||
* {@link SmackConfiguration#getPacketCollectorSize()}.
|
||||
*
|
||||
* @see Connection#createPacketCollector(PacketFilter)
|
||||
* @see XMPPConnection#createPacketCollector(PacketFilter)
|
||||
* @author Matt Tucker
|
||||
*/
|
||||
public class PacketCollector {
|
||||
|
||||
private PacketFilter packetFilter;
|
||||
private ArrayBlockingQueue<Packet> resultQueue;
|
||||
private Connection connection;
|
||||
private XMPPConnection connection;
|
||||
private boolean cancelled = false;
|
||||
|
||||
/**
|
||||
|
@ -52,7 +52,7 @@ public class PacketCollector {
|
|||
* @param connection the connection the collector is tied to.
|
||||
* @param packetFilter determines which packets will be returned by this collector.
|
||||
*/
|
||||
protected PacketCollector(Connection connection, PacketFilter packetFilter) {
|
||||
protected PacketCollector(XMPPConnection connection, PacketFilter packetFilter) {
|
||||
this(connection, packetFilter, SmackConfiguration.getPacketCollectorSize());
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class PacketCollector {
|
|||
* @param packetFilter determines which packets will be returned by this collector.
|
||||
* @param maxSize the maximum number of packets that will be stored in the collector.
|
||||
*/
|
||||
protected PacketCollector(Connection connection, PacketFilter packetFilter, int maxSize) {
|
||||
protected PacketCollector(XMPPConnection connection, PacketFilter packetFilter, int maxSize) {
|
||||
this.connection = connection;
|
||||
this.packetFilter = packetFilter;
|
||||
this.resultQueue = new ArrayBlockingQueue<Packet>(maxSize);
|
||||
|
|
|
@ -21,14 +21,14 @@ import org.jivesoftware.smack.packet.Packet;
|
|||
|
||||
/**
|
||||
* Provides a mechanism to intercept and modify packets that are going to be
|
||||
* sent to the server. PacketInterceptors are added to the {@link Connection}
|
||||
* sent to the server. PacketInterceptors are added to the {@link XMPPConnection}
|
||||
* together with a {@link org.jivesoftware.smack.filter.PacketFilter} so that only
|
||||
* certain packets are intercepted and processed by the interceptor.<p>
|
||||
*
|
||||
* This allows event-style programming -- every time a new packet is found,
|
||||
* the {@link #interceptPacket(Packet)} method will be called.
|
||||
*
|
||||
* @see Connection#addPacketInterceptor(PacketInterceptor, org.jivesoftware.smack.filter.PacketFilter)
|
||||
* @see XMPPConnection#addPacketInterceptor(PacketInterceptor, org.jivesoftware.smack.filter.PacketFilter)
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
public interface PacketInterceptor {
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.jivesoftware.smack.packet.Packet;
|
|||
* opposite approach to the functionality provided by a {@link PacketCollector}
|
||||
* which lets you block while waiting for results.
|
||||
*
|
||||
* @see Connection#addPacketListener(PacketListener, org.jivesoftware.smack.filter.PacketFilter)
|
||||
* @see XMPPConnection#addPacketListener(PacketListener, org.jivesoftware.smack.filter.PacketFilter)
|
||||
* @author Matt Tucker
|
||||
*/
|
||||
public interface PacketListener {
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ReconnectionManager implements ConnectionListener {
|
|||
private static final Logger LOGGER = Logger.getLogger(ReconnectionManager.class.getName());
|
||||
|
||||
// Holds the connection to the server
|
||||
private Connection connection;
|
||||
private XMPPConnection connection;
|
||||
private Thread reconnectionThread;
|
||||
private int randomBase = new Random().nextInt(11) + 5; // between 5 and 15 seconds
|
||||
|
||||
|
@ -48,14 +48,14 @@ public class ReconnectionManager implements ConnectionListener {
|
|||
// Create a new PrivacyListManager on every established connection. In the init()
|
||||
// method of PrivacyListManager, we'll add a listener that will delete the
|
||||
// instance when the connection is closed.
|
||||
Connection.addConnectionCreationListener(new ConnectionCreationListener() {
|
||||
public void connectionCreated(Connection connection) {
|
||||
XMPPConnection.addConnectionCreationListener(new ConnectionCreationListener() {
|
||||
public void connectionCreated(XMPPConnection connection) {
|
||||
connection.addConnectionListener(new ReconnectionManager(connection));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private ReconnectionManager(Connection connection) {
|
||||
private ReconnectionManager(XMPPConnection connection) {
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ public class ReconnectionManager implements ConnectionListener {
|
|||
*/
|
||||
public void run() {
|
||||
// The process will try to reconnect until the connection is established or
|
||||
// the user cancel the reconnection process {@link Connection#disconnect()}
|
||||
// the user cancel the reconnection process {@link XMPPConnection#disconnect()}
|
||||
while (ReconnectionManager.this.isReconnectionAllowed()) {
|
||||
// Find how much time we should wait until the next reconnection
|
||||
int remainingSeconds = timeDelay();
|
||||
|
@ -173,7 +173,7 @@ public class ReconnectionManager implements ConnectionListener {
|
|||
}
|
||||
|
||||
/**
|
||||
* Fires listeners when The Connection will retry a reconnection. Expressed in seconds.
|
||||
* Fires listeners when The XMPPConnection will retry a reconnection. Expressed in seconds.
|
||||
*
|
||||
* @param seconds the number of seconds that a reconnection will be attempted in.
|
||||
*/
|
||||
|
|
|
@ -52,7 +52,7 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||
* </ul>
|
||||
*
|
||||
* @author Matt Tucker
|
||||
* @see Connection#getRoster()
|
||||
* @see XMPPConnection#getRoster()
|
||||
*/
|
||||
public class Roster {
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class Roster {
|
|||
*/
|
||||
private static SubscriptionMode defaultSubscriptionMode = SubscriptionMode.accept_all;
|
||||
|
||||
private final Connection connection;
|
||||
private final XMPPConnection connection;
|
||||
private final RosterStore rosterStore;
|
||||
private final Map<String, RosterGroup> groups;
|
||||
private final Map<String,RosterEntry> entries;
|
||||
|
@ -105,7 +105,7 @@ public class Roster {
|
|||
*
|
||||
* @param connection an XMPP connection.
|
||||
*/
|
||||
Roster(final Connection connection) {
|
||||
Roster(final XMPPConnection connection) {
|
||||
this.connection = connection;
|
||||
rosterStore = connection.getConfiguration().getRosterStore();
|
||||
groups = new ConcurrentHashMap<String, RosterGroup>();
|
||||
|
@ -138,9 +138,9 @@ public class Roster {
|
|||
|
||||
// if not connected add listener after successful login
|
||||
if(!this.connection.isConnected()) {
|
||||
Connection.addConnectionCreationListener(new ConnectionCreationListener() {
|
||||
XMPPConnection.addConnectionCreationListener(new ConnectionCreationListener() {
|
||||
|
||||
public void connectionCreated(Connection connection) {
|
||||
public void connectionCreated(XMPPConnection connection) {
|
||||
if(connection.equals(Roster.this.connection)) {
|
||||
Roster.this.connection.addConnectionListener(connectionListener);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public class RosterEntry {
|
|||
private RosterPacket.ItemType type;
|
||||
private RosterPacket.ItemStatus status;
|
||||
final private Roster roster;
|
||||
final private Connection connection;
|
||||
final private XMPPConnection connection;
|
||||
|
||||
/**
|
||||
* Creates a new roster entry.
|
||||
|
@ -47,7 +47,7 @@ public class RosterEntry {
|
|||
* @param connection a connection to the XMPP server.
|
||||
*/
|
||||
RosterEntry(String user, String name, RosterPacket.ItemType type,
|
||||
RosterPacket.ItemStatus status, Roster roster, Connection connection) {
|
||||
RosterPacket.ItemStatus status, Roster roster, XMPPConnection connection) {
|
||||
this.user = user;
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||
public class RosterGroup {
|
||||
|
||||
private String name;
|
||||
private Connection connection;
|
||||
private XMPPConnection connection;
|
||||
private final Set<RosterEntry> entries;
|
||||
|
||||
/**
|
||||
|
@ -45,7 +45,7 @@ public class RosterGroup {
|
|||
* @param name the name of the group.
|
||||
* @param connection the connection the group belongs to.
|
||||
*/
|
||||
RosterGroup(String name, Connection connection) {
|
||||
RosterGroup(String name, XMPPConnection connection) {
|
||||
this.name = name;
|
||||
this.connection = connection;
|
||||
entries = new LinkedHashSet<RosterEntry>();
|
||||
|
|
|
@ -61,7 +61,7 @@ public class SASLAuthentication {
|
|||
private static Map<String, Class<? extends SASLMechanism>> implementedMechanisms = new HashMap<String, Class<? extends SASLMechanism>>();
|
||||
private static List<String> mechanismsPreferences = new ArrayList<String>();
|
||||
|
||||
private Connection connection;
|
||||
private XMPPConnection connection;
|
||||
private Collection<String> serverMechanisms = new ArrayList<String>();
|
||||
private SASLMechanism currentMechanism = null;
|
||||
/**
|
||||
|
@ -170,7 +170,7 @@ public class SASLAuthentication {
|
|||
return answer;
|
||||
}
|
||||
|
||||
SASLAuthentication(Connection connection) {
|
||||
SASLAuthentication(XMPPConnection connection) {
|
||||
super();
|
||||
this.connection = connection;
|
||||
this.init();
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jivesoftware.smack;
|
||||
|
||||
import java.io.Reader;
|
||||
|
@ -47,7 +46,7 @@ import org.jivesoftware.smack.packet.Packet;
|
|||
import org.jivesoftware.smack.packet.Presence;
|
||||
|
||||
/**
|
||||
* The abstract Connection class provides an interface for connections to a
|
||||
* The abstract XMPPConnection class provides an interface for connections to a
|
||||
* XMPP server and implements shared methods which are used by the
|
||||
* different types of connections (e.g. TCPConnection or BoshConnection).
|
||||
*
|
||||
|
@ -55,7 +54,7 @@ import org.jivesoftware.smack.packet.Presence;
|
|||
* look like the following:
|
||||
* <pre>
|
||||
* // Create a connection to the igniterealtime.org XMPP server.
|
||||
* Connection con = new TCPConnection("igniterealtime.org");
|
||||
* XMPPConnection con = new TCPConnection("igniterealtime.org");
|
||||
* // Connect to the server
|
||||
* con.connect();
|
||||
* // Most servers require you to login before performing other tasks.
|
||||
|
@ -77,16 +76,15 @@ import org.jivesoftware.smack.packet.Presence;
|
|||
* may be connected, disconnected and then connected again. Listeners of the Connection
|
||||
* will be retained accross connections.<p>
|
||||
* <p/>
|
||||
* If a connected Connection gets disconnected abruptly then it will try to reconnect
|
||||
* If a connected XMPPConnection gets disconnected abruptly then it will try to reconnect
|
||||
* again. To stop the reconnection process, use {@link #disconnect()}. Once stopped
|
||||
* you can use {@link #connect()} to manually connect to the server.
|
||||
*
|
||||
* @see TCPConnection
|
||||
* @author Matt Tucker
|
||||
* @author Guenther Niess
|
||||
*/
|
||||
public abstract class Connection {
|
||||
private static final Logger LOGGER = Logger.getLogger(Connection.class.getName());
|
||||
public abstract class XMPPConnection {
|
||||
private static final Logger LOGGER = Logger.getLogger(XMPPConnection.class.getName());
|
||||
|
||||
/**
|
||||
* Counter to uniquely identify connections that are created.
|
||||
|
@ -230,11 +228,11 @@ public abstract class Connection {
|
|||
private final ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(2);
|
||||
|
||||
/**
|
||||
* Create a new Connection to a XMPP server.
|
||||
* Create a new XMPPConnection to a XMPP server.
|
||||
*
|
||||
* @param configuration The configuration which is used to establish the connection.
|
||||
*/
|
||||
protected Connection(ConnectionConfiguration configuration) {
|
||||
protected XMPPConnection(ConnectionConfiguration configuration) {
|
||||
config = configuration;
|
||||
}
|
||||
|
||||
|
@ -482,7 +480,7 @@ public abstract class Connection {
|
|||
|
||||
/**
|
||||
* Closes the connection by setting presence to unavailable then closing the connection to
|
||||
* the XMPP server. The Connection can still be used for connecting to the server
|
||||
* the XMPP server. The XMPPConnection can still be used for connecting to the server
|
||||
* again.<p>
|
||||
* <p/>
|
||||
* This method cleans up all resources used by the connection. Therefore, the roster,
|
||||
|
@ -497,7 +495,7 @@ public abstract class Connection {
|
|||
|
||||
/**
|
||||
* Closes the connection. A custom unavailable presence is sent to the server, followed
|
||||
* by closing the stream. The Connection can still be used for connecting to the server
|
||||
* by closing the stream. The XMPPConnection can still be used for connecting to the server
|
||||
* again. A custom unavilable presence is useful for communicating offline presence
|
||||
* information such as "On vacation". Typically, just the status text of the presence
|
||||
* packet is set with online information, but most XMPP servers will deliver the full
|
||||
|
@ -822,7 +820,7 @@ public abstract class Connection {
|
|||
// option
|
||||
try {
|
||||
Constructor<?> constructor = debuggerClass
|
||||
.getConstructor(Connection.class, Writer.class, Reader.class);
|
||||
.getConstructor(XMPPConnection.class, Writer.class, Reader.class);
|
||||
debugger = (SmackDebugger) constructor.newInstance(this, writer, reader);
|
||||
reader = debugger.getReader();
|
||||
writer = debugger.getWriter();
|
||||
|
@ -842,7 +840,7 @@ public abstract class Connection {
|
|||
/**
|
||||
* Set the servers Entity Caps node
|
||||
*
|
||||
* Connection holds this information in order to avoid a dependency to
|
||||
* XMPPConnection holds this information in order to avoid a dependency to
|
||||
* smackx where EntityCapsManager lives from smack.
|
||||
*
|
||||
* @param node
|
||||
|
@ -854,7 +852,7 @@ public abstract class Connection {
|
|||
/**
|
||||
* Retrieve the servers Entity Caps node
|
||||
*
|
||||
* Connection holds this information in order to avoid a dependency to
|
||||
* XMPPConnection holds this information in order to avoid a dependency to
|
||||
* smackx where EntityCapsManager lives from smack.
|
||||
*
|
||||
* @return
|
|
@ -18,7 +18,7 @@ package org.jivesoftware.smack.debugger;
|
|||
|
||||
import org.jivesoftware.smack.ConnectionListener;
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.packet.Packet;
|
||||
import org.jivesoftware.smack.util.*;
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class ConsoleDebugger implements SmackDebugger {
|
|||
public static boolean printInterpreted = false;
|
||||
private SimpleDateFormat dateFormatter = new SimpleDateFormat("hh:mm:ss aaa");
|
||||
|
||||
private Connection connection = null;
|
||||
private XMPPConnection connection = null;
|
||||
|
||||
private PacketListener listener = null;
|
||||
private ConnectionListener connListener = null;
|
||||
|
@ -53,7 +53,7 @@ public class ConsoleDebugger implements SmackDebugger {
|
|||
private ReaderListener readerListener;
|
||||
private WriterListener writerListener;
|
||||
|
||||
public ConsoleDebugger(Connection connection, Writer writer, Reader reader) {
|
||||
public ConsoleDebugger(XMPPConnection connection, Writer writer, Reader reader) {
|
||||
this.connection = connection;
|
||||
this.writer = writer;
|
||||
this.reader = reader;
|
||||
|
@ -111,7 +111,7 @@ public class ConsoleDebugger implements SmackDebugger {
|
|||
connListener = new ConnectionListener() {
|
||||
public void connectionClosed() {
|
||||
System.out.println(
|
||||
dateFormatter.format(new Date()) + " Connection closed (" +
|
||||
dateFormatter.format(new Date()) + " XMPPConnection closed (" +
|
||||
connection.hashCode() +
|
||||
")");
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ public class ConsoleDebugger implements SmackDebugger {
|
|||
public void connectionClosedOnError(Exception e) {
|
||||
System.out.println(
|
||||
dateFormatter.format(new Date()) +
|
||||
" Connection closed due to an exception (" +
|
||||
" XMPPConnection closed due to an exception (" +
|
||||
connection.hashCode() +
|
||||
")");
|
||||
e.printStackTrace();
|
||||
|
@ -134,13 +134,13 @@ public class ConsoleDebugger implements SmackDebugger {
|
|||
}
|
||||
public void reconnectionSuccessful() {
|
||||
System.out.println(
|
||||
dateFormatter.format(new Date()) + " Connection reconnected (" +
|
||||
dateFormatter.format(new Date()) + " XMPPConnection reconnected (" +
|
||||
connection.hashCode() +
|
||||
")");
|
||||
}
|
||||
public void reconnectingIn(int seconds) {
|
||||
System.out.println(
|
||||
dateFormatter.format(new Date()) + " Connection (" +
|
||||
dateFormatter.format(new Date()) + " XMPPConnection (" +
|
||||
connection.hashCode() +
|
||||
") will reconnect in " + seconds);
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public class LiteDebugger implements SmackDebugger {
|
|||
private static final String NEWLINE = "\n";
|
||||
|
||||
private JFrame frame = null;
|
||||
private Connection connection = null;
|
||||
private XMPPConnection connection = null;
|
||||
|
||||
private PacketListener listener = null;
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class LiteDebugger implements SmackDebugger {
|
|||
private ReaderListener readerListener;
|
||||
private WriterListener writerListener;
|
||||
|
||||
public LiteDebugger(Connection connection, Writer writer, Reader reader) {
|
||||
public LiteDebugger(XMPPConnection connection, Writer writer, Reader reader) {
|
||||
this.connection = connection;
|
||||
this.writer = writer;
|
||||
this.reader = reader;
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.jivesoftware.smack.*;
|
|||
* displays XML traffic.<p>
|
||||
*
|
||||
* Every implementation of this interface <b>must</b> have a public constructor with the following
|
||||
* arguments: Connection, Writer, Reader.
|
||||
* arguments: XMPPConnection, Writer, Reader.
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smack.filter;
|
|||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.Packet;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
|
@ -78,7 +78,7 @@ public class IQReplyFilter implements PacketFilter {
|
|||
*
|
||||
* @param iqPacket An IQ request. Filter for replies to this packet.
|
||||
*/
|
||||
public IQReplyFilter(IQ iqPacket, Connection conn) {
|
||||
public IQReplyFilter(IQ iqPacket, XMPPConnection conn) {
|
||||
to = iqPacket.getTo();
|
||||
if (conn.getUser() == null) {
|
||||
// We have not yet been assigned a username, this can happen if the connection is
|
||||
|
|
|
@ -279,7 +279,7 @@ public class Socks5ProxySocketFactory
|
|||
o X'02' connection not allowed by ruleset
|
||||
o X'03' Network unreachable
|
||||
o X'04' Host unreachable
|
||||
o X'05' Connection refused
|
||||
o X'05' XMPPConnection refused
|
||||
o X'06' TTL expired
|
||||
o X'07' Command not supported
|
||||
o X'08' Address type not supported
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.util.Map;
|
|||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.packet.Bind;
|
||||
import org.jivesoftware.smack.packet.DefaultPacketExtension;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
@ -281,7 +281,7 @@ public class PacketParserUtils {
|
|||
* @return an IQ object.
|
||||
* @throws Exception if an exception occurs while parsing the packet.
|
||||
*/
|
||||
public static IQ parseIQ(XmlPullParser parser, Connection connection) throws Exception {
|
||||
public static IQ parseIQ(XmlPullParser parser, XMPPConnection connection) throws Exception {
|
||||
IQ iqPacket = null;
|
||||
|
||||
String id = parser.getAttributeValue("", "id");
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.concurrent.BlockingQueue;
|
|||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.ConnectionConfiguration;
|
||||
import org.jivesoftware.smack.ConnectionCreationListener;
|
||||
import org.jivesoftware.smack.ConnectionListener;
|
||||
|
@ -34,7 +34,7 @@ import org.jivesoftware.smack.packet.Packet;
|
|||
import org.jivesoftware.smack.packet.Presence;
|
||||
|
||||
/**
|
||||
* A dummy implementation of {@link Connection}, intended to be used during
|
||||
* A dummy implementation of {@link XMPPConnection}, intended to be used during
|
||||
* unit tests.
|
||||
*
|
||||
* Instances store any packets that are delivered to be send using the
|
||||
|
@ -49,7 +49,7 @@ import org.jivesoftware.smack.packet.Presence;
|
|||
* @see Connection
|
||||
* @author Guenther Niess
|
||||
*/
|
||||
public class DummyConnection extends Connection {
|
||||
public class DummyConnection extends XMPPConnection {
|
||||
|
||||
private boolean authenticated = false;
|
||||
private boolean anonymous = false;
|
||||
|
|
|
@ -187,7 +187,7 @@ public class PacketCollectorTest
|
|||
|
||||
class TestPacketCollector extends PacketCollector
|
||||
{
|
||||
protected TestPacketCollector(Connection conection, PacketFilter packetFilter, int size)
|
||||
protected TestPacketCollector(XMPPConnection conection, PacketFilter packetFilter, int size)
|
||||
{
|
||||
super(conection, packetFilter, size);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public class RosterTest {
|
|||
@Before
|
||||
public void setUp() throws Exception {
|
||||
// Uncomment this to enable debug output
|
||||
//Connection.DEBUG_ENABLED = true;
|
||||
//XMPPConnection.DEBUG_ENABLED = true;
|
||||
|
||||
connection = new DummyConnection();
|
||||
connection.connect();
|
||||
|
@ -702,7 +702,7 @@ public class RosterTest {
|
|||
|
||||
public synchronized void entriesAdded(Collection<String> addresses) {
|
||||
addressesAdded.addAll(addresses);
|
||||
if (Connection.DEBUG_ENABLED) {
|
||||
if (XMPPConnection.DEBUG_ENABLED) {
|
||||
for (String address : addresses) {
|
||||
System.out.println("Roster entry for " + address + " added.");
|
||||
}
|
||||
|
@ -711,7 +711,7 @@ public class RosterTest {
|
|||
|
||||
public synchronized void entriesDeleted(Collection<String> addresses) {
|
||||
addressesDeleted.addAll(addresses);
|
||||
if (Connection.DEBUG_ENABLED) {
|
||||
if (XMPPConnection.DEBUG_ENABLED) {
|
||||
for (String address : addresses) {
|
||||
System.out.println("Roster entry for " + address + " deleted.");
|
||||
}
|
||||
|
@ -720,7 +720,7 @@ public class RosterTest {
|
|||
|
||||
public synchronized void entriesUpdated(Collection<String> addresses) {
|
||||
addressesUpdated.addAll(addresses);
|
||||
if (Connection.DEBUG_ENABLED) {
|
||||
if (XMPPConnection.DEBUG_ENABLED) {
|
||||
for (String address : addresses) {
|
||||
System.out.println("Roster entry for " + address + " updated.");
|
||||
}
|
||||
|
@ -728,7 +728,7 @@ public class RosterTest {
|
|||
}
|
||||
|
||||
public void presenceChanged(Presence presence) {
|
||||
if (Connection.DEBUG_ENABLED) {
|
||||
if (XMPPConnection.DEBUG_ENABLED) {
|
||||
System.out.println("Roster presence changed: " + presence.toXML());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public class RosterVersioningTest {
|
|||
@Before
|
||||
public void setUp() throws Exception {
|
||||
// Uncomment this to enable debug output
|
||||
//Connection.DEBUG_ENABLED = true;
|
||||
//XMPPConnection.DEBUG_ENABLED = true;
|
||||
|
||||
DefaultRosterStore store = DefaultRosterStore.init(tmpFolder.newFolder("store"));
|
||||
populateStore(store);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue