mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-11 18:19:38 +02:00
Renamed Connection to XMPPConnection
This commit is contained in:
parent
f3e007bad5
commit
489816c61f
145 changed files with 639 additions and 641 deletions
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle.mediaimpl.demo;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.TCPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.jingle.JingleManager;
|
||||
|
@ -42,7 +42,7 @@ public class Demo extends JFrame {
|
|||
|
||||
private static final long serialVersionUID = -6584021277434403855L;
|
||||
private JingleTransportManager transportManager = null;
|
||||
private Connection xmppConnection = null;
|
||||
private XMPPConnection xmppConnection = null;
|
||||
|
||||
private String server = null;
|
||||
private String user = null;
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.logging.Logger;
|
|||
import org.jivesoftware.smack.ConnectionCreationListener;
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
import org.jivesoftware.smack.RosterListener;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketFilter;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
@ -96,7 +96,7 @@ import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
|||
* try {
|
||||
* <p/>
|
||||
* // Connect to a XMPP Server
|
||||
* Connection x1 = new TCPConnection("xmpp.com");
|
||||
* XMPPConnection x1 = new TCPConnection("xmpp.com");
|
||||
* x1.connect();
|
||||
* x1.login("juliet", "juliet");
|
||||
* <p/>
|
||||
|
@ -139,7 +139,7 @@ import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
|
|||
* try {
|
||||
* <p/>
|
||||
* // Connect to a XMPP Server
|
||||
* Connection x0 = new TCPConnection("xmpp.com");
|
||||
* XMPPConnection x0 = new TCPConnection("xmpp.com");
|
||||
* x0.connect();
|
||||
* x0.login("romeo", "romeo");
|
||||
* <p/>
|
||||
|
@ -194,19 +194,19 @@ public class JingleManager implements JingleSessionListener {
|
|||
private List<CreatedJingleSessionListener> creationListeners = new ArrayList<CreatedJingleSessionListener>();
|
||||
|
||||
// The XMPP connection
|
||||
private Connection connection;
|
||||
private XMPPConnection connection;
|
||||
|
||||
// The Media Managers
|
||||
private List<JingleMediaManager> jingleMediaManagers;
|
||||
|
||||
/**
|
||||
* Default constructor with a defined Connection, Transport Resolver and a Media Manager
|
||||
* Default constructor with a defined XMPPConnection, Transport Resolver and a Media Manager
|
||||
* If a fully implemented JingleMediaSession is entered, JingleManager manage Jingle signalling and jmf
|
||||
*
|
||||
* @param connection XMPP Connection to be used
|
||||
* @param connection XMPP XMPPConnection to be used
|
||||
* @param jingleMediaManager an implemeted JingleMediaManager to be used.
|
||||
*/
|
||||
public JingleManager(Connection connection, List<JingleMediaManager> jingleMediaManagers) {
|
||||
public JingleManager(XMPPConnection connection, List<JingleMediaManager> jingleMediaManagers) {
|
||||
this.connection = connection;
|
||||
this.jingleMediaManagers = jingleMediaManagers;
|
||||
|
||||
|
@ -246,7 +246,7 @@ public class JingleManager implements JingleSessionListener {
|
|||
/**
|
||||
* Setup the jingle system to let the remote clients know we support Jingle.
|
||||
* (This used to be a static part of construction. The problem is a remote client might
|
||||
* attempt a Jingle connection to us after we've created a Connection, but before we've
|
||||
* attempt a Jingle connection to us after we've created a XMPPConnection, but before we've
|
||||
* setup an instance of a JingleManager. We will appear to not support Jingle. With the new
|
||||
* method you just call it once and all new connections will report Jingle support.)
|
||||
*/
|
||||
|
@ -257,8 +257,8 @@ public class JingleManager implements JingleSessionListener {
|
|||
// Enable the Jingle support on every established connection
|
||||
// The ServiceDiscoveryManager class should have been already
|
||||
// initialized
|
||||
Connection.addConnectionCreationListener(new ConnectionCreationListener() {
|
||||
public void connectionCreated(Connection connection) {
|
||||
XMPPConnection.addConnectionCreationListener(new ConnectionCreationListener() {
|
||||
public void connectionCreated(XMPPConnection connection) {
|
||||
JingleManager.setServiceEnabled(connection, true);
|
||||
}
|
||||
});
|
||||
|
@ -276,7 +276,7 @@ public class JingleManager implements JingleSessionListener {
|
|||
* disabled
|
||||
* @param enabled indicates if the service will be enabled or disabled
|
||||
*/
|
||||
public synchronized static void setServiceEnabled(Connection connection, boolean enabled) {
|
||||
public synchronized static void setServiceEnabled(XMPPConnection connection, boolean enabled) {
|
||||
if (isServiceEnabled(connection) == enabled) {
|
||||
return;
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ public class JingleManager implements JingleSessionListener {
|
|||
* @return a boolean indicating if the Jingle support is enabled for the
|
||||
* given connection
|
||||
*/
|
||||
public static boolean isServiceEnabled(Connection connection) {
|
||||
public static boolean isServiceEnabled(XMPPConnection connection) {
|
||||
return ServiceDiscoveryManager.getInstanceFor(connection).includesFeature(Jingle.NAMESPACE);
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,7 @@ public class JingleManager implements JingleSessionListener {
|
|||
* @return a boolean indicating whether the specified user handles Jingle
|
||||
* messages
|
||||
*/
|
||||
public static boolean isServiceEnabled(Connection connection, String userID) {
|
||||
public static boolean isServiceEnabled(XMPPConnection connection, String userID) {
|
||||
try {
|
||||
DiscoverInfo result = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(userID);
|
||||
return result.containsFeature(Jingle.NAMESPACE);
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smackx.jingle.listeners.JingleListener;
|
||||
|
@ -43,7 +43,7 @@ public abstract class JingleNegotiator {
|
|||
|
||||
private static final Logger LOGGER = Logger.getLogger(JingleNegotiator.class.getName());
|
||||
|
||||
//private Connection connection; // The connection associated
|
||||
//private XMPPConnection connection; // The connection associated
|
||||
|
||||
protected JingleSession session;
|
||||
|
||||
|
@ -99,7 +99,7 @@ public abstract class JingleNegotiator {
|
|||
this.state = stateIs;
|
||||
}
|
||||
|
||||
public Connection getConnection() {
|
||||
public XMPPConnection getConnection() {
|
||||
if (session != null) {
|
||||
return session.getConnection();
|
||||
} else {
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.util.logging.Logger;
|
|||
|
||||
import org.jivesoftware.smack.ConnectionListener;
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketFilter;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
@ -61,7 +61,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
private static final Logger LOGGER = Logger.getLogger(JingleSession.class.getName());
|
||||
|
||||
// static
|
||||
private static final HashMap<Connection, JingleSession> sessions = new HashMap<Connection, JingleSession>();
|
||||
private static final HashMap<XMPPConnection, JingleSession> sessions = new HashMap<XMPPConnection, JingleSession>();
|
||||
|
||||
private static final Random randomGenerator = new Random();
|
||||
|
||||
|
@ -85,7 +85,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
|
||||
private List<ContentNegotiator> contentNegotiators;
|
||||
|
||||
private Connection connection;
|
||||
private XMPPConnection connection;
|
||||
|
||||
private String sessionInitPacketID;
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
* Full featured JingleSession constructor
|
||||
*
|
||||
* @param conn
|
||||
* the Connection which is used
|
||||
* the XMPPConnection which is used
|
||||
* @param initiator
|
||||
* the initiator JID
|
||||
* @param responder
|
||||
|
@ -105,7 +105,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
* @param jingleMediaManager
|
||||
* the jingleMediaManager
|
||||
*/
|
||||
public JingleSession(Connection conn, String initiator, String responder, String sessionid,
|
||||
public JingleSession(XMPPConnection conn, String initiator, String responder, String sessionid,
|
||||
List<JingleMediaManager> jingleMediaManagers) {
|
||||
super();
|
||||
|
||||
|
@ -139,7 +139,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
* @param jingleMediaManager
|
||||
* the jingleMediaManager
|
||||
*/
|
||||
public JingleSession(Connection conn, JingleSessionRequest request, String initiator, String responder,
|
||||
public JingleSession(XMPPConnection conn, JingleSessionRequest request, String initiator, String responder,
|
||||
List<JingleMediaManager> jingleMediaManagers) {
|
||||
this(conn, initiator, responder, generateSessionId(), jingleMediaManagers);
|
||||
//sessionRequest = request; // unused
|
||||
|
@ -154,7 +154,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
return initiator;
|
||||
}
|
||||
|
||||
public Connection getConnection() {
|
||||
public XMPPConnection getConnection() {
|
||||
return connection;
|
||||
}
|
||||
|
||||
|
@ -578,7 +578,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
* @param connection
|
||||
* The connection to clean up
|
||||
*/
|
||||
private void unregisterInstanceFor(Connection connection) {
|
||||
private void unregisterInstanceFor(XMPPConnection connection) {
|
||||
synchronized (sessions) {
|
||||
sessions.remove(connection);
|
||||
}
|
||||
|
@ -600,9 +600,9 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
* A XMPP connection
|
||||
* @return a Jingle session
|
||||
*/
|
||||
public static JingleSession getInstanceFor(Connection con) {
|
||||
public static JingleSession getInstanceFor(XMPPConnection con) {
|
||||
if (con == null) {
|
||||
throw new IllegalArgumentException("Connection cannot be null");
|
||||
throw new IllegalArgumentException("XMPPConnection cannot be null");
|
||||
}
|
||||
|
||||
JingleSession result = null;
|
||||
|
@ -621,7 +621,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
* @param connection
|
||||
* The connection to set up
|
||||
*/
|
||||
private void installConnectionListeners(final Connection connection) {
|
||||
private void installConnectionListeners(final XMPPConnection connection) {
|
||||
if (connection != null) {
|
||||
connectionListener = new ConnectionListener() {
|
||||
public void connectionClosed() {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle.nat;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
|
||||
|
@ -37,7 +37,7 @@ import java.util.Random;
|
|||
*/
|
||||
public class BridgedResolver extends TransportResolver {
|
||||
|
||||
Connection connection;
|
||||
XMPPConnection connection;
|
||||
|
||||
Random random = new Random();
|
||||
|
||||
|
@ -45,9 +45,9 @@ public class BridgedResolver extends TransportResolver {
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
* A Bridged Resolver need a Connection to connect to a RTP Bridge.
|
||||
* A Bridged Resolver need a XMPPConnection to connect to a RTP Bridge.
|
||||
*/
|
||||
public BridgedResolver(Connection connection) {
|
||||
public BridgedResolver(XMPPConnection connection) {
|
||||
super();
|
||||
this.connection = connection;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle.nat;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
import org.jivesoftware.smackx.jingle.listeners.CreatedJingleSessionListener;
|
||||
|
@ -32,9 +32,9 @@ import org.jivesoftware.smackx.jingle.media.PayloadType;
|
|||
*/
|
||||
public class BridgedTransportManager extends JingleTransportManager implements JingleSessionListener, CreatedJingleSessionListener {
|
||||
|
||||
Connection xmppConnection;
|
||||
XMPPConnection xmppConnection;
|
||||
|
||||
public BridgedTransportManager(Connection xmppConnection) {
|
||||
public BridgedTransportManager(XMPPConnection xmppConnection) {
|
||||
super();
|
||||
this.xmppConnection = xmppConnection;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.Map;
|
|||
import java.util.Random;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class ICEResolver extends TransportResolver {
|
|||
|
||||
private static final Logger LOGGER = Logger.getLogger(ICEResolver.class.getName());
|
||||
|
||||
Connection connection;
|
||||
XMPPConnection connection;
|
||||
Random random = new Random();
|
||||
long sid;
|
||||
String server;
|
||||
|
@ -53,7 +53,7 @@ public class ICEResolver extends TransportResolver {
|
|||
static Map<String, ICENegociator> negociatorsMap = new HashMap<String, ICENegociator>();
|
||||
//ICENegociator iceNegociator = null;
|
||||
|
||||
public ICEResolver(Connection connection, String server, int port) {
|
||||
public ICEResolver(XMPPConnection connection, String server, int port) {
|
||||
super();
|
||||
this.connection = connection;
|
||||
this.server = server;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle.nat;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
import org.jivesoftware.smackx.jingle.listeners.CreatedJingleSessionListener;
|
||||
|
@ -27,7 +27,7 @@ public class ICETransportManager extends JingleTransportManager implements Jingl
|
|||
|
||||
ICEResolver iceResolver = null;
|
||||
|
||||
public ICETransportManager(Connection xmppConnection, String server, int port) {
|
||||
public ICETransportManager(XMPPConnection xmppConnection, String server, int port) {
|
||||
iceResolver = new ICEResolver(xmppConnection, server, port);
|
||||
try {
|
||||
iceResolver.initializeAndWait();
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.Enumeration;
|
|||
import java.util.Iterator;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
@ -387,7 +387,7 @@ public class RTPBridge extends IQ {
|
|||
* @param sessionID
|
||||
* @return
|
||||
*/
|
||||
public static RTPBridge getRTPBridge(Connection connection, String sessionID) {
|
||||
public static RTPBridge getRTPBridge(XMPPConnection connection, String sessionID) {
|
||||
|
||||
if (!connection.isConnected()) {
|
||||
return null;
|
||||
|
@ -412,7 +412,7 @@ public class RTPBridge extends IQ {
|
|||
* @param connection
|
||||
* @return
|
||||
*/
|
||||
public static boolean serviceAvailable(Connection connection) {
|
||||
public static boolean serviceAvailable(XMPPConnection connection) {
|
||||
|
||||
if (!connection.isConnected()) {
|
||||
return false;
|
||||
|
@ -454,7 +454,7 @@ public class RTPBridge extends IQ {
|
|||
* @param connection
|
||||
* @return
|
||||
*/
|
||||
public static RTPBridge relaySession(Connection connection, String sessionID, String pass, TransportCandidate proxyCandidate, TransportCandidate localCandidate) {
|
||||
public static RTPBridge relaySession(XMPPConnection connection, String sessionID, String pass, TransportCandidate proxyCandidate, TransportCandidate localCandidate) {
|
||||
|
||||
if (!connection.isConnected()) {
|
||||
return null;
|
||||
|
@ -488,7 +488,7 @@ public class RTPBridge extends IQ {
|
|||
* @param xmppConnection
|
||||
* @return public IP String or null if not found
|
||||
*/
|
||||
public static String getPublicIP(Connection xmppConnection) {
|
||||
public static String getPublicIP(XMPPConnection xmppConnection) {
|
||||
|
||||
if (!xmppConnection.isConnected()) {
|
||||
return null;
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
@ -183,7 +183,7 @@ public class STUN extends IQ {
|
|||
* @param connection
|
||||
* @return
|
||||
*/
|
||||
public static STUN getSTUNServer(Connection connection) {
|
||||
public static STUN getSTUNServer(XMPPConnection connection) {
|
||||
|
||||
if (!connection.isConnected()) {
|
||||
return null;
|
||||
|
@ -208,7 +208,7 @@ public class STUN extends IQ {
|
|||
* @param xmppConnection
|
||||
* @return
|
||||
*/
|
||||
public static boolean serviceAvailable(Connection connection) {
|
||||
public static boolean serviceAvailable(XMPPConnection connection) {
|
||||
|
||||
if (!connection.isConnected()) {
|
||||
return false;
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smackx.jingle.JingleSession;
|
||||
import org.jivesoftware.smackx.jingle.nat.TransportResolverListener.Checker;
|
||||
|
||||
|
@ -59,7 +59,7 @@ public abstract class TransportCandidate {
|
|||
|
||||
private String sessionId;
|
||||
|
||||
private Connection connection;
|
||||
private XMPPConnection connection;
|
||||
|
||||
private TransportCandidate symmetric;
|
||||
|
||||
|
@ -155,20 +155,20 @@ public abstract class TransportCandidate {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the Connection use to send or receive this candidate
|
||||
* Get the XMPPConnection use to send or receive this candidate
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Connection getConnection() {
|
||||
public XMPPConnection getConnection() {
|
||||
return connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Connection use to send or receive this candidate
|
||||
* Set the XMPPConnection use to send or receive this candidate
|
||||
*
|
||||
* @param connection
|
||||
*/
|
||||
public void setConnection(Connection connection) {
|
||||
public void setConnection(XMPPConnection connection) {
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue