Browse Source

Enable trailing whitespace checkstyle check

for all source code regions, including javadoc.
tags/4.3.0
Florian Schmaus 1 year ago
parent
commit
e8923b9d16
100 changed files with 487 additions and 489 deletions
  1. +8
    -10
      config/checkstyle.xml
  2. +1
    -1
      smack-bosh/src/main/java/org/jivesoftware/smack/bosh/BOSHConfiguration.java
  3. +7
    -7
      smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java
  4. +2
    -2
      smack-compression-jzlib/src/main/java/org/jivesoftware/smack/compression/jzlib/JzlibInputOutputStream.java
  5. +1
    -1
      smack-core/src/integration-test/java/org/jivesoftware/smack/IQTest.java
  6. +1
    -1
      smack-core/src/integration-test/java/org/jivesoftware/smack/LoginTest.java
  7. +2
    -2
      smack-core/src/integration-test/java/org/jivesoftware/smack/MessageTest.java
  8. +1
    -1
      smack-core/src/integration-test/java/org/jivesoftware/smack/PrivacyClient.java
  9. +1
    -1
      smack-core/src/integration-test/java/org/jivesoftware/smack/ReconnectionTest.java
  10. +1
    -1
      smack-core/src/integration-test/java/org/jivesoftware/smack/RosterInitializedBeforeConnectTest.java
  11. +1
    -1
      smack-core/src/integration-test/java/org/jivesoftware/smack/RosterListenerTest.java
  12. +4
    -4
      smack-core/src/integration-test/java/org/jivesoftware/smack/RosterSmackTest.java
  13. +5
    -5
      smack-core/src/integration-test/java/org/jivesoftware/smack/packet/PrivacyProviderTest.java
  14. +2
    -2
      smack-core/src/integration-test/java/org/jivesoftware/smack/packet/PrivacyTest.java
  15. +41
    -41
      smack-core/src/integration-test/java/org/jivesoftware/smack/test/SmackTestCase.java
  16. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/AbstractConnectionListener.java
  17. +26
    -26
      smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
  18. +15
    -15
      smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java
  19. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/ConnectionCreationListener.java
  20. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/ConnectionListener.java
  21. +7
    -7
      smack-core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java
  22. +6
    -6
      smack-core/src/main/java/org/jivesoftware/smack/SASLAuthentication.java
  23. +12
    -12
      smack-core/src/main/java/org/jivesoftware/smack/SmackConfiguration.java
  24. +16
    -16
      smack-core/src/main/java/org/jivesoftware/smack/SmackException.java
  25. +10
    -10
      smack-core/src/main/java/org/jivesoftware/smack/StanzaCollector.java
  26. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/StanzaListener.java
  27. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/SynchronizationPoint.java
  28. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/UnparseableStanza.java
  29. +44
    -44
      smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
  30. +3
    -3
      smack-core/src/main/java/org/jivesoftware/smack/XMPPConnectionRegistry.java
  31. +6
    -6
      smack-core/src/main/java/org/jivesoftware/smack/XMPPException.java
  32. +4
    -4
      smack-core/src/main/java/org/jivesoftware/smack/compression/Java7ZlibInputOutputStream.java
  33. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/compression/XMPPInputOutputStream.java
  34. +7
    -7
      smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java
  35. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/filter/IQTypeFilter.java
  36. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/filter/MessageTypeFilter.java
  37. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/initializer/SmackInitializer.java
  38. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/initializer/UrlInitializer.java
  39. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/initializer/VmArgInitializer.java
  40. +3
    -3
      smack-core/src/main/java/org/jivesoftware/smack/packet/AbstractError.java
  41. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/packet/Bind.java
  42. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java
  43. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/packet/Message.java
  44. +5
    -5
      smack-core/src/main/java/org/jivesoftware/smack/packet/Packet.java
  45. +4
    -4
      smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java
  46. +4
    -4
      smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java
  47. +3
    -3
      smack-core/src/main/java/org/jivesoftware/smack/packet/StanzaError.java
  48. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/parsing/ExceptionLoggingCallback.java
  49. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/parsing/ExceptionThrowingCallback.java
  50. +3
    -3
      smack-core/src/main/java/org/jivesoftware/smack/parsing/ParsingExceptionCallback.java
  51. +14
    -14
      smack-core/src/main/java/org/jivesoftware/smack/provider/EmbeddedExtensionProvider.java
  52. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/provider/ExtensionProviderInfo.java
  53. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/provider/IQProviderInfo.java
  54. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/provider/Provider.java
  55. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/provider/ProviderFileLoader.java
  56. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/provider/ProviderLoader.java
  57. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/provider/StreamFeatureProviderInfo.java
  58. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/proxy/HTTPProxySocketConnection.java
  59. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/proxy/ProxyException.java
  60. +6
    -6
      smack-core/src/main/java/org/jivesoftware/smack/proxy/ProxyInfo.java
  61. +4
    -4
      smack-core/src/main/java/org/jivesoftware/smack/proxy/Socks4ProxySocketConnection.java
  62. +5
    -5
      smack-core/src/main/java/org/jivesoftware/smack/proxy/Socks5ProxySocketConnection.java
  63. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLErrorException.java
  64. +18
    -18
      smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java
  65. +4
    -4
      smack-core/src/main/java/org/jivesoftware/smack/sasl/core/SASLXOauth2Mechanism.java
  66. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/sasl/core/ScramHmac.java
  67. +5
    -5
      smack-core/src/main/java/org/jivesoftware/smack/sasl/core/ScramMechanism.java
  68. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/sasl/core/ScramPlusMechanism.java
  69. +3
    -3
      smack-core/src/main/java/org/jivesoftware/smack/sasl/packet/SaslStreamElements.java
  70. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/util/ArrayBlockingQueueWithShutdown.java
  71. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/util/DNSUtil.java
  72. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/util/FileUtils.java
  73. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/util/ObservableReader.java
  74. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/util/ObservableWriter.java
  75. +15
    -15
      smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java
  76. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/util/ParserUtils.java
  77. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/util/ReaderListener.java
  78. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/util/StringUtils.java
  79. +4
    -4
      smack-core/src/main/java/org/jivesoftware/smack/util/TLSUtils.java
  80. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/util/WriterListener.java
  81. +3
    -3
      smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java
  82. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/util/dns/HostAddress.java
  83. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/util/dns/SRVRecord.java
  84. +1
    -1
      smack-core/src/main/java/org/jivesoftware/smack/util/stringencoder/Base32.java
  85. +2
    -2
      smack-core/src/main/java/org/jivesoftware/smack/util/stringencoder/StringEncoder.java
  86. +6
    -6
      smack-core/src/test/java/org/jivesoftware/smack/DummyConnection.java
  87. +1
    -1
      smack-core/src/test/java/org/jivesoftware/smack/StanzaCollectorTest.java
  88. +1
    -1
      smack-core/src/test/java/org/jivesoftware/smack/ThreadedDummyConnection.java
  89. +5
    -5
      smack-core/src/test/java/org/jivesoftware/smack/packet/IQResponseTest.java
  90. +35
    -35
      smack-core/src/test/java/org/jivesoftware/smack/packet/XMPPErrorTest.java
  91. +1
    -1
      smack-core/src/test/java/org/jivesoftware/smack/parsing/ParsingExceptionTest.java
  92. +1
    -1
      smack-core/src/test/java/org/jivesoftware/smack/util/PacketParserUtilsTest.java
  93. +2
    -2
      smack-debug/src/main/java/org/jivesoftware/smackx/debugger/EnhancedDebugger.java
  94. +2
    -2
      smack-debug/src/main/java/org/jivesoftware/smackx/debugger/EnhancedDebuggerWindow.java
  95. +6
    -6
      smack-debug/src/main/java/org/jivesoftware/smackx/debugger/LiteDebugger.java
  96. +1
    -1
      smack-experimental/src/main/java/org/jivesoftware/smack/experimental/ExperimentalInitializer.java
  97. +17
    -17
      smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/CarbonManager.java
  98. +4
    -4
      smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/packet/CarbonExtension.java
  99. +1
    -1
      smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/provider/CarbonManagerProvider.java
  100. +4
    -4
      smack-experimental/src/main/java/org/jivesoftware/smackx/chat_markers/ChatMarkersManager.java

