mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
SMACK-279: The XMPPConnection extends the new abstract Connection class
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@11613 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
11a41e79ca
commit
127319a821
102 changed files with 1420 additions and 1194 deletions
|
@ -47,8 +47,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
* An AdHocCommandManager is responsible for keeping the list of available
|
||||
* commands offered by a service and for processing commands requests.
|
||||
*
|
||||
* Pass in an XMPPConnection isntance to
|
||||
* {@link #getAddHocCommandsManager(org.jivesoftware.smack.XMPPConnection)} in order to
|
||||
* Pass in a Connection instance to
|
||||
* {@link #getAddHocCommandsManager(org.jivesoftware.smack.Connection)} in order to
|
||||
* get an instance of this class.
|
||||
*
|
||||
* @author Gabriel Guardincerri
|
||||
|
@ -65,11 +65,11 @@ public class AdHocCommandManager {
|
|||
private static final int SESSION_TIMEOUT = 2 * 60;
|
||||
|
||||
/**
|
||||
* Map a XMPPConnection with it AdHocCommandManager. This map have a key-value
|
||||
* Map a Connection with it AdHocCommandManager. This map have a key-value
|
||||
* pair for every active connection.
|
||||
*/
|
||||
private static Map<XMPPConnection, AdHocCommandManager> instances =
|
||||
new ConcurrentHashMap<XMPPConnection, AdHocCommandManager>();
|
||||
private static Map<Connection, AdHocCommandManager> instances =
|
||||
new ConcurrentHashMap<Connection, AdHocCommandManager>();
|
||||
|
||||
/**
|
||||
* Register the listener for all the connection creations. When a new
|
||||
|
@ -77,8 +77,8 @@ public class AdHocCommandManager {
|
|||
* related to that connection.
|
||||
*/
|
||||
static {
|
||||
XMPPConnection.addConnectionCreationListener(new ConnectionCreationListener() {
|
||||
public void connectionCreated(XMPPConnection connection) {
|
||||
Connection.addConnectionCreationListener(new ConnectionCreationListener() {
|
||||
public void connectionCreated(Connection connection) {
|
||||
new AdHocCommandManager(connection);
|
||||
}
|
||||
});
|
||||
|
@ -91,7 +91,7 @@ public class AdHocCommandManager {
|
|||
* @param connection the XMPP connection.
|
||||
* @return the AdHocCommandManager associated with the connection.
|
||||
*/
|
||||
public static AdHocCommandManager getAddHocCommandsManager(XMPPConnection connection) {
|
||||
public static AdHocCommandManager getAddHocCommandsManager(Connection connection) {
|
||||
return instances.get(connection);
|
||||
}
|
||||
|
||||
|
@ -101,9 +101,9 @@ public class AdHocCommandManager {
|
|||
private Thread sessionsSweeper;
|
||||
|
||||
/**
|
||||
* The XMPPConnection that this instances of AdHocCommandManager manages
|
||||
* The Connection that this instances of AdHocCommandManager manages
|
||||
*/
|
||||
private XMPPConnection connection;
|
||||
private Connection connection;
|
||||
|
||||
/**
|
||||
* Map a command node with its AdHocCommandInfo. Note: Key=command node,
|
||||
|
@ -120,7 +120,7 @@ public class AdHocCommandManager {
|
|||
*/
|
||||
private Map<String, LocalCommand> executingCommands = new ConcurrentHashMap<String, LocalCommand>();
|
||||
|
||||
private AdHocCommandManager(XMPPConnection connection) {
|
||||
private AdHocCommandManager(Connection connection) {
|
||||
super();
|
||||
this.connection = connection;
|
||||
init();
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.jivesoftware.smackx.commands;
|
|||
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketIDFilter;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
@ -49,7 +49,7 @@ public class RemoteCommand extends AdHocCommand {
|
|||
/**
|
||||
* The connection that is used to execute this command
|
||||
*/
|
||||
private XMPPConnection connection;
|
||||
private Connection connection;
|
||||
|
||||
/**
|
||||
* The full JID of the command host
|
||||
|
@ -77,7 +77,7 @@ public class RemoteCommand extends AdHocCommand {
|
|||
* @param node the identifier of the command.
|
||||
* @param jid the JID of the host.
|
||||
*/
|
||||
protected RemoteCommand(XMPPConnection connection, String node, String jid) {
|
||||
protected RemoteCommand(Connection connection, String node, String jid) {
|
||||
super();
|
||||
this.connection = connection;
|
||||
this.jid = jid;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue