1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 02:27:58 +01:00

Created 'tcp' subproject for TCPConnection

Renamed XMPPConnection to TCPConnection, since the other connection type
is also called BOSHConnection.
This commit is contained in:
Florian Schmaus 2014-03-01 14:27:20 +01:00
parent 790343867a
commit a3e64bab18
7 changed files with 32 additions and 22 deletions

View file

@ -251,6 +251,27 @@ since Java7."""
}
}
project(':tcp') {
description = """\
Smack for standard XMPP connections over TCP."""
dependencies {
compile project(':core')
testCompile project(':core').sourceSets.test.runtimeClasspath
}
}
project(':bosh') {
description = """\
Smack BOSH API.
This API is considered beta quality."""
dependencies {
compile project(':core')
compile 'org.igniterealtime.jbosh:jbosh:0.7.0'
}
}
// Now the "real" Smack sub-projects
// Note that test dependencies (junit, ) are interfered from the sourceSet.test of the core sub-project
@ -318,17 +339,6 @@ Warning: This API is beta, outdated and currenlty unmaintained."""
}
}
project(':bosh') {
description = """\
Smack BOSH API.
This API is considered beta quality."""
dependencies {
compile project(':core')
compile 'org.igniterealtime.jbosh:jbosh:0.7.0'
}
}
(subprojects - project(':core'))*.jar {
manifest {
attributes('Bundle-SymbolicName': project.group + '-' + appendix,

View file

@ -1,4 +1,5 @@
include 'core',
'tcp',
'extensions',
'experimental',
'debug',

View file

@ -49,13 +49,13 @@ class PacketReader {
private Thread readerThread;
private ExecutorService listenerExecutor;
private XMPPConnection connection;
private TCPConnection connection;
private XmlPullParser parser;
volatile boolean done;
private String connectionID = null;
protected PacketReader(final XMPPConnection connection) {
protected PacketReader(final TCPConnection connection) {
this.connection = connection;
this.init();
}

View file

@ -41,7 +41,7 @@ class PacketWriter {
private Thread writerThread;
private Writer writer;
private XMPPConnection connection;
private TCPConnection connection;
private final BlockingQueue<Packet> queue;
volatile boolean done;
@ -50,7 +50,7 @@ class PacketWriter {
*
* @param connection the connection.
*/
protected PacketWriter(XMPPConnection connection) {
protected PacketWriter(TCPConnection connection) {
this.queue = new ArrayBlockingQueue<Packet>(500, true);
this.connection = connection;
init();

View file

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.smack;
import org.jivesoftware.smack.compression.XMPPInputOutputStream;
@ -60,7 +59,7 @@ import java.util.List;
* @see Connection
* @author Matt Tucker
*/
public class XMPPConnection extends Connection {
public class TCPConnection extends Connection {
/**
* The socket which is used for this connection.
@ -126,7 +125,7 @@ public class XMPPConnection extends Connection {
* @param serviceName the name of the XMPP server to connect to; e.g. <tt>example.com</tt>.
* @param callbackHandler the CallbackHandler used to prompt for the password to the keystore.
*/
public XMPPConnection(String serviceName, CallbackHandler callbackHandler) {
public TCPConnection(String serviceName, CallbackHandler callbackHandler) {
// Create the configuration for this new connection
super(new ConnectionConfiguration(serviceName));
config.setCompressionEnabled(false);
@ -142,7 +141,7 @@ public class XMPPConnection extends Connection {
*
* @param serviceName the name of the XMPP server to connect to; e.g. <tt>example.com</tt>.
*/
public XMPPConnection(String serviceName) {
public TCPConnection(String serviceName) {
// Create the configuration for this new connection
super(new ConnectionConfiguration(serviceName));
config.setCompressionEnabled(false);
@ -158,7 +157,7 @@ public class XMPPConnection extends Connection {
*
* @param config the connection configuration.
*/
public XMPPConnection(ConnectionConfiguration config) {
public TCPConnection(ConnectionConfiguration config) {
super(config);
}
@ -180,7 +179,7 @@ public class XMPPConnection extends Connection {
* @param config the connection configuration.
* @param callbackHandler the CallbackHandler used to prompt for the password to the keystore.
*/
public XMPPConnection(ConnectionConfiguration config, CallbackHandler callbackHandler) {
public TCPConnection(ConnectionConfiguration config, CallbackHandler callbackHandler) {
super(config);
config.setCallbackHandler(callbackHandler);
}

View file

@ -39,7 +39,7 @@ public class RosterOfflineTest {
@Before
public void setup() {
this.connection = new XMPPConnection("localhost");
this.connection = new TCPConnection("localhost");
assertFalse(connection.isConnected());
roster = connection.getRoster();