+ 8
- 10
config/checkstyle.xml View File

@@ -44,21 +44,19 @@
<!--
Explaining the following Regex

^ \s* [\S && [^ \*/]]+ \s+ $
| | | | | +- End of Line (6)
| | | | +- At least one whitespace (5)
| | | +- At least one or more of the previous character class (4)
| | +- All non-whitespace characters except '*' and '/' (to exclude javadoc) (3)
| +- Zero or more space characters (2)
+- Start of Line (1)
\s+ $
| +- End of Line (2)
+- At least one whitespace (1)

Rationale:
Matches trailing whitespace (5) in lines containing at least one (4) non-whitespace character
that is not one of the characters used by javadoc (3).
Matches trailing whitespace (2) in lines containing at least one (1) non-whitespace character
-->
<property name="format" value="^\s*[\S&amp;&amp;[^\*/]]+\s+$"/>
<property name="format" value="\s+$"/>
<property name="message" value="Line containing trailing whitespace character(s)"/>
</module>
<!-- <module name="RegexpSingleline"> -->
<!-- <property name="format" value="fqdn"/> -->
<!-- </module> -->
<module name="RegexpSingleline">
<property name="format" value="^\s*//[^\s]"/>
<property name="message" value="Comment start ('//') followed by non-space character. You would not continue after a punctuation without a space, would you?"/>


+ 1
- 1
smack-bosh/src/main/java/org/jivesoftware/smack/bosh/BOSHConfiguration.java View File

@@ -26,7 +26,7 @@ import org.jivesoftware.smack.proxy.ProxyInfo;
/**
* Configuration to use while establishing the connection to the XMPP server via
* HTTP binding.
*
*
* @see XMPPBOSHConnection
* @author Guenther Niess
*/


+ 7
- 7
smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java View File

