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

Simplified list of #login methods in XMPPConnection.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@10846 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2008-10-24 05:17:50 +00:00 committed by gato
parent 73a302aef1
commit 2da448d2fd
3 changed files with 111 additions and 231 deletions

View file

@ -20,10 +20,11 @@
package org.jivesoftware.smack;
import org.jivesoftware.smack.util.DNSUtil;
import org.jivesoftware.smack.proxy.ProxyInfo;
import org.jivesoftware.smack.util.DNSUtil;
import javax.net.SocketFactory;
import javax.security.auth.callback.CallbackHandler;
import java.io.File;
/**
@ -57,6 +58,10 @@ public class ConnectionConfiguration implements Cloneable {
private boolean compressionEnabled = false;
private boolean saslAuthenticationEnabled = true;
/**
* Used to get information from the user
*/
private CallbackHandler callbackHandler;
private boolean debuggerEnabled = XMPPConnection.DEBUG_ENABLED;
@ -70,7 +75,8 @@ public class ConnectionConfiguration implements Cloneable {
private String username;
private String password;
private String resource;
private boolean sendPresence;
private boolean sendPresence = true;
private boolean rosterLoadedAtLogin = true;
private SecurityMode securityMode = SecurityMode.enabled;
// Holds the proxy information (such as proxyhost, proxyport, username, password etc)
@ -563,6 +569,66 @@ public class ConnectionConfiguration implements Cloneable {
this.socketFactory = socketFactory;
}
/**
* Sets if an initial available presence will be sent to the server. By default
* an available presence will be sent to the server indicating that this presence
* is not online and available to receive messages. If you want to log in without
* being 'noticed' then pass a <tt>false</tt> value.
*
* @param sendPresence true if an initial available presence will be sent while logging in.
*/
public void setSendPresence(boolean sendPresence) {
this.sendPresence = sendPresence;
}
/**
* Returns true if the roster will be loaded from the server when logging in. This
* is the common behaviour for clients but sometimes clients may want to differ this
* or just never do it if not interested in rosters.
*
* @return true if the roster will be loaded from the server when logging in.
*/
public boolean isRosterLoadedAtLogin() {
return rosterLoadedAtLogin;
}
/**
* Sets if the roster will be loaded from the server when logging in. This
* is the common behaviour for clients but sometimes clients may want to differ this
* or just never do it if not interested in rosters.
*
* @param rosterLoadedAtLogin if the roster will be loaded from the server when logging in.
*/
public void setRosterLoadedAtLogin(boolean rosterLoadedAtLogin) {
this.rosterLoadedAtLogin = rosterLoadedAtLogin;
}
/**
* Returns a CallbackHandler to obtain information, such as the password or
* principal information during the SASL authentication. A CallbackHandler
* will be used <b>ONLY</b> if no password was specified during the login while
* using SASL authentication.
*
* @return a CallbackHandler to obtain information, such as the password or
* principal information during the SASL authentication.
*/
public CallbackHandler getCallbackHandler() {
return callbackHandler;
}
/**
* Sets a CallbackHandler to obtain information, such as the password or
* principal information during the SASL authentication. A CallbackHandler
* will be used <b>ONLY</b> if no password was specified during the login while
* using SASL authentication.
*
* @param callbackHandler to obtain information, such as the password or
* principal information during the SASL authentication.
*/
public void setCallbackHandler(CallbackHandler callbackHandler) {
this.callbackHandler = callbackHandler;
}
/**
* Returns the socket factory used to create new xmppConnection sockets.
* This is useful when connecting through SOCKS5 proxies.
@ -636,10 +702,9 @@ public class ConnectionConfiguration implements Cloneable {
return sendPresence;
}
void setLoginInfo(String username, String password, String resource, boolean sendPresence) {
void setLoginInfo(String username, String password, String resource) {
this.username = username;
this.password = password;
this.resource = resource;
this.sendPresence = sendPresence;
}
}