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

Add XMPPConnection.getStreamId()

and remove getConnectionID().

Also make streamId a field of AbstractXMPPConnection. Most XMPP
connection types have a streamId, it appears to be optional when BOSH
is used though.
This commit is contained in:
Florian Schmaus 2015-01-28 17:14:33 +01:00
parent 612ca1ad9d
commit 5a56ff011b
5 changed files with 28 additions and 53 deletions

View file

@ -48,8 +48,6 @@ public class DummyConnection extends AbstractXMPPConnection {
private boolean reconnect = false;
private String connectionID;
private final BlockingQueue<TopLevelStreamElement> queue = new LinkedBlockingQueue<TopLevelStreamElement>();
public static ConnectionConfiguration.Builder<?,?> getDummyConfigurationBuilder() {
@ -77,7 +75,7 @@ public class DummyConnection extends AbstractXMPPConnection {
@Override
protected void connectInternal() {
connected = true;
connectionID = "dummy-" + new Random(new Date().getTime()).nextInt();
streamId = "dummy-" + new Random(new Date().getTime()).nextInt();
if (reconnect) {
notifyReconnection();
@ -87,24 +85,12 @@ public class DummyConnection extends AbstractXMPPConnection {
@Override
protected void shutdown() {
user = null;
connectionID = null;
authenticated = false;
callConnectionClosedListener();
reconnect = true;
}
@Override
public String getConnectionID() {
if (!isConnected()) {
return null;
}
if (connectionID == null) {
connectionID = "dummy-" + new Random(new Date().getTime()).nextInt();
}
return connectionID;
}
@Override
public boolean isSecureConnection() {
return false;