@@ -64,7 +64,7 @@ import org.xmlpull.v1.XmlPullParserFactory;
/**
* Creates a connection to an XMPP server via HTTP binding.
* This is specified in the XEP-0206: XMPP Over BOSH.
*
*
* @see XMPPConnection
* @author Guenther Niess
*/
@@ -109,7 +109,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {

/**
* Create a HTTP Binding connection to an XMPP server.
*
*
* @param username the username to use.
* @param password the password to use.
* @param https true if you want to use SSL
@@ -131,7 +131,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {

/**
* Create a HTTP Binding connection to an XMPP server.
*
*
* @param config The configuration which is used for this connection.
*/
public XMPPBOSHConnection(BOSHConfiguration config) {
@@ -191,7 +191,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
// If there is no feedback, throw an remote server timeout error
if (!connected && !done) {
done = true;
String errorMessage = "Timeout reached for the connection to "
String errorMessage = "Timeout reached for the connection to "
+ getHost() + ":" + getPort() + ".";
throw new SmackException(errorMessage);
}
@@ -246,7 +246,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
}

/**
* Closes the connection by setting presence to unavailable and closing the
* Closes the connection by setting presence to unavailable and closing the
* HTTP client. The shutdown logic will be used during a planned disconnection or when
* dealing with an unexpected disconnection. Unlike {@link #disconnect()} the connection's
* BOSH stanza reader will not be removed; thus connection's state is kept.
@@ -289,7 +289,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {

/**
* Send a HTTP request to the connection manager with the provided body element.
*
*
* @param body the body which will be sent.
* @throws BOSHException
*/
@@ -405,7 +405,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
/**
* A listener class which listen for a successfully established connection
* and connection errors and notifies the BOSHConnection.
*
*
* @author Guenther Niess
*/
private class BOSHConnectionListener implements BOSHClientConnListener {


+ 2
- 2
smack-compression-jzlib/src/main/java/org/jivesoftware/smack/compression/jzlib/JzlibInputOutputStream.java View File

@@ -28,10 +28,10 @@ import com.jcraft.jzlib.InflaterInputStream;

/**
* This class provides XMPP "zlib" compression with the help of JZLib.
*
*
* @author Florian Schmaus
* @see <a href="http://www.jcraft.com/jzlib/">JZLib</a>
*
*
*/
public class JzlibInputOutputStream extends XMPPInputOutputStream {



+ 1
- 1
smack-core/src/integration-test/java/org/jivesoftware/smack/IQTest.java View File

@@ -72,7 +72,7 @@ public class IQTest extends SmackTestCase {

/**
* Check that sending an IQ to a full JID that is offline returns an IQ ERROR instead
* of being route to some other resource of the same user.
* of being route to some other resource of the same user.
*/
public void testFullJIDToOfflineUser() {
// Request the version from the server.


+ 1
- 1
smack-core/src/integration-test/java/org/jivesoftware/smack/LoginTest.java View File

@@ -21,7 +21,7 @@ import org.jivesoftware.smack.test.SmackTestCase;
import org.jivesoftware.smack.util.StringUtils;

/**
* Includes set of login tests.
* Includes set of login tests.
*
* @author Gaston Dombiak
*/


+ 2
- 2
smack-core/src/integration-test/java/org/jivesoftware/smack/MessageTest.java View File

@@ -213,7 +213,7 @@ public class MessageTest extends SmackTestCase {
StanzaCollector collector = getConnection(0).createStanzaCollector(new MessageTypeFilter(Message.Type.chat));
StanzaCollector coll3 = conn3.createStanzaCollector(new MessageTypeFilter(Message.Type.chat));

// User1 sends a message to the bare JID of User0
// User1 sends a message to the bare JID of User0
Chat chat = getConnection(1).getChatManager().createChat(getBareJID(0), null);
chat.sendMessage("Test 1");
chat.sendMessage("Test 2");
@@ -325,7 +325,7 @@ public class MessageTest extends SmackTestCase {
StanzaCollector coll3 = conn3.createStanzaCollector(new MessageTypeFilter(Message.Type.chat));
StanzaCollector coll4 = conn4.createStanzaCollector(new MessageTypeFilter(Message.Type.chat));

// Send a message from this resource to indicate most recent activity
// Send a message from this resource to indicate most recent activity
conn3.sendStanza(new Message("admin@" + getXMPPServiceDomain()));

// User1 sends a message to the bare JID of User0


+ 1
- 1
smack-core/src/integration-test/java/org/jivesoftware/smack/PrivacyClient.java View File

@@ -22,7 +22,7 @@ import org.jivesoftware.smack.packet.PrivacyItem;
/**
* This class supports automated tests about privacy communication from the
* server to the client.
*
*
* @author Francisco Vives
*/



+ 1
- 1
smack-core/src/integration-test/java/org/jivesoftware/smack/ReconnectionTest.java View File

@@ -208,7 +208,7 @@ public class ReconnectionTest extends SmackTestCase {
private CountDownLatch countDownLatch;

private XMPPTCPConnectionTestListener(CountDownLatch latch) {
countDownLatch = latch;
countDownLatch = latch;
}

private XMPPTCPConnectionTestListener() {


+ 1
- 1
smack-core/src/integration-test/java/org/jivesoftware/smack/RosterInitializedBeforeConnectTest.java View File

@@ -17,7 +17,7 @@ package org.jivesoftware.smack;
/**
* Run all tests defined in RosterTest but initialize the roster before connection is logged in and
* authenticated.
*
*
* @author Henning Staib
*/
public class RosterInitializedBeforeConnectTest extends RosterSmackTest {


+ 1
- 1
smack-core/src/integration-test/java/org/jivesoftware/smack/RosterListenerTest.java View File

@@ -24,7 +24,7 @@ import org.jivesoftware.smack.test.SmackTestCase;

/**
* Test cases for adding the {@link RosterListener} in different connection states.
*
*
* @author Henning Staib
*/
public class RosterListenerTest extends SmackTestCase {


+ 4
- 4
smack-core/src/integration-test/java/org/jivesoftware/smack/RosterSmackTest.java View File

@@ -78,7 +78,7 @@ public class RosterSmackTest extends SmackTestCase {

@Override
public void entriesAdded(Collection<String> addresses) {}
};
};

roster.addRosterListener(latchCounter);

@@ -422,7 +422,7 @@ public class RosterSmackTest extends SmackTestCase {

/**
* Test presence management.<p>
*
*
* 1. Log in user0 from a client and user1 from 2 clients
* 2. Create presence subscription of type BOTH between 2 users
* 3. Check that presence is correctly delivered to both users
@@ -699,12 +699,12 @@ public class RosterSmackTest extends SmackTestCase {
public void entriesUpdated(Collection<String> addresses) {}

@Override
public void entriesDeleted(Collection<String> addresses) {
public void entriesDeleted(Collection<String> addresses) {
latch.countDown();
}

@Override
public void entriesAdded(Collection<String> addresses) {}
};
};

}

+ 5
- 5
smack-core/src/integration-test/java/org/jivesoftware/smack/packet/PrivacyProviderTest.java View File

@@ -22,9 +22,9 @@ import org.xmlpull.v1.XmlPullParserException;

import java.io.StringReader;

/**
/**
* Test the PrivacyProvider class with valids privacy xmls
*
*
* @author Francisco Vives
*/
public class PrivacyProviderTest extends SmackTestCase {
@@ -47,7 +47,7 @@ public class PrivacyProviderTest extends SmackTestCase {
}

/**
* Check the parser with an xml with all kind of stanzas.
* Check the parser with an xml with all kind of stanzas.
* To create the xml string based from an xml file, replace:\n with: "\n + "
*/
public void testFull() {
@@ -296,7 +296,7 @@ public class PrivacyProviderTest extends SmackTestCase {


/**
* Check the parser with an xml with empty lists. It includes the active,
* Check the parser with an xml with empty lists. It includes the active,
* default and special list.
* To create the xml string based from an xml file, replace:\n with: "\n + "
*/
@@ -338,7 +338,7 @@ public class PrivacyProviderTest extends SmackTestCase {
}

/**
* Check the parser with an xml with empty lists. It includes the active,
* Check the parser with an xml with empty lists. It includes the active,
* default and special list.
* To create the xml string based from an xml file, replace:\n with: "\n + "
*/


+ 2
- 2
smack-core/src/integration-test/java/org/jivesoftware/smack/packet/PrivacyTest.java View File

@@ -452,7 +452,7 @@ public class PrivacyTest extends SmackTestCase {
// Look for the same server and original items
receivedItem = privacyItems.get(j);
index = 0;
while ((index < originalPrivacyItems.length)
while ((index < originalPrivacyItems.length)
&& (originalPrivacyItems[index].getOrder() != receivedItem.getOrder())) {
index++;
}
@@ -484,7 +484,7 @@ public class PrivacyTest extends SmackTestCase {
/**
* This class supports automated tests about privacy communication from the
* server to the client.
*
*
* @author Francisco Vives
*/



+ 41
- 41
smack-core/src/integration-test/java/org/jivesoftware/smack/test/SmackTestCase.java View File

@@ -36,17 +36,17 @@ import org.xmlpull.v1.XmlPullParserFactory;
import org.xmlpull.v1.XmlPullParser;

/**
* Base class for all the test cases which provides a pre-configured execution context. This
* means that any test case that subclassifies this base class will have access to a pool of
* Base class for all the test cases which provides a pre-configured execution context. This
* means that any test case that subclassifies this base class will have access to a pool of
* connections and to the user of each connection. The maximum number of connections in the pool
* can be controlled by the message {@link #getMaxConnections()} which every subclass must
* implement.<p>
*
* This base class defines a default execution context (i.e. host, port, chat domain and muc
* can be controlled by the message {@link #getMaxConnections()} which every subclass must
* implement.<p>
*
* This base class defines a default execution context (i.e. host, port, chat domain and muc
* domain) which can be found in the file "config/test-case.xml". However, each subclass could
* redefine the default configuration by providing its own configuration file (if desired). The
* name of the configuration file must be of the form <test class name>.xml (e.g. RosterTest.xml).
* The file must be placed in the folder "config". This folder is where the default configuration
* The file must be placed in the folder "config". This folder is where the default configuration
* file is being held.
*
* @author Gaston Dombiak
@@ -81,21 +81,21 @@ public abstract class SmackTestCase extends TestCase {
}

/**
* Returns the maximum number of connections to initialize for this test case. All the
* initialized connections will be connected to the server using a new test account for
* each conection.
*
* Returns the maximum number of connections to initialize for this test case. All the
* initialized connections will be connected to the server using a new test account for
* each conection.
*
* @return the maximum number of connections to initialize for this test case.
*/
protected abstract int getMaxConnections();

/**
* Returns a SocketFactory that will be used to create the socket to the XMPP server. By
* Returns a SocketFactory that will be used to create the socket to the XMPP server. By
* default no SocketFactory is used but subclasses my want to redefine this method.<p>
*
* A custom SocketFactory allows fine-grained control of the actual connection to the XMPP
*
* A custom SocketFactory allows fine-grained control of the actual connection to the XMPP
* server. A typical use for a custom SocketFactory is when connecting through a SOCKS proxy.
*
*
* @return a SocketFactory that will be used to create the socket to the XMPP server.
*/
protected SocketFactory getSocketFactory() {
@@ -111,7 +111,7 @@ public abstract class SmackTestCase extends TestCase {
* <p>
* Connections are connected by default.
* Overwrite this method if the test case needs unconnected connections.
*
*
* @return <code>true</code> if connections should NOT be connected automatically,
* <code>false</code> if connections should be connected automatically.
*/
@@ -123,11 +123,11 @@ public abstract class SmackTestCase extends TestCase {
* Returns the XMPPTCPConnection located at the requested position. Each test case holds a
* pool of connections which is initialized while setting up the test case. The maximum
* number of connections is controlled by the message {@link #getMaxConnections()} which
* every subclass must implement.<p>
*
* If the requested position is greater than the connections size then an
* IllegalArgumentException will be thrown.
*
* every subclass must implement.<p>
*
* If the requested position is greater than the connections size then an
* IllegalArgumentException will be thrown.
*
* @param index the position in the pool of the connection to look for.
* @return the XMPPTCPConnection located at the requested position.
*/
@@ -156,9 +156,9 @@ public abstract class SmackTestCase extends TestCase {
}

/**
* Returns the name of the user (e.g. johndoe) that is using the connection
* Returns the name of the user (e.g. johndoe) that is using the connection
* located at the requested position.
*
*
* @param index the position in the pool of the connection to look for.
* @return the user of the user (e.g. johndoe).
*/
@@ -167,9 +167,9 @@ public abstract class SmackTestCase extends TestCase {
}

/**
* Returns the password of the user (e.g. johndoe) that is using the connection
* Returns the password of the user (e.g. johndoe) that is using the connection
* located at the requested position.
*
*
* @param index the position in the pool of the connection to look for.
* @return the password of the user (e.g. johndoe).
*/
@@ -180,7 +180,7 @@ public abstract class SmackTestCase extends TestCase {
/**
* Returns the bare XMPP address of the user (e.g. johndoe@jabber.org) that is
* using the connection located at the requested position.
*
*
* @param index the position in the pool of the connection to look for.
* @return the bare XMPP address of the user (e.g. johndoe@jabber.org).
*/
@@ -191,7 +191,7 @@ public abstract class SmackTestCase extends TestCase {
/**
* Returns the full XMPP address of the user (e.g. johndoe@jabber.org/Smack) that is
* using the connection located at the requested position.
*
*
* @param index the position in the pool of the connection to look for.
* @return the full XMPP address of the user (e.g. johndoe@jabber.org/Smack).
*/
@@ -213,7 +213,7 @@ public abstract class SmackTestCase extends TestCase {

/**
* Returns the default groupchat service domain.
*
*
* @return the default groupchat service domain.
*/
protected String getChatDomain() {
@@ -222,7 +222,7 @@ public abstract class SmackTestCase extends TestCase {

/**
* Returns the default MUC service domain.
*
*
* @return the default MUC service domain.
*/
protected String getMUCDomain() {
@@ -273,7 +273,7 @@ public abstract class SmackTestCase extends TestCase {
if (!getConnection(0).getAccountManager().supportsAccountCreation())
fail("Server does not support account creation");

// Create the account and try logging in again as the
// Create the account and try logging in again as the
// same user.
try {
createAccount(i, currentUser, currentPassword);
@@ -345,7 +345,7 @@ public abstract class SmackTestCase extends TestCase {
con.login(getUsername(i), getUsername(i));
}
else if (!getConnection(i).isAuthenticated()) {
getConnection(i).login(getUsername(i), getUsername(i));
getConnection(i).login(getUsername(i), getUsername(i));
}
// Delete the created account for the test
getConnection(i).getAccountManager().deleteAccount();
@@ -366,22 +366,22 @@ public abstract class SmackTestCase extends TestCase {
}

/**
* Initializes the context of the test case. We will first try to load the configuration from
* a file whose name is conformed by the test case class name plus an .xml extension
* (e.g RosterTest.xml). If no file was found under that name then we will try to load the
* Initializes the context of the test case. We will first try to load the configuration from
* a file whose name is conformed by the test case class name plus an .xml extension
* (e.g RosterTest.xml). If no file was found under that name then we will try to load the
* default configuration for all the test cases from the file "config/test-case.xml".
*
*/
private void init() {
try {
boolean found = false;
// Try to load the configutation from an XML file specific for this test case
// Try to load the configutation from an XML file specific for this test case
Enumeration<URL> resources =
ClassLoader.getSystemClassLoader().getResources(getConfigurationFilename());
while (resources.hasMoreElements()) {
found = parseURL(resources.nextElement());
}
// If none was found then try to load the configuration from the default configuration
// If none was found then try to load the configuration from the default configuration
// file (i.e. "config/test-case.xml")
if (!found) {
resources = ClassLoader.getSystemClassLoader().getResources("config/test-case.xml");
@@ -401,8 +401,8 @@ public abstract class SmackTestCase extends TestCase {
/**
* Returns true if the given URL was found and parsed without problems. The file provided
* by the URL must contain information useful for the test case configuration, such us,
* host and port of the server.
*
* host and port of the server.
*
* @param url the url of the file to parse.
* @return true if the given URL was found and parsed without problems.
*/
@@ -487,11 +487,11 @@ public abstract class SmackTestCase extends TestCase {
}

/**
* Returns the name of the configuration file related to <b>this</b> test case. By default all
* Returns the name of the configuration file related to <b>this</b> test case. By default all
* the test cases will use the same configuration file. However, it's possible to override the
* default configuration by providing a file of the form <test case class name>.xml
* (e.g. RosterTest.xml).
*
*
* @return the name of the configuration file related to this test case.
*/
private String getConfigurationFilename() {
@@ -502,7 +502,7 @@ public abstract class SmackTestCase extends TestCase {

/**
* Subscribes all connections with each other: They all become friends
*
*
* @throws XMPPException
*/
protected void letsAllBeFriends() throws XMPPException {


+ 1
- 1
smack-core/src/main/java/org/jivesoftware/smack/AbstractConnectionListener.java View File

@@ -21,7 +21,7 @@ package org.jivesoftware.smack;
* methods defined by the {@link ConnectionListener} interface. This is a
* convenience class which should be used in case you do not need to implement
* all methods.
*
*
* @author Henning Staib
*/
public class AbstractConnectionListener implements ConnectionListener {


+ 26
- 26
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java View File

@@ -100,7 +100,7 @@ import org.xmlpull.v1.XmlPullParser;
public abstract class AbstractXMPPConnection implements XMPPConnection {
private static final Logger LOGGER = Logger.getLogger(AbstractXMPPConnection.class.getName());

/**
/**
* Counter to uniquely identify connections that are created.
*/
private static final AtomicInteger connectionCounter = new AtomicInteger(0);
@@ -293,7 +293,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {

/**
* Create a new XMPPConnection to an XMPP server.
*
*
* @param configuration The configuration which is used to establish the connection.
*/
protected AbstractXMPPConnection(ConnectionConfiguration configuration) {
@@ -355,12 +355,12 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* <p>
* Listeners will be preserved from a previous connection.
* </p>
*
*
* @throws XMPPException if an error occurs on the XMPP protocol level.
* @throws SmackException if an error occurs somewhere else besides XMPP protocol level.
* @throws IOException
* @throws IOException
* @return a reference to this object, to chain <code>connect()</code> with <code>login()</code>.
* @throws InterruptedException
* @throws InterruptedException
*/
public synchronized AbstractXMPPConnection connect() throws SmackException, IOException, XMPPException, InterruptedException {
// Check if not already connected
@@ -395,11 +395,11 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* Abstract method that concrete subclasses of XMPPConnection need to implement to perform their
* way of XMPP connection establishment. Implementations are required to perform an automatic
* login if the previous connection state was logged (authenticated).
*
*
* @throws SmackException
* @throws IOException
* @throws XMPPException
* @throws InterruptedException
* @throws InterruptedException
*/
protected abstract void connectInternal() throws SmackException, IOException, XMPPException, InterruptedException;

@@ -412,7 +412,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {

/**
* Logs in to the server using the strongest SASL mechanism supported by
* the server. If more than the connection's default stanza timeout elapses in each step of the
* the server. If more than the connection's default stanza timeout elapses in each step of the
* authentication process without a response from the server, a
* {@link SmackException.NoResponseException} will be thrown.
* <p>
@@ -427,11 +427,11 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* {@link ConnectionConfiguration.Builder#setCallbackHandler(javax.security.auth.callback.CallbackHandler)}.
* For more advanced login settings see {@link ConnectionConfiguration}.
* </p>
*
*
* @throws XMPPException if an error occurs on the XMPP protocol level.
* @throws SmackException if an error occurs somewhere else besides XMPP protocol level.
* @throws IOException if an I/O error occurs during login.
* @throws InterruptedException
* @throws InterruptedException
*/
public synchronized void login() throws XMPPException, SmackException, IOException, InterruptedException {
// The previously used username, password and resource take over precedence over the
@@ -445,13 +445,13 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Same as {@link #login(CharSequence, String, Resourcepart)}, but takes the resource from the connection
* configuration.
*
*
* @param username
* @param password
* @throws XMPPException
* @throws SmackException
* @throws IOException
* @throws InterruptedException
* @throws InterruptedException
* @see #login
*/
public synchronized void login(CharSequence username, String password) throws XMPPException, SmackException,
@@ -462,14 +462,14 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Login with the given username (authorization identity). You may omit the password if a callback handler is used.
* If resource is null, then the server will generate one.
*
*
* @param username
* @param password
* @param resource
* @throws XMPPException
* @throws SmackException
* @throws IOException
* @throws InterruptedException
* @throws InterruptedException
* @see #login
*/
public synchronized void login(CharSequence username, String password, Resourcepart resource) throws XMPPException,
@@ -580,7 +580,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* Get the name of the SASL mechanism that was used to authenticate this connection. This returns the name of
* mechanism which was used the last time this connection was authenticated, and will return <code>null</code> if
* this connection was not authenticated before.
*
*
* @return the name of the used SASL mechanism.
* @since 4.2
*/
@@ -674,7 +674,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Returns the SASLAuthentication manager that is responsible for authenticating with
* the server.
*
*
* @return the SASLAuthentication manager that is responsible for authenticating with
* the server.
*/
@@ -708,9 +708,9 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* information such as "On vacation". Typically, just the status text of the presence
* stanza is set with online information, but most XMPP servers will deliver the full
* presence stanza with whatever data is set.
*
*
* @param unavailablePresence the optional presence stanza to send during shutdown.
* @throws NotConnectedException
* @throws NotConnectedException
*/
public synchronized void disconnect(Presence unavailablePresence) throws NotConnectedException {
if (unavailablePresence != null) {
@@ -871,7 +871,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* <p>
* Compared to {@link #firePacketInterceptors(Stanza)}, the listeners will be invoked in a new thread.
* </p>
*
*
* @param packet the stanza to process.
*/
@SuppressWarnings("javadoc")
@@ -946,7 +946,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* Since the thread that requested to send the stanza will invoke all interceptors, it
* is important that interceptors perform their work as soon as possible so that the
* thread does not remain blocked for a long period.
*
*
* @param packet the stanza that is going to be sent to the server
*/
private void firePacketInterceptors(Stanza packet) {
@@ -970,7 +970,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Initialize the {@link #debugger}. You can specify a customized {@link SmackDebugger}
* by setup the system property <code>smack.debuggerClass</code> to the implementation.
*
*
* @throws IllegalStateException if the reader or writer isn't yet initialized.
* @throws IllegalArgumentException if the SmackDebugger can't be loaded.
*/
@@ -1208,7 +1208,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Sets whether the connection has already logged in the server. This method assures that the
* {@link #wasAuthenticated} flag is never reset once it has ever been set.
*
*
*/
protected void setWasAuthenticated() {
// Never reset the flag if the connection has ever been authenticated
@@ -1284,7 +1284,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {

/**
* Create a class which associates a stanza filter with a listener.
*
*
* @param packetListener the stanza listener.
* @param packetFilter the associated filter or null if it listen for all packets.
*/
@@ -1312,7 +1312,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {

/**
* Create a class which associates a stanza filter with an interceptor.
*
*
* @param packetInterceptor the interceptor.
* @param packetFilter the associated filter or null if it intercepts all packets.
*/
@@ -1681,7 +1681,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Install a parsing exception callback, which will be invoked once an exception is encountered while parsing a
* stanza.
*
*
* @param callback the callback to install
*/
public void setParsingExceptionCallback(ParsingExceptionCallback callback) {
@@ -1690,7 +1690,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {

/**
* Get the current active parsing exception callback.
*
*
* @return the active exception callback or null if there is none
*/
public ParsingExceptionCallback getParsingExceptionCallback() {


+ 15
- 15
smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java View File

@@ -107,12 +107,12 @@ public abstract class ConnectionConfiguration {
private final X509TrustManager customX509TrustManager;

/**
*
*
*/
private final String[] enabledSSLProtocols;

/**
*
*
*/
private final String[] enabledSSLCiphers;

@@ -210,7 +210,7 @@ public abstract class ConnectionConfiguration {
}

/**
* Retuns the path to the keystore file. The key store file contains the
* Retuns the path to the keystore file. The key store file contains the
* certificates that may be used to authenticate the client to the server,
* in the event the server requests or requires it.
*
@@ -271,7 +271,7 @@ public abstract class ConnectionConfiguration {
* Returns the configured HostnameVerifier of this ConnectionConfiguration or the Smack default
* HostnameVerifier configured with
* {@link SmackConfiguration#setDefaultHostnameVerifier(HostnameVerifier)}.
*
*
* @return a configured HostnameVerifier or <code>null</code>
*/
public HostnameVerifier getHostnameVerifier() {
@@ -305,7 +305,7 @@ public abstract class ConnectionConfiguration {
/**
* Returns the socket factory used to create new xmppConnection sockets.
* This is useful when connecting through SOCKS5 proxies.
*
*
* @return socketFactory used to create new sockets.
*/
public SocketFactory getSocketFactory() {
@@ -413,7 +413,7 @@ public abstract class ConnectionConfiguration {

/**
* Returns the optional XMPP address to be requested as the SASL authorization identity.
*
*
* @return the authorization identifier.
* @see <a href="http://tools.ietf.org/html/rfc6120#section-6.3.8">RFC 6120 § 6.3.8. Authorization Identity</a>
* @since 4.2
@@ -689,7 +689,7 @@ public abstract class ConnectionConfiguration {
}

/**
* Sets the path to the keystore file. The key store file contains the
* Sets the path to the keystore file. The key store file contains the
* certificates that may be used to authenticate the client to the server,
* in the event the server requests or requires it.
*
@@ -752,8 +752,8 @@ public abstract class ConnectionConfiguration {

/**
* Set the enabled SSL/TLS ciphers.
*
* @param enabledSSLCiphers the enabled SSL/TLS ciphers
*
* @param enabledSSLCiphers the enabled SSL/TLS ciphers
* @return a reference to this builder.
*/
public B setEnabledSSLCiphers(String[] enabledSSLCiphers) {
@@ -764,7 +764,7 @@ public abstract class ConnectionConfiguration {
/**
* Set the HostnameVerifier used to verify the hostname of SSLSockets used by XMPP connections
* created with this ConnectionConfiguration.
*
*
* @param verifier
* @return a reference to this builder.
*/
@@ -795,7 +795,7 @@ public abstract class ConnectionConfiguration {

/**
* Set the Smack debugger factory used to construct Smack debuggers.
*
*
* @param debuggerFactory the Smack debugger factory.
* @return a reference to this builder.
*/
@@ -832,7 +832,7 @@ public abstract class ConnectionConfiguration {
*
* Some SASL mechanisms (e.g. SASL External) may also signal the username (as "authorization identity"), in
* which case Smack should not throw an IllegalArgumentException when the username is not set.
*
*
* @return a reference to this builder.
*/
public B allowEmptyOrNullUsernames() {
@@ -843,7 +843,7 @@ public abstract class ConnectionConfiguration {
/**
* Perform anonymous authentication using SASL ANONYMOUS. Your XMPP service must support this authentication
* mechanism. This method also calls {@link #addEnabledSaslMechanism(String)} with "ANONYMOUS" as argument.
*
*
* @return a reference to this builder.
*/
public B performSaslAnonymousAuthentication() {
@@ -902,7 +902,7 @@ public abstract class ConnectionConfiguration {
* Enable the given SASL mechanisms. If you never add a mechanism to the set of enabled ones, <b>all mechanisms
* known to Smack</b> will be enabled. Only explicitly enable particular SASL mechanisms if you want to limit
* the used mechanisms to the enabled ones.
*
*
* @param saslMechanisms a collection of names of mechanisms to enable.
* @return a reference to this builder.
*/
@@ -935,7 +935,7 @@ public abstract class ConnectionConfiguration {
* service domain, which should typically match.
* Calling this will also SASL CRAM, since this mechanism does not support authzid.
* </p>
*
*
* @param authzid The BareJid to be requested as the authorization identifier.
* @return a reference to this builder.
* @see <a href="http://tools.ietf.org/html/rfc6120#section-6.3.8">RFC 6120 § 6.3.8. Authorization Identity</a>


+ 1
- 1
smack-core/src/main/java/org/jivesoftware/smack/ConnectionCreationListener.java View File

@@ -30,7 +30,7 @@ public interface ConnectionCreationListener {
/**
* Notification that a new connection has been created. The new connection
* will not yet be connected to the server.
*
*
* @param connection the newly created connection.
*/
void connectionCreated(XMPPConnection connection);


+ 1
- 1
smack-core/src/main/java/org/jivesoftware/smack/ConnectionListener.java View File

@@ -23,7 +23,7 @@ package org.jivesoftware.smack;
*
* @see XMPPConnection#addConnectionListener
* @see XMPPConnection#removeConnectionListener
*
*
* @author Matt Tucker
*/
public interface ConnectionListener {


+ 7
- 7
smack-core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java View File

@@ -44,7 +44,7 @@ import org.jivesoftware.smack.util.Async;
* <li>If that fails it will indefinitely try to connect once every five minutes.
* </ol>
*
* {@link ReconnectionPolicy#FIXED_DELAY} - The reconnection mechanism will try to reconnect after a fixed delay
* {@link ReconnectionPolicy#FIXED_DELAY} - The reconnection mechanism will try to reconnect after a fixed delay
* independently from the number of reconnection attempts already performed.
* <p>
* Interrupting the reconnection thread will abort the reconnection mechanism.
@@ -60,7 +60,7 @@ public final class ReconnectionManager {

/**
* Get a instance of ReconnectionManager for the given connection.
*
*
* @param connection
* @return a ReconnectionManager for the connection.
*/
@@ -89,7 +89,7 @@ public final class ReconnectionManager {
/**
* Set if the automatic reconnection mechanism will be enabled per default for new XMPP connections. The default is
* 'false'.
*
*
* @param enabled
*/
public static void setEnabledPerDefault(boolean enabled) {
@@ -121,7 +121,7 @@ public final class ReconnectionManager {
/**
* Set the default fixed delay in seconds between the reconnection attempts. Also set the
* default connection policy to {@link ReconnectionPolicy#FIXED_DELAY}
*
*
* @param fixedDelay Delay expressed in seconds
*/
public static void setDefaultFixedDelay(int fixedDelay) {
@@ -131,7 +131,7 @@ public final class ReconnectionManager {

/**
* Set the default Reconnection Policy to use.
*
*
* @param reconnectionPolicy
*/
public static void setDefaultReconnectionPolicy(ReconnectionPolicy reconnectionPolicy) {
@@ -162,7 +162,7 @@ public final class ReconnectionManager {
/**
* Set the fixed delay in seconds between the reconnection attempts Also set the connection
* policy to {@link ReconnectionPolicy#FIXED_DELAY}.
*
*
* @param fixedDelay Delay expressed in seconds
*/
public void setFixedDelay(int fixedDelay) {
@@ -172,7 +172,7 @@ public final class ReconnectionManager {

/**
* Set the Reconnection Policy to use.
*
*
* @param reconnectionPolicy
*/
public void setReconnectionPolicy(ReconnectionPolicy reconnectionPolicy) {


+ 6
- 6
smack-core/src/main/java/org/jivesoftware/smack/SASLAuthentication.java View File

@@ -114,7 +114,7 @@ public final class SASLAuthentication {
/**
* Unregister a SASLMechanism by it's full class name. For example
* "org.jivesoftware.smack.sasl.javax.SASLCramMD5Mechanism".
*
*
* @param clazz the SASLMechanism class's name
* @return true if the given SASLMechanism was removed, false otherwise
*/
@@ -228,10 +228,10 @@ public final class SASLAuthentication {
/**
* Wrapper for {@link #challengeReceived(String, boolean)}, with <code>finalChallenge</code> set
* to <code>false</code>.
*
*
* @param challenge a base64 encoded string representing the challenge.
* @throws SmackException
* @throws InterruptedException
* @throws InterruptedException
*/
public void challengeReceived(String challenge) throws SmackException, InterruptedException {
challengeReceived(challenge, false);
@@ -261,8 +261,8 @@ public final class SASLAuthentication {
* Notification message saying that SASL authentication was successful. The next step
* would be to bind the resource.
* @param success result of the authentication.
* @throws SmackException
* @throws InterruptedException
* @throws SmackException
* @throws InterruptedException
*/
public void authenticated(Success success) throws SmackException, InterruptedException {
// RFC6120 6.3.10 "At the end of the authentication exchange, the SASL server (the XMPP
@@ -284,7 +284,7 @@ public final class SASLAuthentication {
/**
* Notification message saying that SASL authentication has failed. The server may have
* closed the connection depending on the number of possible retries.
*
*
* @param saslFailure the SASL failure as reported by the server
* @see <a href="https://tools.ietf.org/html/rfc6120#section-6.5">RFC6120 6.5</a>
*/


+ 12
- 12
smack-core/src/main/java/org/jivesoftware/smack/SmackConfiguration.java View File

@@ -44,7 +44,7 @@ import org.jivesoftware.smack.util.Objects;
* </ul>
*
* Configuration settings are stored in org.jivesoftware.smack/smack-config.xml.
*
*
* @author Gaston Dombiak
*/
public final class SmackConfiguration {
@@ -86,7 +86,7 @@ public final class SmackConfiguration {

/**
* Returns the Smack version information, eg "1.3.0".
*
*
* @return the Smack version information.
*/
public static String getVersion() {
@@ -96,7 +96,7 @@ public final class SmackConfiguration {
/**
* Returns the number of milliseconds to wait for a response from
* the server. The default value is 5000 ms.
*
*
* @return the milliseconds to wait for a response from the server
* @deprecated use {@link #getDefaultReplyTimeout()} instead.
*/
@@ -108,7 +108,7 @@ public final class SmackConfiguration {
/**
* Sets the number of milliseconds to wait for a response from
* the server.
*
*
* @param timeout the milliseconds to wait for a response from the server
* @deprecated use {@link #setDefaultReplyTimeout(int)} instead.
*/
@@ -120,7 +120,7 @@ public final class SmackConfiguration {
/**
* Returns the number of milliseconds to wait for a response from
* the server. The default value is 5000 ms.
*
*
* @return the milliseconds to wait for a response from the server
*/
public static int getDefaultReplyTimeout() {
@@ -134,7 +134,7 @@ public final class SmackConfiguration {
/**
* Sets the number of milliseconds to wait for a response from
* the server.
*
*
* @param timeout the milliseconds to wait for a response from the server
*/
public static void setDefaultReplyTimeout(int timeout) {
@@ -153,9 +153,9 @@ public final class SmackConfiguration {
}

/**
* Gets the default max size of a stanza collector before it will delete
* Gets the default max size of a stanza collector before it will delete
* the older packets.
*
*
* @return The number of packets to queue before deleting older packets.
*/
public static int getStanzaCollectorSize() {
@@ -163,9 +163,9 @@ public final class SmackConfiguration {
}

/**
* Sets the default max size of a stanza collector before it will delete
* Sets the default max size of a stanza collector before it will delete
* the older packets.
*
*
* @param collectorSize the number of packets to queue before deleting older packets.
*/
public static void setStanzaCollectorSize(int collectorSize) {
@@ -235,7 +235,7 @@ public final class SmackConfiguration {

/**
* Returns the default parsing exception callback.
*
*
* @return the default parsing exception callback
* @see ParsingExceptionCallback
*/
@@ -334,7 +334,7 @@ public final class SmackConfiguration {

/**
* Check if Smack was successfully initialized.
*
*
* @return true if smack was initialized, false otherwise
*/
public static boolean isSmackInitialized() {


+ 16
- 16
smack-core/src/main/java/org/jivesoftware/smack/SmackException.java View File

@@ -26,19 +26,19 @@ import org.jxmpp.jid.Jid;

/**
* Smack uses SmackExceptions for errors that are not defined by any XMPP specification.
*
*
* @author Florian Schmaus
*/
public class SmackException extends Exception {

/**
*
*
*/
private static final long serialVersionUID = 1844674365368214457L;

/**
* Creates a new SmackException with the Throwable that was the root cause of the exception.
*
*
* @param wrappedThrowable the root cause of the exception.
*/
public SmackException(Throwable wrappedThrowable) {
@@ -63,7 +63,7 @@ public class SmackException extends Exception {
*/
public static final class NoResponseException extends SmackException {
/**
*
*
*/
private static final long serialVersionUID = -6523363748984543636L;

@@ -124,7 +124,7 @@ public class SmackException extends Exception {
public static class NotLoggedInException extends SmackException {

/**
*
*
*/
private static final long serialVersionUID = 3216216839100019278L;

@@ -136,7 +136,7 @@ public class SmackException extends Exception {
public static class AlreadyLoggedInException extends SmackException {

/**
*
*
*/
private static final long serialVersionUID = 5011416918049935231L;

@@ -148,7 +148,7 @@ public class SmackException extends Exception {
public static class AlreadyConnectedException extends SmackException {

/**
*
*
*/
private static final long serialVersionUID = 5011416918049135231L;

@@ -160,7 +160,7 @@ public class SmackException extends Exception {
public static class NotConnectedException extends SmackException {

/**
*
*
*/
private static final long serialVersionUID = 9197980400776001173L;

@@ -187,7 +187,7 @@ public class SmackException extends Exception {
public static class IllegalStateChangeException extends SmackException {

/**
*
*
*/
private static final long serialVersionUID = -1766023961577168927L;

@@ -198,7 +198,7 @@ public class SmackException extends Exception {
public abstract static class SecurityRequiredException extends SmackException {

/**
*
*
*/
private static final long serialVersionUID = 384291845029773545L;

@@ -209,7 +209,7 @@ public class SmackException extends Exception {

public static class SecurityRequiredByClientException extends SecurityRequiredException {
/**
*
*
*/
private static final long serialVersionUID = 2395325821201543159L;

@@ -220,7 +220,7 @@ public class SmackException extends Exception {

public static class SecurityRequiredByServerException extends SecurityRequiredException {
/**
*
*
*/
private static final long serialVersionUID = 8268148813117631819L;

@@ -232,7 +232,7 @@ public class SmackException extends Exception {
public static class SecurityNotPossibleException extends SmackException {

/**
*
*
*/
private static final long serialVersionUID = -6836090872690331336L;

@@ -250,7 +250,7 @@ public class SmackException extends Exception {
public static class ConnectionException extends SmackException {

/**
*
*
*/
private static final long serialVersionUID = 1686944201672697996L;

@@ -286,7 +286,7 @@ public class SmackException extends Exception {
public static class FeatureNotSupportedException extends SmackException {

/**
*
*
*/
private static final long serialVersionUID = 4713404802621452016L;

@@ -326,7 +326,7 @@ public class SmackException extends Exception {
public static class ResourceBindingNotOfferedException extends SmackException {

/**
*
*
*/
private static final long serialVersionUID = 2346934138253437571L;



+ 10
- 10
smack-core/src/main/java/org/jivesoftware/smack/StanzaCollector.java View File

@@ -34,7 +34,7 @@ import org.jivesoftware.smack.packet.Stanza;
* result.<p>
*
* Each stanza collector will queue up a configured number of packets for processing before
* older packets are automatically dropped. The default number is retrieved by
* older packets are automatically dropped. The default number is retrieved by
* {@link SmackConfiguration#getStanzaCollectorSize()}.
*
* @see XMPPConnection#createStanzaCollector(StanzaFilter)
@@ -147,7 +147,7 @@ public class StanzaCollector {
*
* @param <P> type of the result stanza.
* @return the next available packet.
* @throws InterruptedException
* @throws InterruptedException
*/
@SuppressWarnings("unchecked")
public <P extends Stanza> P nextResultBlockForever() throws InterruptedException {
@@ -165,7 +165,7 @@ public class StanzaCollector {
*
* @param <P> type of the result stanza.
* @return the next available packet.
* @throws InterruptedException
* @throws InterruptedException
*/
public <P extends Stanza> P nextResult() throws InterruptedException {
return nextResult(connection.getReplyTimeout());
@@ -181,7 +181,7 @@ public class StanzaCollector {
* @param <P> type of the result stanza.
* @param timeout the timeout in milliseconds.
* @return the next available packet.
* @throws InterruptedException
* @throws InterruptedException
*/
@SuppressWarnings("unchecked")
public <P extends Stanza> P nextResult(long timeout) throws InterruptedException {
@@ -270,7 +270,7 @@ public class StanzaCollector {

/**
* Get the number of collected stanzas this stanza collector has collected so far.
*
*
* @return the count of collected stanzas.
* @since 4.1
*/
@@ -306,7 +306,7 @@ public class StanzaCollector {

/**
* Get a new stanza collector configuration instance.
*
*
* @return a new stanza collector configuration.
*/
public static Configuration newConfiguration() {
@@ -325,7 +325,7 @@ public class StanzaCollector {
/**
* Set the stanza filter used by this collector. If <code>null</code>, then all packets will
* get collected by this collector.
*
*
* @param packetFilter
* @return a reference to this configuration.
* @deprecated use {@link #setStanzaFilter(StanzaFilter)} instead.
@@ -338,7 +338,7 @@ public class StanzaCollector {
/**
* Set the stanza filter used by this collector. If <code>null</code>, then all stanzas will
* get collected by this collector.
*
*
* @param stanzaFilter
* @return a reference to this configuration.
*/
@@ -350,7 +350,7 @@ public class StanzaCollector {
/**
* Set the maximum size of this collector, i.e. how many stanzas this collector will collect
* before dropping old ones.
*
*
* @param size
* @return a reference to this configuration.
*/
@@ -362,7 +362,7 @@ public class StanzaCollector {
/**
* Set the collector which timeout for the next result is reset once this collector collects
* a packet.
*
*
* @param collector
* @return a reference to this configuration.
*/


+ 2
- 2
smack-core/src/main/java/org/jivesoftware/smack/StanzaListener.java View File

@@ -49,8 +49,8 @@ public interface StanzaListener {
*
* @param packet the stanza to process.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotLoggedInException
* @throws InterruptedException
* @throws NotLoggedInException
*/
void processStanza(Stanza packet) throws NotConnectedException, InterruptedException, NotLoggedInException;



+ 1
- 1
smack-core/src/main/java/org/jivesoftware/smack/SynchronizationPoint.java View File

@@ -243,7 +243,7 @@ public class SynchronizationPoint<E extends Exception> {
* {@link #reportSuccess()}, {@link #reportFailure()} and {@link #reportFailure(Exception)} will either set this
* synchronization point to {@link State#Success} or {@link State#Failure}. If none of them is set after the
* connections reply timeout, this method will set the state of {@link State#NoResponse}.
* @throws InterruptedException
* @throws InterruptedException
*/
private void waitForConditionOrTimeout() throws InterruptedException {
long remainingWait = TimeUnit.MILLISECONDS.toNanos(connection.getReplyTimeout());


+ 2
- 2
smack-core/src/main/java/org/jivesoftware/smack/UnparseableStanza.java View File

@@ -19,7 +19,7 @@ package org.jivesoftware.smack;

/**
* Representation of an unparsable stanza.
*
*
* @author Florian Schmaus
*
*/
@@ -42,7 +42,7 @@ public class UnparseableStanza {

/**
* Retrieve the raw stanza data.
*
*
* @return the raw stanza data
*/
public CharSequence getContent() {


+ 44
- 44
smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java View File

@@ -35,7 +35,7 @@ import org.jxmpp.jid.EntityFullJid;
* implements shared methods which are used by the different types of connections (e.g.
* <code>XMPPTCPConnection</code> or <code>XMPPBOSHConnection</code>). To create a connection to an XMPP server
* a simple usage of this API might look like the following:
*
*
* <pre>
* // Create a connection to the igniterealtime.org XMPP server.
* XMPPTCPConnection con = new XMPPTCPConnection("igniterealtime.org");
@@ -76,7 +76,7 @@ public interface XMPPConnection {
/**
* Returns the XMPP Domain of the service provided by the XMPP server and used for this connection. After
* authenticating with the server the returned value may be different.
*
*
* @return the XMPP domain of this XMPP session.
*/
DomainBareJid getXMPPServiceDomain();
@@ -84,7 +84,7 @@ public interface XMPPConnection {
/**
* Returns the host name of the server where the XMPP server is running. This would be the
* IP address of the server or a name that may be resolved by a DNS server.
*
*
* @return the host name of the server where the XMPP server is running or null if not yet connected.
*/
String getHost();
@@ -92,7 +92,7 @@ public interface XMPPConnection {
/**
* Returns the port number of the XMPP server for this connection. The default port
* for normal connections is 5222.
*
*
* @return the port number of the XMPP server or 0 if not yet connected.
*/
int getPort();
@@ -101,7 +101,7 @@ public interface XMPPConnection {
* Returns the full XMPP address of the user that is logged in to the connection or
* <tt>null</tt> if not logged in yet. An XMPP address is in the form
* username@server/resource.
*
*
* @return the full XMPP address of the user logged in.
*/
EntityFullJid getUser();
@@ -109,7 +109,7 @@ public interface XMPPConnection {
/**
* Returns the stream ID for this connection, which is the value set by the server
* when opening an XMPP stream. This value will be <tt>null</tt> if not connected to the server.
*
*
* @return the ID of this connection returned from the XMPP server or <tt>null</tt> if
* not connected to the server.
* @see <a href="http://xmpp.org/rfcs/rfc6120.html#streams-attr-id">RFC 6120 § 4.7.3. id</a>
@@ -118,28 +118,28 @@ public interface XMPPConnection {

/**
* Returns true if currently connected to the XMPP server.
*
*
* @return true if connected.
*/
boolean isConnected();

/**
* Returns true if currently authenticated by successfully calling the login method.
*
*
* @return true if authenticated.
*/
boolean isAuthenticated();

/**
* Returns true if currently authenticated anonymously.
*
*
* @return true if authenticated anonymously.
*/
boolean isAnonymous();

/**
* Returns true if the connection to the server has successfully negotiated encryption.
*
* Returns true if the connection to the server has successfully negotiated encryption.
*
* @return true if a secure connection to the server.
*/
boolean isSecureConnection();
@@ -149,7 +149,7 @@ public interface XMPPConnection {
* traffic can be reduced up to 90%. Therefore, stream compression is ideal when using a slow
* speed network connection. However, the server will need to use more CPU time in order to
* un/compress network data so under high load the server performance might be affected.
*
*
* @return true if network traffic is being compressed.
*/
boolean isUsingCompression();
@@ -173,21 +173,21 @@ public interface XMPPConnection {
*
* @param nonza the Nonza to send.
* @throws NotConnectedException
* @throws InterruptedException
* @throws InterruptedException
*/
void sendNonza(Nonza nonza) throws NotConnectedException, InterruptedException;

/**
* Adds a connection listener to this connection that will be notified when
* the connection closes or fails.
*
*
* @param connectionListener a connection listener.
*/
void addConnectionListener(ConnectionListener connectionListener);

/**
* Removes a connection listener from this connection.
*
*
* @param connectionListener a connection listener.
*/
void removeConnectionListener(ConnectionListener connectionListener);
@@ -214,8 +214,8 @@ public interface XMPPConnection {
*
* @param request the IQ request to filter responses from
* @return a new stanza collector.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
StanzaCollector createStanzaCollectorAndSend(IQ request) throws NotConnectedException, InterruptedException;

@@ -224,12 +224,12 @@ public interface XMPPConnection {
* which stanzas will be accumulated by the collector. A StanzaCollector is
* more suitable to use than a {@link StanzaListener} when you need to wait for
* a specific result.
*
*
* @param stanzaFilter the stanza filter to use.
* @param stanza the stanza to send right after the collector got created
* @return a new stanza collector.
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
*/
StanzaCollector createStanzaCollectorAndSend(StanzaFilter stanzaFilter, Stanza stanza)
throws NotConnectedException, InterruptedException;
@@ -246,7 +246,7 @@ public interface XMPPConnection {
* Otherwise make sure cancel the StanzaCollector in every case, e.g. even
* if an exception is thrown, or otherwise you may leak the StanzaCollector.
* </p>
*
*
* @param stanzaFilter the stanza filter to use.
* @return a new stanza collector.
*/
@@ -258,7 +258,7 @@ public interface XMPPConnection {
* Please make sure to cancel the collector when it is no longer required. See also
* {@link #createStanzaCollector(StanzaFilter)}.
* </p>
*
*
* @param configuration the stanza collector configuration.
* @return a new stanza collector.
* @since 4.1
@@ -267,7 +267,7 @@ public interface XMPPConnection {

/**
* Remove a stanza collector of this connection.
*
*
* @param collector a stanza collectors which was created for this connection.
*/
void removeStanzaCollector(StanzaCollector collector);
@@ -309,7 +309,7 @@ public interface XMPPConnection {
* invoked asynchronously in their own thread. Use this method if the order of the stanza listeners must not depend
* on the order how the stanzas where received.
* </p>
*
*
* @param stanzaListener the stanza listener to notify of new received stanzas.
* @param stanzaFilter the stanza filter to use.
* @see #addStanzaInterceptor(StanzaListener, StanzaFilter)
@@ -319,7 +319,7 @@ public interface XMPPConnection {

/**
* Removes an <b>asynchronous</b> stanza listener for received stanzas from this connection.
*
*
* @param stanzaListener the stanza listener to remove.
* @return true if the stanza listener was removed
* @since 4.1
@@ -333,7 +333,7 @@ public interface XMPPConnection {
* that writes stanzas will be used to invoke the listeners. Therefore, each
* stanza listener should complete all operations quickly or use a different
* thread for processing.
*
*
* @param stanzaListener the stanza listener to notify of sent stanzas.
* @param stanzaFilter the stanza filter to use.
* @deprecated use {@link #addStanzaSendingListener} instead
@@ -357,7 +357,7 @@ public interface XMPPConnection {

/**
* Removes a stanza listener for sending stanzas from this connection.
*
*
* @param stanzaListener the stanza listener to remove.
* @deprecated use {@link #removeStanzaSendingListener} instead
*/
@@ -377,7 +377,7 @@ public interface XMPPConnection {
* invoked every time a stanza is about to be sent by this connection. Interceptors
* may modify the stanza to be sent. A stanza filter determines which stanzas
* will be delivered to the interceptor.
*
*
* <p>
* NOTE: For a similar functionality on incoming stanzas, see {@link #addAsyncStanzaListener(StanzaListener, StanzaFilter)}.
* </p>
@@ -467,7 +467,7 @@ public interface XMPPConnection {
/**
* Set the FromMode for this connection instance. Defines how the 'from' attribute of outgoing
* stanzas should be populated by Smack.
*
*
* @param fromMode
*/
void setFromMode(FromMode fromMode);
@@ -492,7 +492,7 @@ public interface XMPPConnection {

/**
* Return true if the server supports the given stream feature.
*
*
* @param element
* @param namespace
* @return true if the server supports the stream feature.
@@ -543,7 +543,7 @@ public interface XMPPConnection {
* invoked at most once and it will be not invoked after the connections default reply timeout
* has been elapsed.
* </p>
*
*
* @param stanza the stanza to send (required)
* @param replyFilter the filter used to determine response stanza (required)
* @param callback the callback invoked if there is a response (required)
@@ -563,13 +563,13 @@ public interface XMPPConnection {
* after the connections default reply timeout, then <code>exceptionCallback</code> will be invoked
* with a {@link SmackException.NoResponseException}. The callback will be invoked at most once.
* </p>
*
*
* @param stanza the stanza to send (required)
* @param replyFilter the filter used to determine response stanza (required)
* @param callback the callback invoked if there is a response (required)
* @param exceptionCallback the callback invoked if there is an exception (optional)
* @throws NotConnectedException
* @throws InterruptedException
* @throws InterruptedException
* @deprecated use {@link #sendAsync(Stanza, StanzaFilter)} instead.
*/
@Deprecated
@@ -584,14 +584,14 @@ public interface XMPPConnection {
* after <code>timeout</code> milliseconds, then <code>exceptionCallback</code> will be invoked
* with a {@link SmackException.NoResponseException}. The callback will be invoked at most once.
* </p>
*
*
* @param stanza the stanza to send (required)
* @param replyFilter the filter used to determine response stanza (required)
* @param callback the callback invoked if there is a response (required)
* @param exceptionCallback the callback invoked if there is an exception (optional)
* @param timeout the timeout in milliseconds to wait for a response
* @throws NotConnectedException
* @throws InterruptedException
* @throws InterruptedException
* @deprecated use {@link #sendAsync(Stanza, StanzaFilter, long)} instead.
*/
@Deprecated
@@ -604,11 +604,11 @@ public interface XMPPConnection {
* Send a IQ stanza and invoke <code>callback</code> if there is a result of
* {@link org.jivesoftware.smack.packet.IQ.Type#result} with that result IQ. The callback will
* not be invoked after the connections default reply timeout has been elapsed.
*
*
* @param iqRequest the IQ stanza to send (required)
* @param callback the callback invoked if there is result response (required)
* @throws NotConnectedException
* @throws InterruptedException
* @throws InterruptedException
* @deprecated use {@link #sendIqRequestAsync(IQ)} instead.
*/
@Deprecated
@@ -622,12 +622,12 @@ public interface XMPPConnection {
* error as {@link XMPPException.XMPPErrorException}. If there is no response after the
* connections default reply timeout, then <code>exceptionCallback</code> will be invoked with a
* {@link SmackException.NoResponseException}.
*
*
* @param iqRequest the IQ stanza to send (required)
* @param callback the callback invoked if there is result response (required)
* @param exceptionCallback the callback invoked if there is an Exception optional
* @throws NotConnectedException
* @throws InterruptedException
* @throws InterruptedException
* @deprecated use {@link #sendIqRequestAsync(IQ)} instead.
*/
@Deprecated
@@ -642,13 +642,13 @@ public interface XMPPConnection {
* error as {@link XMPPException.XMPPErrorException}. If there is no response after
* <code>timeout</code>, then <code>exceptionCallback</code> will be invoked with a
* {@link SmackException.NoResponseException}.
*
*
* @param iqRequest the IQ stanza to send (required)
* @param callback the callback invoked if there is result response (required)
* @param exceptionCallback the callback invoked if there is an Exception optional
* @param timeout the timeout in milliseconds to wait for a response
* @throws NotConnectedException
* @throws InterruptedException
* @throws InterruptedException
* @deprecated use {@link #sendIqRequestAsync(IQ, long)} instead.