1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Refactoring: All connection classes begin with XMPP now

This commit renames classes as follows:
 * TCPConnection --> XMPPTCPConnection
 * BOSHConnection --> XMPPBOSHConnection

There are two reasons for this rename. First, it is there to indicate
that the classes actually _are_ XMPP connections, using different
transport mechanisms. Second, it makes auto-completion in IDEs easier,
the developer can type XMPP<complete> and choose the right backend.
This commit is contained in:
Georg Lukas 2014-04-09 12:16:44 +02:00 committed by Florian Schmaus
parent c86d6e3b61
commit ab70cfec24
31 changed files with 120 additions and 120 deletions

View file

@ -28,7 +28,7 @@ import org.jivesoftware.smack.util.dns.HostAddress;
* Configuration to use while establishing the connection to the XMPP server via
* HTTP binding.
*
* @see BOSHConnection
* @see XMPPBOSHConnection
* @author Guenther Niess
*/
public class BOSHConfiguration extends ConnectionConfiguration {

View file

@ -40,7 +40,7 @@ import org.igniterealtime.jbosh.ComposableBody;
*/
public class BOSHPacketReader implements BOSHClientResponseListener {
private BOSHConnection connection;
private XMPPBOSHConnection connection;
/**
* Create a packet reader which listen on a BOSHConnection for received
@ -48,7 +48,7 @@ public class BOSHPacketReader implements BOSHClientResponseListener {
*
* @param connection the corresponding connection for the received packets.
*/
public BOSHPacketReader(BOSHConnection connection) {
public BOSHPacketReader(XMPPBOSHConnection connection) {
this.connection = connection;
}
@ -62,10 +62,10 @@ public class BOSHPacketReader implements BOSHClientResponseListener {
if (body != null) {
try {
if (connection.sessionID == null) {
connection.sessionID = body.getAttribute(BodyQName.create(BOSHConnection.BOSH_URI, "sid"));
connection.sessionID = body.getAttribute(BodyQName.create(XMPPBOSHConnection.BOSH_URI, "sid"));
}
if (connection.authID == null) {
connection.authID = body.getAttribute(BodyQName.create(BOSHConnection.BOSH_URI, "authid"));
connection.authID = body.getAttribute(BodyQName.create(XMPPBOSHConnection.BOSH_URI, "authid"));
}
final XmlPullParser parser = XmlPullParserFactory.newInstance().newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES,
@ -93,12 +93,12 @@ public class BOSHPacketReader implements BOSHClientResponseListener {
challengeData));
} else if (parser.getName().equals("success")) {
connection.send(ComposableBody.builder()
.setNamespaceDefinition("xmpp", BOSHConnection.XMPP_BOSH_NS)
.setNamespaceDefinition("xmpp", XMPPBOSHConnection.XMPP_BOSH_NS)
.setAttribute(
BodyQName.createWithPrefix(BOSHConnection.XMPP_BOSH_NS, "restart", "xmpp"),
BodyQName.createWithPrefix(XMPPBOSHConnection.XMPP_BOSH_NS, "restart", "xmpp"),
"true")
.setAttribute(
BodyQName.create(BOSHConnection.BOSH_URI, "to"),
BodyQName.create(XMPPBOSHConnection.BOSH_URI, "to"),
connection.getServiceName())
.build());
connection.getSASLAuthentication().authenticated();

View file

@ -56,8 +56,8 @@ import org.igniterealtime.jbosh.ComposableBody;
* @see XMPPConnection
* @author Guenther Niess
*/
public class BOSHConnection extends XMPPConnection {
private static final Logger LOGGER = Logger.getLogger(BOSHConnection.class.getName());
public class XMPPBOSHConnection extends XMPPConnection {
private static final Logger LOGGER = Logger.getLogger(XMPPBOSHConnection.class.getName());
/**
* The XMPP Over Bosh namespace.
@ -120,7 +120,7 @@ public class BOSHConnection extends XMPPConnection {
* @param xmppDomain the XMPP service name
* (e.g. domain.lt for the user alice@domain.lt)
*/
public BOSHConnection(boolean https, String host, int port, String filePath, String xmppDomain) {
public XMPPBOSHConnection(boolean https, String host, int port, String filePath, String xmppDomain) {
super(new BOSHConfiguration(https, host, port, filePath, xmppDomain));
this.config = (BOSHConfiguration) getConfiguration();
}
@ -130,7 +130,7 @@ public class BOSHConnection extends XMPPConnection {
*
* @param config The configuration which is used for this connection.
*/
public BOSHConnection(BOSHConfiguration config) {
public XMPPBOSHConnection(BOSHConfiguration config) {
super(config);
this.config = config;
}
@ -549,9 +549,9 @@ public class BOSHConnection extends XMPPConnection {
*/
private class BOSHConnectionListener implements BOSHClientConnListener {
private final BOSHConnection connection;
private final XMPPBOSHConnection connection;
public BOSHConnectionListener(BOSHConnection connection) {
public BOSHConnectionListener(XMPPBOSHConnection connection) {
this.connection = connection;
}