mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 17:49:38 +02:00
1) Fixed reconnection when connection was using compression.
2) Fixed conflict error while reconnecting (reconnection was not keeping track of resource and sendPresence. 3) Improved javadoc (and checking) that reconnectionlisteners should be added once connected. 4) Added new reconnection test case for reconnection and multiple resources. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@6050 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
97824ebc1c
commit
53c97378d3
3 changed files with 82 additions and 12 deletions
|
@ -66,7 +66,8 @@ public class ConnectionConfiguration implements Cloneable {
|
|||
// Holds the authentication information for future reconnections
|
||||
private String username;
|
||||
private String password;
|
||||
|
||||
private String resource;
|
||||
private boolean sendPresence;
|
||||
/**
|
||||
* Creates a new ConnectionConfiguration for a connection that will connect
|
||||
* to the desired service name. A DNS SRV lookup will be performed to find out the
|
||||
|
@ -441,21 +442,49 @@ public class ConnectionConfiguration implements Cloneable {
|
|||
public SocketFactory getSocketFactory() {
|
||||
return this.socketFactory;
|
||||
}
|
||||
|
||||
protected void setUsernameAndPassword(String username, String password) {
|
||||
|
||||
protected void setLoginInfo(String username, String password, String resource,
|
||||
boolean sendPresence) {
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.resource = resource;
|
||||
this.sendPresence = sendPresence;
|
||||
}
|
||||
/**
|
||||
* Returns the username used to login
|
||||
|
||||
/**
|
||||
* Returns the username to use when trying to reconnect to the server.
|
||||
*
|
||||
* @return the username to use when trying to reconnect to the server.
|
||||
*/
|
||||
protected String getUsername() {
|
||||
return this.username;
|
||||
}
|
||||
/**
|
||||
* Returns the password used to login
|
||||
|
||||
/**
|
||||
* Returns the password to use when trying to reconnect to the server.
|
||||
*
|
||||
* @return the password to use when trying to reconnect to the server.
|
||||
*/
|
||||
protected String getPassword() {
|
||||
return this.password;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the resource to use when trying to reconnect to the server.
|
||||
*
|
||||
* @return the resource to use when trying to reconnect to the server.
|
||||
*/
|
||||
protected String getResource() {
|
||||
return resource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if an available presence should be sent when logging in while reconnecting.
|
||||
*
|
||||
* @return true if an available presence should be sent when logging in while reconnecting
|
||||
*/
|
||||
protected boolean isSendPresence() {
|
||||
return sendPresence;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue