1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-21 01:57:57 +01:00

Updated some javadoc that caused confusion as to the login() behaviour.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@12194 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2011-03-28 13:13:41 +00:00
parent 01a1fb7751
commit 0ec7e23666
2 changed files with 14 additions and 48 deletions

View file

@ -323,9 +323,13 @@ public abstract class Connection {
/** /**
* Logs in to the server using the strongest authentication mode supported by * Logs in to the server using the strongest authentication mode supported by
* the server, then sets presence to available. If more than five seconds * the server, then sets presence to available. If the server supports SASL authentication
* (default timeout) elapses in each step of the authentication process without * then the user will be authenticated using SASL if not Non-SASL authentication will
* a response from the server, or if an error occurs, a XMPPException will be thrown.<p> * be tried. If more than five seconds (default timeout) elapses in each step of the
* authentication process without a response from the server, or if an error occurs, a
* XMPPException will be thrown.<p>
*
* Before logging in (i.e. authenticate) to the server the connection must be connected.
* *
* It is possible to log in without sending an initial available presence by using * It is possible to log in without sending an initial available presence by using
* {@link ConnectionConfiguration#setSendPresence(boolean)}. If this connection is * {@link ConnectionConfiguration#setSendPresence(boolean)}. If this connection is
@ -346,15 +350,13 @@ public abstract class Connection {
/** /**
* Logs in to the server using the strongest authentication mode supported by * Logs in to the server using the strongest authentication mode supported by
* the server. If the server supports SASL authentication then the user will be * the server, then sets presence to available. If the server supports SASL authentication
* authenticated using SASL if not Non-SASL authentication will be tried. If more than * then the user will be authenticated using SASL if not Non-SASL authentication will
* five seconds (default timeout) elapses in each step of the authentication process * be tried. If more than five seconds (default timeout) elapses in each step of the
* without a response from the server, or if an error occurs, a XMPPException will be * authentication process without a response from the server, or if an error occurs, a
* thrown.<p> * XMPPException will be thrown.<p>
* *
* Before logging in (i.e. authenticate) to the server the connection must be connected. * Before logging in (i.e. authenticate) to the server the connection must be connected.
* For compatibility and easiness of use the connection will automatically connect to the
* server if not already connected.<p>
* *
* It is possible to log in without sending an initial available presence by using * It is possible to log in without sending an initial available presence by using
* {@link ConnectionConfiguration#setSendPresence(boolean)}. If this connection is * {@link ConnectionConfiguration#setSendPresence(boolean)}. If this connection is

View file

@ -184,34 +184,7 @@ public class XMPPConnection extends Connection {
return user; return user;
} }
/** @Override
* Logs in to the server using the strongest authentication mode supported by
* the server. If the server supports SASL authentication then the user will be
* authenticated using SASL if not Non-SASL authentication will be tried. If more than
* five seconds (default timeout) elapses in each step of the authentication process
* without a response from the server, or if an error occurs, a XMPPException will be
* thrown.<p>
*
* Before logging in (i.e. authenticate) to the server the connection must be connected.
* For compatibility and easiness of use the connection will automatically connect to the
* server if not already connected.<p>
*
* It is possible to log in without sending an initial available presence by using
* {@link ConnectionConfiguration#setSendPresence(boolean)}. If this connection is
* not interested in loading its roster upon login then use
* {@link ConnectionConfiguration#setRosterLoadedAtLogin(boolean)}.
* Finally, if you want to not pass a password and instead use a more advanced mechanism
* while using SASL then you may be interested in using
* {@link ConnectionConfiguration#setCallbackHandler(javax.security.auth.callback.CallbackHandler)}.
* For more advanced login settings see {@link ConnectionConfiguration}.
*
* @param username the username.
* @param password the password or <tt>null</tt> if using a CallbackHandler.
* @param resource the resource.
* @throws XMPPException if an error occurs.
* @throws IllegalStateException if not connected to the server, or already logged in
* to the server.
*/
public synchronized void login(String username, String password, String resource) throws XMPPException { public synchronized void login(String username, String password, String resource) throws XMPPException {
if (!isConnected()) { if (!isConnected()) {
throw new IllegalStateException("Not connected to server."); throw new IllegalStateException("Not connected to server.");
@ -286,16 +259,7 @@ public class XMPPConnection extends Connection {
} }
} }
/** @Override
* Logs in to the server anonymously. Very few servers are configured to support anonymous
* authentication, so it's fairly likely logging in anonymously will fail. If anonymous login
* does succeed, your XMPP address will likely be in the form "server/123ABC" (where "123ABC"
* is a random value generated by the server).
*
* @throws XMPPException if an error occurs or anonymous logins are not supported by the server.
* @throws IllegalStateException if not connected to the server, or already logged in
* to the server.
*/
public synchronized void loginAnonymously() throws XMPPException { public synchronized void loginAnonymously() throws XMPPException {
if (!isConnected()) { if (!isConnected()) {
throw new IllegalStateException("Not connected to server."); throw new IllegalStateException("Not connected to server.");