From 0ec7e23666759937c8efd8221a8733d7329c9420 Mon Sep 17 00:00:00 2001 From: rcollier Date: Mon, 28 Mar 2011 13:13:41 +0000 Subject: [PATCH] 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 --- source/org/jivesoftware/smack/Connection.java | 22 +++++----- .../jivesoftware/smack/XMPPConnection.java | 40 +------------------ 2 files changed, 14 insertions(+), 48 deletions(-) diff --git a/source/org/jivesoftware/smack/Connection.java b/source/org/jivesoftware/smack/Connection.java index e857254de..cde0ab4aa 100644 --- a/source/org/jivesoftware/smack/Connection.java +++ b/source/org/jivesoftware/smack/Connection.java @@ -323,9 +323,13 @@ public abstract class Connection { /** * Logs in to the server using the strongest authentication mode supported by - * the server, then sets presence to available. 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.

+ * the server, then sets presence to available. 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.

+ * + * 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 * {@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 - * 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.

+ * the server, then sets presence to available. 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.

* * 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.

* * It is possible to log in without sending an initial available presence by using * {@link ConnectionConfiguration#setSendPresence(boolean)}. If this connection is diff --git a/source/org/jivesoftware/smack/XMPPConnection.java b/source/org/jivesoftware/smack/XMPPConnection.java index 8ccaef2b8..d04585081 100644 --- a/source/org/jivesoftware/smack/XMPPConnection.java +++ b/source/org/jivesoftware/smack/XMPPConnection.java @@ -184,34 +184,7 @@ public class XMPPConnection extends Connection { return user; } - /** - * 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.

- * - * 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.

- * - * 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 null 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. - */ + @Override public synchronized void login(String username, String password, String resource) throws XMPPException { if (!isConnected()) { throw new IllegalStateException("Not connected to server."); @@ -286,16 +259,7 @@ public class XMPPConnection extends Connection { } } - /** - * 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. - */ + @Override public synchronized void loginAnonymously() throws XMPPException { if (!isConnected()) { throw new IllegalStateException("Not connected to server.");