mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-21 19:42:05 +01:00
Enable trailing whitespace checkstyle check
for all source code regions, including javadoc.
This commit is contained in:
parent
9d61a6de7d
commit
e8923b9d16
545 changed files with 3713 additions and 3715 deletions
|
@ -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&&[^\*/]]+\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?"/>
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ public class ReconnectionTest extends SmackTestCase {
|
|||
private CountDownLatch countDownLatch;
|
||||
|
||||
private XMPPTCPConnectionTestListener(CountDownLatch latch) {
|
||||
countDownLatch = latch;
|
||||
countDownLatch = latch;
|
||||
}
|
||||
|
||||
private XMPPTCPConnectionTestListener() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {}
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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 + "
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -23,7 +23,7 @@ package org.jivesoftware.smack;
|
|||
*
|
||||
* @see XMPPConnection#addConnectionListener
|
||||
* @see XMPPConnection#removeConnectionListener
|
||||
*
|
||||
*
|
||||
* @author Matt Tucker
|
||||
*/
|
||||
public interface ConnectionListener {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
*/
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -660,7 +660,7 @@ public interface XMPPConnection {
|
|||
/**
|
||||
* Add a callback that is called exactly once and synchronously with the incoming stanza that matches the given
|
||||
* stanza filter.
|
||||
*
|
||||
*
|
||||
* @param callback the callback invoked once the stanza filter matches a stanza.
|
||||
* @param stanzaFilter the filter to match stanzas or null to match all.
|
||||
*/
|
||||
|
@ -686,7 +686,7 @@ public interface XMPPConnection {
|
|||
|
||||
/**
|
||||
* Unregister an IQ request handler with this connection.
|
||||
*
|
||||
*
|
||||
* @param element the IQ element the IQ request handler is responsible for.
|
||||
* @param namespace the IQ namespace the IQ request handler is responsible for.
|
||||
* @param type the IQ type the IQ request handler is responsible for.
|
||||
|
@ -696,7 +696,7 @@ public interface XMPPConnection {
|
|||
|
||||
/**
|
||||
* Returns the timestamp in milliseconds when the last stanza was received.
|
||||
*
|
||||
*
|
||||
* @return the timestamp in milliseconds
|
||||
*/
|
||||
long getLastStanzaReceived();
|
||||
|
|
|
@ -32,7 +32,7 @@ public class XMPPConnectionRegistry {
|
|||
/**
|
||||
* Adds a new listener that will be notified when new Connections are created. Note
|
||||
* that newly created connections will not be actually connected to the server.
|
||||
*
|
||||
*
|
||||
* @param connectionCreationListener a listener interested on new connections.
|
||||
*/
|
||||
public static void addConnectionCreationListener(
|
||||
|
@ -42,7 +42,7 @@ public class XMPPConnectionRegistry {
|
|||
|
||||
/**
|
||||
* Removes a listener that was interested in connection creation events.
|
||||
*
|
||||
*
|
||||
* @param connectionCreationListener a listener interested on new connections.
|
||||
*/
|
||||
public static void removeConnectionCreationListener(
|
||||
|
@ -54,7 +54,7 @@ public class XMPPConnectionRegistry {
|
|||
|
||||
/**
|
||||
* Get the collection of listeners that are interested in connection creation events.
|
||||
*
|
||||
*
|
||||
* @return a collection of listeners interested on new connections.
|
||||
*/
|
||||
protected static Collection<ConnectionCreationListener> getConnectionCreationListeners() {
|
||||
|
|
|
@ -71,7 +71,7 @@ public abstract class XMPPException extends Exception {
|
|||
|
||||
public static class XMPPErrorException extends XMPPException {
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 212790389529249604L;
|
||||
private final StanzaError error;
|
||||
|
@ -121,7 +121,7 @@ public abstract class XMPPException extends Exception {
|
|||
/**
|
||||
* Returns the XMPPError associated with this exception, or <tt>null</tt> if there isn't
|
||||
* one.
|
||||
*
|
||||
*
|
||||
* @return the XMPPError associated with this exception.
|
||||
*/
|
||||
public StanzaError getXMPPError() {
|
||||
|
@ -174,7 +174,7 @@ public abstract class XMPPException extends Exception {
|
|||
public static class FailedNonzaException extends XMPPException {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -198,7 +198,7 @@ public abstract class XMPPException extends Exception {
|
|||
|
||||
public static class StreamErrorException extends XMPPException {
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 3400556867134848886L;
|
||||
private final StreamError streamError;
|
||||
|
@ -207,7 +207,7 @@ public abstract class XMPPException extends Exception {
|
|||
* Creates a new XMPPException with the stream error that was the root case of the
|
||||
* exception. When a stream error is received from the server then the underlying connection
|
||||
* will be closed by the server.
|
||||
*
|
||||
*
|
||||
* @param streamError the root cause of the exception.
|
||||
*/
|
||||
public StreamErrorException(StreamError streamError) {
|
||||
|
@ -220,7 +220,7 @@ public abstract class XMPPException extends Exception {
|
|||
/**
|
||||
* Returns the StreamError associated with this exception. The underlying TCP connection is
|
||||
* closed by the server after sending the stream error to the client.
|
||||
*
|
||||
*
|
||||
* @return the StreamError associated with this exception.
|
||||
*/
|
||||
public StreamError getStreamError() {
|
||||
|
|
|
@ -37,7 +37,7 @@ import java.util.zip.InflaterInputStream;
|
|||
* <li><a href="http://docs.oracle.com/javase/7/docs/api/java/util/zip/Deflater.html#deflate(byte[],%20int,%20int,%20int)">The required deflate() method (Java7)</a>
|
||||
* <li><a href="http://developer.android.com/reference/java/util/zip/Deflater.html#deflate(byte[],%20int,%20int,%20int)">The required deflate() method (Android)</a>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
*/
|
||||
public class Java7ZlibInputOutputStream extends XMPPInputOutputStream {
|
||||
|
@ -74,7 +74,7 @@ public class Java7ZlibInputOutputStream extends XMPPInputOutputStream {
|
|||
/**
|
||||
* Provide a more InputStream compatible version. A return value of 1 means that it is likely to read one
|
||||
* byte without blocking, 0 means that the system is known to block for more input.
|
||||
*
|
||||
*
|
||||
* @return 0 if no data is available, 1 otherwise
|
||||
* @throws IOException
|
||||
*/
|
||||
|
@ -84,10 +84,10 @@ public class Java7ZlibInputOutputStream extends XMPPInputOutputStream {
|
|||
* aSmack related remark (where KXmlParser is used):
|
||||
* This is one of the funny code blocks. InflaterInputStream.available violates the contract of
|
||||
* InputStream.available, which breaks kXML2.
|
||||
*
|
||||
*
|
||||
* I'm not sure who's to blame, oracle/sun for a broken api or the google guys for mixing a sun bug with
|
||||
* a xml reader that can't handle it....
|
||||
*
|
||||
*
|
||||
* Anyway, this simple if breaks suns distorted reality, but helps to use the api as intended.
|
||||
*/
|
||||
if (inf.needsInput()) {
|
||||
|
|
|
@ -28,7 +28,7 @@ public abstract class XMPPInputOutputStream {
|
|||
* Set the used flushed method when compressing data. The default is full flush which may not
|
||||
* achieve the best compression ratio, but provides better security against certain attacks.
|
||||
* Only use sync flush if you fully understand the implications.
|
||||
*
|
||||
*
|
||||
* @see <a href="https://blog.thijsalkema.de/blog/2014/08/07/https-attacks-and-xmpp-2-crime-and-breach/">Attacks against XMPP when using compression</a>
|
||||
* @param flushMethod
|
||||
*/
|
||||
|
|
|
@ -26,12 +26,12 @@ import org.jivesoftware.smack.packet.TopLevelStreamElement;
|
|||
import org.jxmpp.jid.EntityFullJid;
|
||||
|
||||
/**
|
||||
* Interface that allows for implementing classes to debug XML traffic. That is a GUI window that
|
||||
* Interface that allows for implementing classes to debug XML traffic. That is a GUI window that
|
||||
* displays XML traffic.<p>
|
||||
*
|
||||
* Every implementation of this interface <b>must</b> have a public constructor with the following
|
||||
*
|
||||
* Every implementation of this interface <b>must</b> have a public constructor with the following
|
||||
* arguments: XMPPConnection, Writer, Reader.
|
||||
*
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
public abstract class SmackDebugger {
|
||||
|
@ -43,10 +43,10 @@ public abstract class SmackDebugger {
|
|||
}
|
||||
|
||||
/**
|
||||
* Called when a user has logged in to the server. The user could be an anonymous user, this
|
||||
* means that the user would be of the form host/resource instead of the form
|
||||
* Called when a user has logged in to the server. The user could be an anonymous user, this
|
||||
* means that the user would be of the form host/resource instead of the form
|
||||
* user@host/resource.
|
||||
*
|
||||
*
|
||||
* @param user the user@host/resource that has just logged in
|
||||
*/
|
||||
// TODO: Should be replaced with a connection listener authenticed().
|
||||
|
|
|
@ -23,9 +23,9 @@ import org.jivesoftware.smack.util.Objects;
|
|||
/**
|
||||
* A filter for IQ stanza types. Returns true only if the stanza is an IQ packet
|
||||
* and it matches the type provided in the constructor.
|
||||
*
|
||||
*
|
||||
* @author Alexander Wenckus
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class IQTypeFilter extends FlexibleStanzaTypeFilter<IQ> {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.jivesoftware.smack.packet.Message.Type;
|
|||
|
||||
/**
|
||||
* Filters for packets of a specific type of Message (e.g. CHAT).
|
||||
*
|
||||
*
|
||||
* @see org.jivesoftware.smack.packet.Message.Type
|
||||
* @author Ward Harold
|
||||
*/
|
||||
|
@ -42,7 +42,7 @@ public final class MessageTypeFilter extends FlexibleStanzaTypeFilter<Message> {
|
|||
|
||||
/**
|
||||
* Creates a new message type filter using the specified message type.
|
||||
*
|
||||
*
|
||||
* @param type the message type.
|
||||
*/
|
||||
private MessageTypeFilter(Message.Type type) {
|
||||
|
|
|
@ -22,10 +22,10 @@ import org.jivesoftware.smack.SmackConfiguration;
|
|||
|
||||
/**
|
||||
* Defines an initialization class that will be instantiated and invoked by the {@link SmackConfiguration} class during initialization.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Any implementation of this class MUST have a default constructor.
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.jivesoftware.smack.util.FileUtils;
|
|||
/**
|
||||
* Loads the provider file defined by the URL returned by {@link #getProvidersUri()} and the generic
|
||||
* smack configuration file returned {@link #getConfigUri()}.
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
*/
|
||||
public abstract class UrlInitializer implements SmackInitializer {
|
||||
|
|
|
@ -23,9 +23,9 @@ import org.jivesoftware.smack.provider.ProviderManager;
|
|||
|
||||
|
||||
/**
|
||||
* Looks for a provider file location based on the VM argument <i>smack.provider.file</i>. If it is supplied, its value will
|
||||
* Looks for a provider file location based on the VM argument <i>smack.provider.file</i>. If it is supplied, its value will
|
||||
* be used as a file location for a providers file and loaded into the {@link ProviderManager} on Smack initialization.
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -61,7 +61,7 @@ public class AbstractError {
|
|||
* <p>
|
||||
* Returns the descriptive text of this SASLFailure in the system default language if possible. May return null.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @return the descriptive text or null.
|
||||
*/
|
||||
public String getDescriptiveText() {
|
||||
|
@ -81,7 +81,7 @@ public class AbstractError {
|
|||
* <p>
|
||||
* Returns the descriptive text of this SASLFailure in the given language. May return null if not available.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param xmllang the language.
|
||||
* @return the descriptive text or null.
|
||||
*/
|
||||
|
@ -92,7 +92,7 @@ public class AbstractError {
|
|||
|
||||
/**
|
||||
* Returns the first stanza extension that matches the specified element name and
|
||||
* namespace, or <tt>null</tt> if it doesn't exist.
|
||||
* namespace, or <tt>null</tt> if it doesn't exist.
|
||||
*
|
||||
* @param elementName the XML element name of the stanza extension.
|
||||
* @param namespace the XML element namespace of the stanza extension.
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.jxmpp.jid.parts.Resourcepart;
|
|||
* resource but the server may return a modified version of the sent resource.<p>
|
||||
*
|
||||
* For more information refer to the following
|
||||
* <a href=http://www.xmpp.org/specs/rfc3920.html#bind>link</a>.
|
||||
* <a href=http://www.xmpp.org/specs/rfc3920.html#bind>link</a>.
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
|
|
|
@ -211,7 +211,7 @@ public abstract class IQ extends Stanza {
|
|||
* </pre>
|
||||
* If your IQ does not contain any attributes or child elements (besides {@link ExtensionElement}s), consider sub-classing
|
||||
* {@link SimpleIQ} instead.
|
||||
*
|
||||
*
|
||||
* @param xml a pre-created builder which already has the child element and the 'xmlns' attribute set.
|
||||
* @return the build to create the IQ child content.
|
||||
*/
|
||||
|
|
|
@ -220,7 +220,7 @@ public final class Message extends Stanza implements TypedCloneable<Message> {
|
|||
*/
|
||||
public void setSubject(String subject) {
|
||||
if (subject == null) {
|
||||
removeSubject(""); // use empty string because #removeSubject(null) is ambiguous
|
||||
removeSubject(""); // use empty string because #removeSubject(null) is ambiguous
|
||||
return;
|
||||
}
|
||||
addSubject(null, subject);
|
||||
|
@ -751,7 +751,7 @@ public final class Message extends Stanza implements TypedCloneable<Message> {
|
|||
/**
|
||||
* Converts a String into the corresponding types. Valid String values that can be converted
|
||||
* to types are: "normal", "chat", "groupchat", "headline" and "error".
|
||||
*
|
||||
*
|
||||
* @param string the String value to covert.
|
||||
* @return the corresponding Type.
|
||||
* @throws IllegalArgumentException when not able to parse the string parameter
|
||||
|
|
|
@ -162,9 +162,9 @@ public interface Packet extends TopLevelStreamElement {
|
|||
* Returns the first stanza extension that matches the specified element name and
|
||||
* namespace, or <tt>null</tt> if it doesn't exist. If the provided elementName is null,
|
||||
* only the namespace is matched. Stanza extensions are
|
||||
* are arbitrary XML sub-documents in standard XMPP packets. By default, a
|
||||
* DefaultPacketExtension instance will be returned for each extension. However,
|
||||
* PacketExtensionProvider instances can be registered with the
|
||||
* are arbitrary XML sub-documents in standard XMPP packets. By default, a
|
||||
* DefaultPacketExtension instance will be returned for each extension. However,
|
||||
* PacketExtensionProvider instances can be registered with the
|
||||
* {@link org.jivesoftware.smack.provider.ProviderManager ProviderManager}
|
||||
* class to handle custom parsing. In that case, the type of the Object
|
||||
* will be determined by the provider.
|
||||
|
@ -184,7 +184,7 @@ public interface Packet extends TopLevelStreamElement {
|
|||
|
||||
/**
|
||||
* Adds a collection of stanza extensions to the packet. Does nothing if extensions is null.
|
||||
*
|
||||
*
|
||||
* @param extensions a collection of stanza extensions
|
||||
*/
|
||||
void addExtensions(Collection<ExtensionElement> extensions);
|
||||
|
@ -203,7 +203,7 @@ public interface Packet extends TopLevelStreamElement {
|
|||
|
||||
/**
|
||||
* Check if a stanza extension with the given namespace exists.
|
||||
*
|
||||
*
|
||||
* @param namespace
|
||||
* @return true if a stanza extension exists, false otherwise.
|
||||
*/
|
||||
|
|
|
@ -146,7 +146,7 @@ public final class Presence extends Stanza implements TypedCloneable<Presence> {
|
|||
* @return true if the presence type is available.
|
||||
*/
|
||||
public boolean isAvailable() {
|
||||
return type == Type.available;
|
||||
return type == Type.available;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -160,7 +160,7 @@ public final class Presence extends Stanza implements TypedCloneable<Presence> {
|
|||
* @return true if the presence type is available and the presence mode is away, xa, or dnd.
|
||||
*/
|
||||
public boolean isAway() {
|
||||
return type == Type.available && (mode == Mode.away || mode == Mode.xa || mode == Mode.dnd);
|
||||
return type == Type.available && (mode == Mode.away || mode == Mode.xa || mode == Mode.dnd);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -378,7 +378,7 @@ public final class Presence extends Stanza implements TypedCloneable<Presence> {
|
|||
* Converts a String into the corresponding types. Valid String values that can be converted
|
||||
* to types are: "available", "unavailable", "subscribe", "subscribed", "unsubscribe",
|
||||
* "unsubscribed" and "error".
|
||||
*
|
||||
*
|
||||
* @param string the String value to covert.
|
||||
* @return the corresponding Type.
|
||||
* @throws IllegalArgumentException when not able to parse the string parameter
|
||||
|
@ -422,7 +422,7 @@ public final class Presence extends Stanza implements TypedCloneable<Presence> {
|
|||
/**
|
||||
* Converts a String into the corresponding types. Valid String values that can be converted
|
||||
* to types are: "chat", "available", "away", "xa", and "dnd".
|
||||
*
|
||||
*
|
||||
* @param string the String value to covert.
|
||||
* @return the corresponding Type.
|
||||
* @throws IllegalArgumentException when not able to parse the string parameter
|
||||
|
|
|
@ -151,7 +151,7 @@ public abstract class Stanza implements TopLevelStreamElement {
|
|||
|
||||
/**
|
||||
* Set the stanza id if none is set.
|
||||
*
|
||||
*
|
||||
* @return the stanza id.
|
||||
* @since 4.2
|
||||
*/
|
||||
|
@ -402,7 +402,7 @@ public abstract class Stanza implements TopLevelStreamElement {
|
|||
|
||||
/**
|
||||
* Adds a collection of stanza extensions to the packet. Does nothing if extensions is null.
|
||||
*
|
||||
*
|
||||
* @param extensions a collection of stanza extensions
|
||||
*/
|
||||
public void addExtensions(Collection<ExtensionElement> extensions) {
|
||||
|
@ -434,7 +434,7 @@ public abstract class Stanza implements TopLevelStreamElement {
|
|||
|
||||
/**
|
||||
* Check if a stanza extension with the given namespace exists.
|
||||
*
|
||||
*
|
||||
* @param namespace
|
||||
* @return true if a stanza extension exists, false otherwise.
|
||||
*/
|
||||
|
@ -489,7 +489,7 @@ public abstract class Stanza implements TopLevelStreamElement {
|
|||
|
||||
/**
|
||||
* Returns the default language used for all messages containing localized content.
|
||||
*
|
||||
*
|
||||
* @return the default language
|
||||
*/
|
||||
public static String getDefaultLanguage() {
|
||||
|
|
|
@ -104,14 +104,14 @@ public class StanzaError extends AbstractError {
|
|||
/**
|
||||
* Creates a new error with the specified type, condition and message.
|
||||
* This constructor is used when the condition is not recognized automatically by XMPPError
|
||||
* i.e. there is not a defined instance of ErrorCondition or it does not apply the default
|
||||
* i.e. there is not a defined instance of ErrorCondition or it does not apply the default
|
||||
* specification.
|
||||
*
|
||||
*
|
||||
* @param type the error type.
|
||||
* @param condition the error condition.
|
||||
* @param conditionText
|
||||
* @param errorGenerator
|
||||
* @param descriptiveTexts
|
||||
* @param descriptiveTexts
|
||||
* @param extensions list of stanza extensions
|
||||
* @param stanza the stanza carrying this XMPP error.
|
||||
*/
|
||||
|
|
|
@ -24,9 +24,9 @@ import org.jivesoftware.smack.UnparseableStanza;
|
|||
|
||||
/**
|
||||
* Simple parsing exception callback that only logs the encountered parsing exception to java util logging.
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ExceptionLoggingCallback implements ParsingExceptionCallback {
|
||||
private static final Logger LOGGER = Logger.getLogger(ExceptionLoggingCallback.class.getName());
|
||||
|
|
|
@ -23,9 +23,9 @@ import org.jivesoftware.smack.UnparseableStanza;
|
|||
/**
|
||||
* Parsing exception callback class that simply throws the encountered parsing exception. This usually leads to an
|
||||
* {@link ConnectionListener#connectionClosedOnError(Exception)} and disconnect of the connection.
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ExceptionThrowingCallback implements ParsingExceptionCallback {
|
||||
|
||||
|
|
|
@ -27,15 +27,15 @@ import org.jivesoftware.smack.UnparseableStanza;
|
|||
* <p>
|
||||
* Smack provides 2 predefined ParsingExceptionCallback's: {@link ExceptionLoggingCallback} and {@link ExceptionThrowingCallback}.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface ParsingExceptionCallback {
|
||||
|
||||
/**
|
||||
* Called when parsing a stanza caused an exception.
|
||||
*
|
||||
*
|
||||
* @param stanzaData the raw stanza data that caused the exception
|
||||
* @throws Exception
|
||||
*/
|
||||
|
|
|
@ -27,20 +27,20 @@ import org.jivesoftware.smack.util.PacketParserUtils;
|
|||
import org.xmlpull.v1.XmlPullParser;
|
||||
|
||||
/**
|
||||
*
|
||||
* This class simplifies parsing of embedded elements by using the
|
||||
* <a href="http://en.wikipedia.org/wiki/Template_method_pattern">Template Method Pattern</a>.
|
||||
* After extracting the current element attributes and content of any child elements, the template method
|
||||
*
|
||||
* This class simplifies parsing of embedded elements by using the
|
||||
* <a href="http://en.wikipedia.org/wiki/Template_method_pattern">Template Method Pattern</a>.
|
||||
* After extracting the current element attributes and content of any child elements, the template method
|
||||
* ({@link #createReturnExtension(String, String, Map, List)} is called. Subclasses
|
||||
* then override this method to create the specific return type.
|
||||
*
|
||||
* <p>To use this class, you simply register your subclasses as extension providers in the
|
||||
*
|
||||
* <p>To use this class, you simply register your subclasses as extension providers in the
|
||||
* <b>smack.properties</b> file. Then they will be automatically picked up and used to parse
|
||||
* any child elements.
|
||||
*
|
||||
* any child elements.
|
||||
*
|
||||
* <pre>
|
||||
* For example, given the following message
|
||||
*
|
||||
*
|
||||
* <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo>
|
||||
* <event xmlns='http://jabber.org/protocol/pubsub#event>
|
||||
* <items node='princely_musings'>
|
||||
|
@ -54,16 +54,16 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
* </items>
|
||||
* </event>
|
||||
* </message>
|
||||
*
|
||||
*
|
||||
* I would have a classes
|
||||
* <tt>ItemsProvider</tt> extends {@link EmbeddedExtensionProvider}
|
||||
* <tt>ItemProvider</tt> extends {@link EmbeddedExtensionProvider}
|
||||
* and
|
||||
* AtomProvider extends {@link ExtensionElementProvider}
|
||||
*
|
||||
*
|
||||
* These classes are then registered in the meta-inf/smack.providers file
|
||||
* as follows.
|
||||
*
|
||||
*
|
||||
* <extensionProvider>
|
||||
* <elementName>items</elementName>
|
||||
* <namespace>http://jabber.org/protocol/pubsub#event</namespace>
|
||||
|
@ -74,9 +74,9 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
* <namespace>http://jabber.org/protocol/pubsub#event</namespace>
|
||||
* <className>org.jivesoftware.smackx.provider.ItemProvider</className>
|
||||
* </extensionProvider>
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public abstract class EmbeddedExtensionProvider<PE extends ExtensionElement> extends ExtensionElementProvider<PE> {
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.jivesoftware.smack.packet.ExtensionElement;
|
|||
/**
|
||||
* Defines the information required to register a stanza extension Provider with the {@link ProviderManager} when using the
|
||||
* {@link ProviderLoader}.
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
@ -29,7 +29,7 @@ public final class ExtensionProviderInfo extends AbstractProviderInfo {
|
|||
|
||||
/**
|
||||
* Defines an extension provider which implements the <code>ExtensionElementProvider</code> interface.
|
||||
*
|
||||
*
|
||||
* @param elementName Element that provider parses.
|
||||
* @param namespace Namespace that provider parses.
|
||||
* @param extProvider The provider implementation.
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.jivesoftware.smack.packet.IQ;
|
|||
/**
|
||||
* Defines the information required to register an IQ Provider with the {@link ProviderManager} when using the
|
||||
* {@link ProviderLoader}.
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
@ -29,7 +29,7 @@ public final class IQProviderInfo extends AbstractProviderInfo {
|
|||
|
||||
/**
|
||||
* Defines an IQ provider which implements the <code>IQProvider</code> interface.
|
||||
*
|
||||
*
|
||||
* @param elementName Element that provider parses.
|
||||
* @param namespace Namespace that provider parses.
|
||||
* @param iqProvider The provider implementation.
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
* element does not follow the specification, for example by putting a string where only integers are allowed, then a
|
||||
* {@link org.jivesoftware.smack.SmackException} should be thrown.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
* @param <E> the type of the resulting element.
|
||||
*/
|
||||
|
|
|
@ -31,9 +31,9 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
import org.xmlpull.v1.XmlPullParserFactory;
|
||||
|
||||
/**
|
||||
* Loads the {@link IQProvider} and {@link ExtensionElementProvider} information from a standard provider file in preparation
|
||||
* Loads the {@link IQProvider} and {@link ExtensionElementProvider} information from a standard provider file in preparation
|
||||
* for loading into the {@link ProviderManager}.
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.Collection;
|
|||
|
||||
/**
|
||||
* Used to load providers into the {@link ProviderManager}.
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*/
|
||||
public interface ProviderLoader {
|
||||
|
@ -40,7 +40,7 @@ public interface ProviderLoader {
|
|||
/**
|
||||
* Provides the stream feature providers information for the creation of stream feature
|
||||
* providers to be added to the <code>ProviderManager</code>.
|
||||
*
|
||||
*
|
||||
* @return The extension provider info to load.
|
||||
*/
|
||||
Collection<StreamFeatureProviderInfo> getStreamFeatureProviderInfo();
|
||||
|
|
|
@ -22,7 +22,7 @@ public final class StreamFeatureProviderInfo extends AbstractProviderInfo {
|
|||
|
||||
/**
|
||||
* Defines an extension provider which implements the <code>StreamFeatureProvider</code> interface.
|
||||
*
|
||||
*
|
||||
* @param elementName Element that provider parses.
|
||||
* @param namespace Namespace that provider parses.
|
||||
* @param extProvider The provider implementation.
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.jivesoftware.smack.util.stringencoder.Base64;
|
|||
|
||||
/**
|
||||
* HTTP Proxy Socket Connection which connects the socket using a HTTP Proxy.
|
||||
*
|
||||
*
|
||||
* @author Atul Aggarwal
|
||||
*/
|
||||
class HTTPProxySocketConnection implements ProxySocketConnection {
|
||||
|
@ -92,7 +92,7 @@ class HTTPProxySocketConnection implements ProxySocketConnection {
|
|||
|
||||
if (nlchars != 4) {
|
||||
throw new ProxyException(ProxyInfo.ProxyType.HTTP, "Never " +
|
||||
"received blank line from "
|
||||
"received blank line from "
|
||||
+ proxyhost + ", cancelling connection");
|
||||
}
|
||||
|
||||
|
|
|
@ -20,12 +20,12 @@ import java.io.IOException;
|
|||
|
||||
/**
|
||||
* An exception class to handle exceptions caused by proxy.
|
||||
*
|
||||
*
|
||||
* @author Atul Aggarwal
|
||||
*/
|
||||
public class ProxyException extends IOException {
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
package org.jivesoftware.smack.proxy;
|
||||
|
||||
/**
|
||||
* Class which stores proxy information such as proxy type, host, port,
|
||||
* Class which stores proxy information such as proxy type, host, port,
|
||||
* authentication etc.
|
||||
*
|
||||
*
|
||||
* @author Atul Aggarwal
|
||||
*/
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class ProxyInfo {
|
|||
private ProxyType proxyType;
|
||||
private final ProxySocketConnection proxySocketConnection;
|
||||
|
||||
public ProxyInfo(ProxyType pType, String pHost, int pPort, String pUser,
|
||||
public ProxyInfo(ProxyType pType, String pHost, int pPort, String pUser,
|
||||
String pPass) {
|
||||
this.proxyType = pType;
|
||||
this.proxyAddress = pHost;
|
||||
|
@ -59,17 +59,17 @@ public class ProxyInfo {
|
|||
}
|
||||
}
|
||||
|
||||
public static ProxyInfo forHttpProxy(String pHost, int pPort, String pUser,
|
||||
public static ProxyInfo forHttpProxy(String pHost, int pPort, String pUser,
|
||||
String pPass) {
|
||||
return new ProxyInfo(ProxyType.HTTP, pHost, pPort, pUser, pPass);
|
||||
}
|
||||
|
||||
public static ProxyInfo forSocks4Proxy(String pHost, int pPort, String pUser,
|
||||
public static ProxyInfo forSocks4Proxy(String pHost, int pPort, String pUser,
|
||||
String pPass) {
|
||||
return new ProxyInfo(ProxyType.SOCKS4, pHost, pPort, pUser, pPass);
|
||||
}
|
||||
|
||||
public static ProxyInfo forSocks5Proxy(String pHost, int pPort, String pUser,
|
||||
public static ProxyInfo forSocks5Proxy(String pHost, int pPort, String pUser,
|
||||
String pPass) {
|
||||
return new ProxyInfo(ProxyType.SOCKS5, pHost, pPort, pUser, pPass);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||
|
||||
/**
|
||||
* Socket factory for socks4 proxy.
|
||||
*
|
||||
*
|
||||
* @author Atul Aggarwal
|
||||
*/
|
||||
public class Socks4ProxySocketConnection implements ProxySocketConnection {
|
||||
|
@ -101,7 +101,7 @@ public class Socks4ProxySocketConnection implements ProxySocketConnection {
|
|||
consulting IDENT, cf. RFC 1413. If the request is granted, the SOCKS
|
||||
server makes a connection to the specified port of the destination host.
|
||||
A reply packet is sent to the client when this connection is established,
|
||||
or when the request is rejected or the operation fails.
|
||||
or when the request is rejected or the operation fails.
|
||||
|
||||
+----+----+----+----+----+----+----+----+
|
||||
| VN | CD | DSTPORT | DSTIP |
|
||||
|
@ -126,13 +126,13 @@ public class Socks4ProxySocketConnection implements ProxySocketConnection {
|
|||
while (s < len) {
|
||||
int i = in.read(buf, s, len - s);
|
||||
if (i <= 0) {
|
||||
throw new ProxyException(ProxyInfo.ProxyType.SOCKS4,
|
||||
throw new ProxyException(ProxyInfo.ProxyType.SOCKS4,
|
||||
"stream is closed");
|
||||
}
|
||||
s += i;
|
||||
}
|
||||
if (buf[0] != 0) {
|
||||
throw new ProxyException(ProxyInfo.ProxyType.SOCKS4,
|
||||
throw new ProxyException(ProxyInfo.ProxyType.SOCKS4,
|
||||
"server returns VN " + buf[0]);
|
||||
}
|
||||
if (buf[1] != 90) {
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||
|
||||
/**
|
||||
* Socket factory for Socks5 proxy.
|
||||
*
|
||||
*
|
||||
* @author Atul Aggarwal
|
||||
*/
|
||||
public class Socks5ProxySocketConnection implements ProxySocketConnection {
|
||||
|
@ -130,12 +130,12 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
|
|||
buf[index++] = 1;
|
||||
buf[index++] = (byte) (user.length());
|
||||
byte[] userBytes = user.getBytes(StringUtils.UTF8);
|
||||
System.arraycopy(userBytes, 0, buf, index,
|
||||
System.arraycopy(userBytes, 0, buf, index,
|
||||
user.length());
|
||||
index += user.length();
|
||||
byte[] passwordBytes = passwd.getBytes(StringUtils.UTF8);
|
||||
buf[index++] = (byte) (passwordBytes.length);
|
||||
System.arraycopy(passwordBytes, 0, buf, index,
|
||||
System.arraycopy(passwordBytes, 0, buf, index,
|
||||
passwd.length());
|
||||
index += passwd.length();
|
||||
|
||||
|
@ -258,7 +258,7 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
|
|||
}
|
||||
catch (Exception eee) {
|
||||
}
|
||||
throw new ProxyException(ProxyInfo.ProxyType.SOCKS5,
|
||||
throw new ProxyException(ProxyInfo.ProxyType.SOCKS5,
|
||||
"server returns " + buf[1]);
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,7 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
|
|||
}
|
||||
}
|
||||
|
||||
private static void fill(InputStream in, byte[] buf, int len)
|
||||
private static void fill(InputStream in, byte[] buf, int len)
|
||||
throws IOException {
|
||||
int s = 0;
|
||||
while (s < len) {
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.jivesoftware.smack.sasl.packet.SaslStreamElements.SASLFailure;
|
|||
public class SASLErrorException extends XMPPException {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 6247573875760717257L;
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ public abstract class SASLMechanism implements Comparable<SASLMechanism> {
|
|||
* <p>
|
||||
* A simple SASLPrep StringTransformer would be for example: <code>java.text.Normalizer.normalize(string, Form.NFKC);</code>
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param stringTransformer set StringTransformer to use for SASLPrep.
|
||||
* @see <a href="http://tools.ietf.org/html/rfc4013">RFC 4013 - SASLprep: Stringprep Profile for User Names and Passwords</a>
|
||||
*/
|
||||
|
@ -111,28 +111,28 @@ public abstract class SASLMechanism implements Comparable<SASLMechanism> {
|
|||
* Builds and sends the <tt>auth</tt> stanza to the server. Note that this method of
|
||||
* authentication is not recommended, since it is very inflexible. Use
|
||||
* {@link #authenticate(String, DomainBareJid, CallbackHandler, EntityBareJid, SSLSession)} whenever possible.
|
||||
*
|
||||
*
|
||||
* Explanation of auth stanza:
|
||||
*
|
||||
* The client authentication stanza needs to include the digest-uri of the form: xmpp/serviceName
|
||||
* From RFC-2831:
|
||||
*
|
||||
* The client authentication stanza needs to include the digest-uri of the form: xmpp/serviceName
|
||||
* From RFC-2831:
|
||||
* digest-uri = "digest-uri" "=" digest-uri-value
|
||||
* digest-uri-value = serv-type "/" host [ "/" serv-name ]
|
||||
*
|
||||
* digest-uri:
|
||||
* Indicates the principal name of the service with which the client
|
||||
* wishes to connect, formed from the serv-type, host, and serv-name.
|
||||
*
|
||||
* digest-uri:
|
||||
* Indicates the principal name of the service with which the client
|
||||
* wishes to connect, formed from the serv-type, host, and serv-name.
|
||||
* For example, the FTP service
|
||||
* on "ftp.example.com" would have a "digest-uri" value of "ftp/ftp.example.com"; the SMTP
|
||||
* server from the example above would have a "digest-uri" value of
|
||||
* "smtp/mail3.example.com/example.com".
|
||||
*
|
||||
*
|
||||
* host:
|
||||
* The DNS host name or IP address for the service requested. The DNS host name
|
||||
* must be the fully-qualified canonical name of the host. The DNS host name is the
|
||||
* preferred form; see notes on server processing of the digest-uri.
|
||||
*
|
||||
* serv-name:
|
||||
*
|
||||
* serv-name:
|
||||
* Indicates the name of the service if it is replicated. The service is
|
||||
* considered to be replicated if the client's service-location process involves resolution
|
||||
* using standard DNS lookup operations, and if these operations involve DNS records (such
|
||||
|
@ -154,8 +154,8 @@ public abstract class SASLMechanism implements Comparable<SASLMechanism> {
|
|||
* @param authzid the optional authorization identity.
|
||||
* @param sslSession the optional SSL/TLS session (if one was established)
|
||||
* @throws SmackException If a network error occurs while authenticating.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public final void authenticate(String username, String host, DomainBareJid serviceName, String password,
|
||||
EntityBareJid authzid, SSLSession sslSession)
|
||||
|
@ -187,8 +187,8 @@ public abstract class SASLMechanism implements Comparable<SASLMechanism> {
|
|||
* @param authzid the optional authorization identity.
|
||||
* @param sslSession the optional SSL/TLS session (if one was established)
|
||||
* @throws SmackException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void authenticate(String host, DomainBareJid serviceName, CallbackHandler cbh, EntityBareJid authzid, SSLSession sslSession)
|
||||
throws SmackException, NotConnectedException, InterruptedException {
|
||||
|
@ -225,7 +225,7 @@ public abstract class SASLMechanism implements Comparable<SASLMechanism> {
|
|||
* Should return the initial response of the SASL mechanism. The returned byte array will be
|
||||
* send base64 encoded to the server. SASL mechanism are free to return <code>null</code> or an
|
||||
* empty array here.
|
||||
*
|
||||
*
|
||||
* @return the initial response or null
|
||||
* @throws SmackException
|
||||
*/
|
||||
|
@ -313,7 +313,7 @@ public abstract class SASLMechanism implements Comparable<SASLMechanism> {
|
|||
|
||||
/**
|
||||
* SASLprep the given String. The resulting String is in UTF-8.
|
||||
*
|
||||
*
|
||||
* @param string the String to sasl prep.
|
||||
* @return the given String SASL preped
|
||||
* @see <a href="http://tools.ietf.org/html/rfc4013">RFC 4013 - SASLprep: Stringprep Profile for User Names and Passwords</a>
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.jivesoftware.smack.sasl.SASLMechanism;
|
|||
* Note that X-OAUTH2 is experimental in Smack. This is because Google defined, besides being a bad practice (XEP-134),
|
||||
* custom attributes to the 'auth' stanza, as can be seen here
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* {@code
|
||||
* <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="X-OAUTH2"
|
||||
|
@ -40,9 +40,9 @@ import org.jivesoftware.smack.sasl.SASLMechanism;
|
|||
* auth:client-uses-full-bind-result="true" xmlns:auth="http://www.google.com/talk/protocol/auth">
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* from https://developers.google.com/cloud-print/docs/rawxmpp and here
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* {@code
|
||||
* <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl"
|
||||
|
@ -53,7 +53,7 @@ import org.jivesoftware.smack.sasl.SASLMechanism;
|
|||
* </auth>
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* from https://developers.google.com/talk/jep_extensions/oauth
|
||||
* <p>
|
||||
* Those attribute extensions are currently not supported by Smack, and it's unclear how it affects authorization and
|
||||
|
|
|
@ -24,7 +24,7 @@ public interface ScramHmac {
|
|||
|
||||
/**
|
||||
* RFC 5802 § 2.2 HMAC(key, str).
|
||||
*
|
||||
*
|
||||
* @param key
|
||||
* @param str
|
||||
* @return the HMAC-SHA1 value of the input.
|
||||
|
|
|
@ -262,7 +262,7 @@ public abstract class ScramMechanism extends SASLMechanism {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return the Channel Binding data.
|
||||
* @throws SmackException
|
||||
*/
|
||||
|
@ -356,11 +356,11 @@ public abstract class ScramMechanism extends SASLMechanism {
|
|||
|
||||
/**
|
||||
* RFC 5802 § 2.2 HMAC(key, str)
|
||||
*
|
||||
*
|
||||
* @param key
|
||||
* @param str
|
||||
* @return the HMAC-SHA1 value of the input.
|
||||
* @throws SmackException
|
||||
* @throws SmackException
|
||||
*/
|
||||
private byte[] hmac(byte[] key, byte[] str) throws SmackException {
|
||||
try {
|
||||
|
@ -377,12 +377,12 @@ public abstract class ScramMechanism extends SASLMechanism {
|
|||
* Hi() is, essentially, PBKDF2 [RFC2898] with HMAC() as the pseudorandom function
|
||||
* (PRF) and with dkLen == output length of HMAC() == output length of H().
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param normalizedPassword the normalized password.
|
||||
* @param salt
|
||||
* @param iterations
|
||||
* @return the result of the Hi function.
|
||||
* @throws SmackException
|
||||
* @throws SmackException
|
||||
*/
|
||||
private byte[] hi(String normalizedPassword, byte[] salt, int iterations) throws SmackException {
|
||||
byte[] key;
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.jivesoftware.smack.util.TLSUtils;
|
|||
* SCRAM-X-PLUS implementation. Due limitations of the Java API, this mechanism only supports the 'tls-server-end-point'
|
||||
* channel binding type. But on the other hand, the other relevant channel binding type 'tls-unique' has some flaws (see
|
||||
* 3SHAKE, RFC 7627).
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
*/
|
||||
public abstract class ScramPlusMechanism extends ScramMechanism {
|
||||
|
|
|
@ -154,7 +154,7 @@ public class SaslStreamElements {
|
|||
/**
|
||||
* Construct a new SASL success stream element with optional additional data for the SASL layer.
|
||||
* (RFC6120 6.3.10)
|
||||
*
|
||||
*
|
||||
* @param data additional data for the SASL layer or <code>null</code>
|
||||
*/
|
||||
public Success(String data) {
|
||||
|
@ -163,7 +163,7 @@ public class SaslStreamElements {
|
|||
|
||||
/**
|
||||
* Returns additional data for the SASL layer or <code>null</code>.
|
||||
*
|
||||
*
|
||||
* @return additional data or <code>null</code>
|
||||
*/
|
||||
public String getData() {
|
||||
|
@ -220,7 +220,7 @@ public class SaslStreamElements {
|
|||
|
||||
/**
|
||||
* Get the SASL related error condition.
|
||||
*
|
||||
*
|
||||
* @return the SASL related error condition.
|
||||
*/
|
||||
public SASLError getSASLError() {
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
|||
* <p>
|
||||
* Based on ArrayBlockingQueue of OpenJDK by Doug Lea (who released ArrayBlockingQueue as public
|
||||
* domain).
|
||||
*
|
||||
*
|
||||
* @param <E> the type of elements held in this collection
|
||||
*/
|
||||
public class ArrayBlockingQueueWithShutdown<E> extends AbstractQueue<E> implements BlockingQueue<E> {
|
||||
|
@ -170,7 +170,7 @@ public class ArrayBlockingQueueWithShutdown<E> extends AbstractQueue<E> implemen
|
|||
|
||||
/**
|
||||
* Returns true if the queue is currently shut down.
|
||||
*
|
||||
*
|
||||
* @return true if the queue is shut down.
|
||||
*/
|
||||
public boolean isShutdown() {
|
||||
|
|
|
@ -135,7 +135,7 @@ public class DNSUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param domain the domain.
|
||||
* @param domainType the XMPP domain type, server or client.
|
||||
* @param failedAddresses a list that will be populated with host addresses that failed to resolve.
|
||||
|
@ -188,7 +188,7 @@ public class DNSUtil {
|
|||
* Sort a given list of SRVRecords as described in RFC 2782
|
||||
* Note that we follow the RFC with one exception. In a group of the same priority, only the first entry
|
||||
* is calculated by random. The others are ore simply ordered by their priority.
|
||||
*
|
||||
*
|
||||
* @param records
|
||||
* @return the list of resolved HostAddresses
|
||||
*/
|
||||
|
|
|
@ -102,7 +102,7 @@ public final class FileUtils {
|
|||
*
|
||||
* @param file
|
||||
* @return the content of file or null in case of an error
|
||||
* @throws IOException
|
||||
* @throws IOException
|
||||
*/
|
||||
@SuppressWarnings("DefaultCharset")
|
||||
public static String readFileOrThrow(File file) throws IOException {
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.util.List;
|
|||
/**
|
||||
* An ObservableReader is a wrapper on a Reader that notifies to its listeners when
|
||||
* reading character streams.
|
||||
*
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
public class ObservableReader extends Reader {
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.List;
|
|||
/**
|
||||
* An ObservableWriter is a wrapper on a Writer that notifies to its listeners when
|
||||
* writing to character streams.
|
||||
*
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
public class ObservableWriter extends Writer {
|
||||
|
|
|
@ -140,12 +140,12 @@ public class PacketParserUtils {
|
|||
|
||||
/**
|
||||
* Tries to parse and return either a Message, IQ or Presence stanza.
|
||||
*
|
||||
*
|
||||
* connection is optional and is used to return feature-not-implemented errors for unknown IQ stanzas.
|
||||
*
|
||||
* @param parser
|
||||
* @return a stanza which is either a Message, IQ or Presence.
|
||||
* @throws Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public static Stanza parseStanza(XmlPullParser parser) throws Exception {
|
||||
ParserUtils.assertAtStartTag(parser);
|
||||
|
@ -170,7 +170,7 @@ public class PacketParserUtils {
|
|||
* <code>getText()</code> if the parser is on START_TAG or END_TAG. So you must not rely on this
|
||||
* behavior when using the parser.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @return A suitable XmlPullParser for XMPP parsing
|
||||
* @throws XmlPullParserException
|
||||
*/
|
||||
|
@ -198,7 +198,7 @@ public class PacketParserUtils {
|
|||
* <code>getText()</code> if the parser is on START_TAG or END_TAG. So you must not rely on this
|
||||
* behavior when using the parser.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param reader
|
||||
* @return A suitable XmlPullParser for XMPP parsing
|
||||
* @throws XmlPullParserException
|
||||
|
@ -214,7 +214,7 @@ public class PacketParserUtils {
|
|||
*
|
||||
* @param parser the XML parser, positioned at the start of a message packet.
|
||||
* @return a Message packet.
|
||||
* @throws Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public static Message parseMessage(XmlPullParser parser)
|
||||
throws Exception {
|
||||
|
@ -291,7 +291,7 @@ public class PacketParserUtils {
|
|||
* </p>
|
||||
* This method is used for the parts where the XMPP specification requires elements that contain
|
||||
* only text or are the empty element.
|
||||
*
|
||||
*
|
||||
* @param parser
|
||||
* @return the textual content of the element as String
|
||||
* @throws XmlPullParserException
|
||||
|
@ -362,7 +362,7 @@ public class PacketParserUtils {
|
|||
* closing tag of the same depth is returned as String.
|
||||
* </p>
|
||||
* Note that only the outermost namespace attributes ("xmlns") will be returned, not nested ones.
|
||||
*
|
||||
*
|
||||
* @param parser the XML pull parser
|
||||
* @return the content of a tag
|
||||
* @throws XmlPullParserException if parser encounters invalid XML
|
||||
|
@ -399,7 +399,7 @@ public class PacketParserUtils {
|
|||
* <p>
|
||||
* In particular Android's XmlPullParser does not support XML_ROUNDTRIP.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param parser
|
||||
* @param depth
|
||||
* @param fullNamespaces
|
||||
|
@ -499,7 +499,7 @@ public class PacketParserUtils {
|
|||
*
|
||||
* @param parser the XML parser, positioned at the start of a presence packet.
|
||||
* @return a Presence packet.
|
||||
* @throws Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public static Presence parsePresence(XmlPullParser parser)
|
||||
throws Exception {
|
||||
|
@ -662,8 +662,8 @@ public class PacketParserUtils {
|
|||
*
|
||||
* @param parser the XML parser, positioned at the start of the mechanisms stanza.
|
||||
* @return a collection of Stings with the mechanisms included in the mechanisms stanza.
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
*/
|
||||
public static Collection<String> parseMechanisms(XmlPullParser parser)
|
||||
throws XmlPullParserException, IOException {
|
||||
|
@ -747,11 +747,11 @@ public class PacketParserUtils {
|
|||
|
||||
/**
|
||||
* Parses SASL authentication error packets.
|
||||
*
|
||||
*
|
||||
* @param parser the XML parser.
|
||||
* @return a SASL Failure packet.
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
*/
|
||||
public static SASLFailure parseSASLFailure(XmlPullParser parser) throws XmlPullParserException, IOException {
|
||||
final int initialDepth = parser.getDepth();
|
||||
|
@ -835,7 +835,7 @@ public class PacketParserUtils {
|
|||
*
|
||||
* @param parser the XML parser.
|
||||
* @return an error sub-packet.
|
||||
* @throws Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public static StanzaError.Builder parseError(XmlPullParser parser)
|
||||
throws Exception {
|
||||
|
|
|
@ -131,7 +131,7 @@ public class ParserUtils {
|
|||
|
||||
/**
|
||||
* Get the boolean value of an argument.
|
||||
*
|
||||
*
|
||||
* @param parser
|
||||
* @param name
|
||||
* @return the boolean value or null of no argument of the given name exists
|
||||
|
|
|
@ -23,14 +23,14 @@ package org.jivesoftware.smack.util;
|
|||
*
|
||||
* @see ObservableReader#addReaderListener
|
||||
* @see ObservableReader#removeReaderListener
|
||||
*
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
public interface ReaderListener {
|
||||
|
||||
/**
|
||||
* Notification that the Reader has read a new string.
|
||||
*
|
||||
*
|
||||
* @param str the read String
|
||||
*/
|
||||
void read(String str);
|
||||
|
|
|
@ -382,7 +382,7 @@ public class StringUtils {
|
|||
|
||||
/**
|
||||
* Returns true if the given CharSequence is empty.
|
||||
*
|
||||
*
|
||||
* @param cs
|
||||
* @return true if the given CharSequence is empty
|
||||
*/
|
||||
|
|
|
@ -58,7 +58,7 @@ public class TLSUtils {
|
|||
* TLSv1.1. This method goes one step beyond and upgrades the handshake to use TLSv1 or better.
|
||||
* This method requires the underlying OS to support all of TLSv1.2 , 1.1 and 1.0.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param builder the configuration builder to apply this setting to
|
||||
* @param <B> Type of the ConnectionConfiguration builder.
|
||||
*
|
||||
|
@ -78,7 +78,7 @@ public class TLSUtils {
|
|||
* XMPP Manifesto</a>, TLSv1.2 shall be deployed, providing fallback support for SSLv3 and
|
||||
* TLSv1.1.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param builder the configuration builder to apply this setting to
|
||||
* @param <B> Type of the ConnectionConfiguration builder.
|
||||
*
|
||||
|
@ -96,7 +96,7 @@ public class TLSUtils {
|
|||
* <b>invalidates all security guarantees provided by TLS</b>. Only use this method if you understand the
|
||||
* implications.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param builder a connection configuration builder.
|
||||
* @param <B> Type of the ConnectionConfiguration builder.
|
||||
* @throws NoSuchAlgorithmException
|
||||
|
@ -125,7 +125,7 @@ public class TLSUtils {
|
|||
* <b>invalidates all security guarantees provided by TLS</b>. Only use this method if you understand the
|
||||
* implications.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param builder a connection configuration builder.
|
||||
* @param <B> Type of the ConnectionConfiguration builder.
|
||||
* @return the given builder.
|
||||
|
|
|
@ -23,14 +23,14 @@ package org.jivesoftware.smack.util;
|
|||
*
|
||||
* @see ObservableWriter#addWriterListener
|
||||
* @see ObservableWriter#removeWriterListener
|
||||
*
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
public interface WriterListener {
|
||||
|
||||
/**
|
||||
* Notification that the Writer has written a new string.
|
||||
*
|
||||
*
|
||||
* @param str the written string
|
||||
*/
|
||||
void write(String str);
|
||||
|
|
|
@ -208,7 +208,7 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
|
|||
|
||||
/**
|
||||
* Add a right angle bracket '>'.
|
||||
*
|
||||
*
|
||||
* @return a reference to this object.
|
||||
*/
|
||||
public XmlStringBuilder rightAngleBracket() {
|
||||
|
@ -557,7 +557,7 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
|
|||
if (csq instanceof XmlStringBuilder) {
|
||||
((XmlStringBuilder) csq).write(writer, enclosingNamespace);
|
||||
}
|
||||
else if (csq instanceof XmlNsAttribute) {
|
||||
else if (csq instanceof XmlNsAttribute) {
|
||||
XmlNsAttribute xmlNsAttribute = (XmlNsAttribute) csq;
|
||||
if (!xmlNsAttribute.value.equals(enclosingNamespace)) {
|
||||
writer.write(xmlNsAttribute.toString());
|
||||
|
@ -582,7 +582,7 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
|
|||
if (csq instanceof XmlStringBuilder) {
|
||||
((XmlStringBuilder) csq).appendXmlTo(res, enclosingNamespace);
|
||||
}
|
||||
else if (csq instanceof XmlNsAttribute) {
|
||||
else if (csq instanceof XmlNsAttribute) {
|
||||
XmlNsAttribute xmlNsAttribute = (XmlNsAttribute) csq;
|
||||
if (!xmlNsAttribute.value.equals(enclosingNamespace)) {
|
||||
sb.append(xmlNsAttribute);
|
||||
|
|
|
@ -36,7 +36,7 @@ public class HostAddress {
|
|||
|
||||
/**
|
||||
* Creates a new HostAddress with the given FQDN.
|
||||
*
|
||||
*
|
||||
* @param fqdn the optional fully qualified domain name (FQDN).
|
||||
* @param port The port to connect on.
|
||||
* @param inetAddresses list of addresses.
|
||||
|
@ -109,7 +109,7 @@ public class HostAddress {
|
|||
* Retrieve the Exception that caused a connection failure to this HostAddress. Every
|
||||
* HostAddress found in {@link ConnectionException} will have an Exception set,
|
||||
* which can be retrieved with this method.
|
||||
*
|
||||
*
|
||||
* @return the Exception causing this HostAddress to fail
|
||||
*/
|
||||
public Map<InetAddress, Exception> getExceptions() {
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.minidns.dnsname.DnsName;
|
|||
* @see <a href="http://tools.ietf.org/html/rfc2782">RFC 2782: A DNS RR for specifying the location of services (DNS
|
||||
* SRV)</a>
|
||||
* @author Florian Schmaus
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SRVRecord extends HostAddress implements Comparable<SRVRecord> {
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class SRVRecord extends HostAddress implements Comparable<SRVRecord> {
|
|||
|
||||
/**
|
||||
* SRV Record constructor.
|
||||
*
|
||||
*
|
||||
* @param fqdn Fully qualified domain name
|
||||
* @param port The connection port
|
||||
* @param priority Priority of the target host
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||
/**
|
||||
* Base32 string encoding is useful for when filenames case-insensitive filesystems are encoded.
|
||||
* Base32 representation takes roughly 20% more space then Base64.
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
* Based on code by Brian Wellington (bwelling@xbill.org)
|
||||
* @see <a href="http://en.wikipedia.org/wiki/Base32">Base32 Wikipedia entry</a>
|
||||
|
|
|
@ -24,7 +24,7 @@ package org.jivesoftware.smack.util.stringencoder;
|
|||
public interface StringEncoder {
|
||||
/**
|
||||
* Encodes an string to another representation.
|
||||
*
|
||||
*
|
||||
* @param string
|
||||
* @return the encoded String
|
||||
*/
|
||||
|
@ -32,7 +32,7 @@ public interface StringEncoder {
|
|||
|
||||
/**
|
||||
* Decodes an string back to it's initial representation.
|
||||
*
|
||||
*
|
||||
* @param string
|
||||
* @return the decoded String
|
||||
*/
|
||||
|
|
|
@ -38,16 +38,16 @@ import org.jxmpp.stringprep.XmppStringprepException;
|
|||
/**
|
||||
* A dummy implementation of {@link XMPPConnection}, intended to be used during
|
||||
* unit tests.
|
||||
*
|
||||
*
|
||||
* Instances store any packets that are delivered to be send using the
|
||||
* {@link #sendStanza(Stanza)} method in a blocking queue. The content of this queue
|
||||
* can be inspected using {@link #getSentPacket()}. Typically these queues are
|
||||
* used to retrieve a message that was generated by the client.
|
||||
*
|
||||
*
|
||||
* Packets that should be processed by the client to simulate a received stanza
|
||||
* can be delivered using the {@linkplain #processStanza(Stanza)} method.
|
||||
* It invokes the registered stanza interceptors and listeners.
|
||||
*
|
||||
*
|
||||
* @see XMPPConnection
|
||||
* @author Guenther Niess
|
||||
*/
|
||||
|
@ -130,7 +130,7 @@ public class DummyConnection extends AbstractXMPPConnection {
|
|||
/**
|
||||
* Returns the number of packets that's sent through {@link #sendStanza(Stanza)} and
|
||||
* that has not been returned by {@link #getSentPacket()}.
|
||||
*
|
||||
*
|
||||
* @return the number of packets which are in the queue.
|
||||
*/
|
||||
public int getNumberOfSentPackets() {
|
||||
|
@ -140,7 +140,7 @@ public class DummyConnection extends AbstractXMPPConnection {
|
|||
/**
|
||||
* Returns the first stanza that's sent through {@link #sendStanza(Stanza)}
|
||||
* and that has not been returned by earlier calls to this method.
|
||||
*
|
||||
*
|
||||
* @return a sent packet.
|
||||
*/
|
||||
public <P extends TopLevelStreamElement> P getSentPacket() {
|
||||
|
@ -152,7 +152,7 @@ public class DummyConnection extends AbstractXMPPConnection {
|
|||
* and that has not been returned by earlier calls to this method. This
|
||||
* method will block for up to the specified number of seconds if no packets
|
||||
* have been sent yet.
|
||||
*
|
||||
*
|
||||
* @return a sent packet.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -142,7 +142,7 @@ public class StanzaCollectorTest {
|
|||
consumer1.interrupt();
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
// We cannot guarantee that this is going to pass due to the possible issue of timing between consumer 1
|
||||
// We cannot guarantee that this is going to pass due to the possible issue of timing between consumer 1
|
||||
// and main, but the probability is extremely remote.
|
||||
assertNull(collector.pollResult());
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class ThreadedDummyConnection extends DummyConnection {
|
|||
|
||||
/**
|
||||
* Calling this method will cause the next sendStanza call with an IQ stanza to timeout.
|
||||
* This is accomplished by simply stopping the auto creating of the reply stanza
|
||||
* This is accomplished by simply stopping the auto creating of the reply stanza
|
||||
* or processing one that was entered via {@link #processStanza(Stanza)}.
|
||||
*/
|
||||
public void setTimeout() {
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.jxmpp.stringprep.XmppStringprepException;
|
|||
|
||||
/**
|
||||
* Tests that verifies the correct behavior of creating result and error IQ packets.
|
||||
*
|
||||
*
|
||||
* @see <a href="http://xmpp.org/rfcs/rfc3920.html#stanzas-semantics-iq">IQ Semantics</a>
|
||||
* @author Guenther Niess
|
||||
*/
|
||||
|
@ -38,7 +38,7 @@ public class IQResponseTest {
|
|||
|
||||
/**
|
||||
* Test creating a simple and empty IQ response.
|
||||
* @throws XmppStringprepException
|
||||
* @throws XmppStringprepException
|
||||
*/
|
||||
@Test
|
||||
public void testGeneratingSimpleResponse() throws XmppStringprepException {
|
||||
|
@ -58,7 +58,7 @@ public class IQResponseTest {
|
|||
|
||||
/**
|
||||
* Test creating a error response based on an IQ request.
|
||||
* @throws XmppStringprepException
|
||||
* @throws XmppStringprepException
|
||||
*/
|
||||
@Test
|
||||
public void testGeneratingValidErrorResponse() throws XmppStringprepException {
|
||||
|
@ -83,7 +83,7 @@ public class IQResponseTest {
|
|||
/**
|
||||
* According to <a href="http://xmpp.org/rfcs/rfc3920.html#stanzas-semantics-iq"
|
||||
* >RFC3920: IQ Semantics</a> we shouldn't respond to an IQ of type result.
|
||||
* @throws XmppStringprepException
|
||||
* @throws XmppStringprepException
|
||||
*/
|
||||
@Test
|
||||
public void testGeneratingResponseBasedOnResult() throws XmppStringprepException {
|
||||
|
@ -106,7 +106,7 @@ public class IQResponseTest {
|
|||
/**
|
||||
* According to <a href="http://xmpp.org/rfcs/rfc3920.html#stanzas-semantics-iq"
|
||||
* >RFC3920: IQ Semantics</a> we shouldn't respond to an IQ of type error.
|
||||
* @throws XmppStringprepException
|
||||
* @throws XmppStringprepException
|
||||
*/
|
||||
@Test
|
||||
public void testGeneratingErrorBasedOnError() throws XmppStringprepException {
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
/**
|
||||
*
|
||||
* Copyright © 2017 Ingo Bauersachs
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jivesoftware.smack.packet;
|
||||
|
||||
import static org.jivesoftware.smack.packet.StanzaError.Condition;
|
||||
import static org.jivesoftware.smack.packet.StanzaError.Type;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class XMPPErrorTest {
|
||||
@Test
|
||||
public void testConditionHasDefaultTypeMapping() throws NoSuchFieldException, IllegalAccessException {
|
||||
Map<Condition, Type> conditionToTypeMap = StanzaError.CONDITION_TO_TYPE;
|
||||
assertEquals("CONDITION_TO_TYPE map is likely out of sync with Condition enum",
|
||||
Condition.values().length,
|
||||
conditionToTypeMap.size());
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* Copyright © 2017 Ingo Bauersachs
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jivesoftware.smack.packet;
|
||||
|
||||
import static org.jivesoftware.smack.packet.StanzaError.Condition;
|
||||
import static org.jivesoftware.smack.packet.StanzaError.Type;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class XMPPErrorTest {
|
||||
@Test
|
||||
public void testConditionHasDefaultTypeMapping() throws NoSuchFieldException, IllegalAccessException {
|
||||
Map<Condition, Type> conditionToTypeMap = StanzaError.CONDITION_TO_TYPE;
|
||||
assertEquals("CONDITION_TO_TYPE map is likely out of sync with Condition enum",
|
||||
Condition.values().length,
|
||||
conditionToTypeMap.size());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public class ParsingExceptionTest {
|
|||
|
||||
@Test
|
||||
public void consumeUnparsedInput() throws Exception {
|
||||
final String MESSAGE_EXCEPTION_ELEMENT =
|
||||
final String MESSAGE_EXCEPTION_ELEMENT =
|
||||
"<" + ThrowException.ELEMENT + " xmlns='" + ThrowException.NAMESPACE + "'>" +
|
||||
"<nothingInHere>" +
|
||||
"</nothingInHere>" +
|
||||
|
|
|
@ -671,7 +671,7 @@ public class PacketParserUtilsTest {
|
|||
/**
|
||||
* RFC6121 5.2.3 explicitly disallows mixed content in <body/> elements. Make sure that we throw
|
||||
* an exception if we encounter such an element.
|
||||
*
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test(expected = XmlPullParserException.class)
|
||||
|
|
|
@ -109,7 +109,7 @@ public class EnhancedDebugger extends SmackDebugger {
|
|||
|
||||
{
|
||||
URL url;
|
||||
// Load the image icons
|
||||
// Load the image icons
|
||||
url =
|
||||
Thread.currentThread().getContextClassLoader().getResource("images/nav_left_blue.png");
|
||||
if (url != null) {
|
||||
|
@ -205,7 +205,7 @@ public class EnhancedDebugger extends SmackDebugger {
|
|||
}
|
||||
|
||||
// We'll arrange the UI into six tabs. The first tab contains all data, the second
|
||||
// client generated XML, the third server generated XML, the fourth allows to send
|
||||
// client generated XML, the third server generated XML, the fourth allows to send
|
||||
// ad-hoc messages and the fifth contains connection information.
|
||||
tabbedPane = new JTabbedPane();
|
||||
|
||||
|
|
|
@ -219,10 +219,10 @@ public final class EnhancedDebuggerWindow {
|
|||
}
|
||||
|
||||
// We'll arrange the UI into tabs. The last tab contains Smack's information.
|
||||
// All the connection debugger tabs will be shown before the Smack info tab.
|
||||
// All the connection debugger tabs will be shown before the Smack info tab.
|
||||
tabbedPane = new JTabbedPane();
|
||||
|
||||
// Create the Smack info panel
|
||||
// Create the Smack info panel
|
||||
JPanel informationPanel = new JPanel();
|
||||
informationPanel.setLayout(new BoxLayout(informationPanel, BoxLayout.Y_AXIS));
|
||||
|
||||
|
|
|
@ -51,9 +51,9 @@ import org.jivesoftware.smack.util.WriterListener;
|
|||
import org.jxmpp.jid.EntityFullJid;
|
||||
|
||||
/**
|
||||
* The LiteDebugger is a very simple debugger that allows to debug sent, received and
|
||||
* The LiteDebugger is a very simple debugger that allows to debug sent, received and
|
||||
* interpreted messages.
|
||||
*
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
public class LiteDebugger extends SmackDebugger {
|
||||
|
@ -82,7 +82,7 @@ public class LiteDebugger extends SmackDebugger {
|
|||
frame = new JFrame("Smack Debug Window -- " + connection.getXMPPServiceDomain() + ":" +
|
||||
connection.getPort());
|
||||
|
||||
// Add listener for window closing event
|
||||
// Add listener for window closing event
|
||||
frame.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent evt) {
|
||||
|
@ -265,10 +265,10 @@ public class LiteDebugger extends SmackDebugger {
|
|||
}
|
||||
|
||||
/**
|
||||
* Notification that the root window is closing. Stop listening for received and
|
||||
* Notification that the root window is closing. Stop listening for received and
|
||||
* transmitted packets.
|
||||
*
|
||||
* @param evt the event that indicates that the root window is closing
|
||||
*
|
||||
* @param evt the event that indicates that the root window is closing
|
||||
*/
|
||||
public void rootWindowClosing(WindowEvent evt) {
|
||||
// TODO: Remove debugger from connection.
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.jivesoftware.smack.initializer.UrlInitializer;
|
|||
|
||||
/**
|
||||
* Initializes the providers in the experimental code stream.
|
||||
*
|
||||
*
|
||||
* @author Florian Schmaus
|
||||
*/
|
||||
public class ExperimentalInitializer extends UrlInitializer {
|
||||
|
|
|
@ -85,7 +85,7 @@ public final class CarbonManager extends Manager {
|
|||
});
|
||||
}
|
||||
|
||||
private static final StanzaFilter CARBON_EXTENSION_FILTER =
|
||||
private static final StanzaFilter CARBON_EXTENSION_FILTER =
|
||||
// @formatter:off
|
||||
new AndFilter(
|
||||
new OrFilter(
|
||||
|
@ -221,12 +221,12 @@ public final class CarbonManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns true if XMPP Carbons are supported by the server.
|
||||
*
|
||||
*
|
||||
* @return true if supported
|
||||
* @throws NotConnectedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public boolean isSupportedByServer() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return ServiceDiscoveryManager.getInstanceFor(connection()).serverSupportsFeature(CarbonExtension.NAMESPACE);
|
||||
|
@ -239,7 +239,7 @@ public final class CarbonManager extends Manager {
|
|||
* You should first check for support using isSupportedByServer().
|
||||
*
|
||||
* @param new_state whether carbons should be enabled or disabled
|
||||
* @throws NotConnectedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @deprecated use {@link #enableCarbonsAsync(ExceptionCallback)} or {@link #disableCarbonsAsync(ExceptionCallback)} instead.
|
||||
*/
|
||||
|
@ -256,7 +256,7 @@ public final class CarbonManager extends Manager {
|
|||
* because of a slow network connection). Thus, if the thread performing this operation is interrupted while the
|
||||
* queue is full, an {@link InterruptedException} is thrown.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param exceptionCallback the optional exception callback.
|
||||
* @since 4.2
|
||||
*/
|
||||
|
@ -272,7 +272,7 @@ public final class CarbonManager extends Manager {
|
|||
* because of a slow network connection). Thus, if the thread performing this operation is interrupted while the
|
||||
* queue is full, an {@link InterruptedException} is thrown.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param exceptionCallback the optional exception callback.
|
||||
* @since 4.2
|
||||
*/
|
||||
|
@ -302,10 +302,10 @@ public final class CarbonManager extends Manager {
|
|||
* You should first check for support using isSupportedByServer().
|
||||
*
|
||||
* @param new_state whether carbons should be enabled or disabled
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPErrorException
|
||||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*
|
||||
*/
|
||||
public synchronized void setCarbonsEnabled(final boolean new_state) throws NoResponseException,
|
||||
|
@ -322,9 +322,9 @@ public final class CarbonManager extends Manager {
|
|||
/**
|
||||
* Helper method to enable carbons.
|
||||
*
|
||||
* @throws XMPPException
|
||||
* @throws XMPPException
|
||||
* @throws SmackException if there was no response from the server.
|
||||
* @throws InterruptedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void enableCarbons() throws XMPPException, SmackException, InterruptedException {
|
||||
setCarbonsEnabled(true);
|
||||
|
@ -333,9 +333,9 @@ public final class CarbonManager extends Manager {
|
|||
/**
|
||||
* Helper method to disable carbons.
|
||||
*
|
||||
* @throws XMPPException
|
||||
* @throws XMPPException
|
||||
* @throws SmackException if there was no response from the server.
|
||||
* @throws InterruptedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public void disableCarbons() throws XMPPException, SmackException, InterruptedException {
|
||||
setCarbonsEnabled(false);
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.jivesoftware.smackx.forward.packet.Forwarded;
|
|||
* Stanza extension for XEP-0280: Message Carbons. The extension
|
||||
* <a href="http://xmpp.org/extensions/xep-0280.html">XEP-0280</a> is
|
||||
* meant to synchronize a message flow to multiple presences of a user.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* It accomplishes this by wrapping a {@link Forwarded} stanza in a <b>sent</b>
|
||||
* or <b>received</b> element
|
||||
|
@ -41,7 +41,7 @@ public class CarbonExtension implements ExtensionElement {
|
|||
|
||||
/**
|
||||
* Construct a Carbon message extension.
|
||||
*
|
||||
*
|
||||
* @param dir Determines if the carbon is being sent/received
|
||||
* @param fwd The forwarded message.
|
||||
*/
|
||||
|
@ -130,7 +130,7 @@ public class CarbonExtension implements ExtensionElement {
|
|||
|
||||
/**
|
||||
* Stanza extension indicating that a message may not be carbon-copied. Adding this
|
||||
* extension to any message will disallow that message from being copied.
|
||||
* extension to any message will disallow that message from being copied.
|
||||
*/
|
||||
public static final class Private implements ExtensionElement {
|
||||
public static final Private INSTANCE = new Private();
|
||||
|
@ -157,7 +157,7 @@ public class CarbonExtension implements ExtensionElement {
|
|||
/**
|
||||
* Marks a message "private", so that it will not be carbon-copied, by adding private packet
|
||||
* extension to the message.
|
||||
*
|
||||
*
|
||||
* @param message the message to add the private extension to
|
||||
*/
|
||||
public static void addTo(Message message) {
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
/**
|
||||
* This class implements the {@link ExtensionElementProvider} to parse
|
||||
* carbon copied messages from a packet. It will return a {@link CarbonExtension} stanza extension.
|
||||
*
|
||||
*
|
||||
* @author Georg Lukas
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -32,11 +32,11 @@ import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
|||
|
||||
/**
|
||||
* Chat Markers Manager class (XEP-0333).
|
||||
*
|
||||
*
|
||||
* @see <a href="http://xmpp.org/extensions/xep-0333.html">XEP-0333: Chat
|
||||
* Markers</a>
|
||||
* @author Fernando Ramirez
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class ChatMarkersManager extends Manager {
|
||||
|
||||
|
@ -53,7 +53,7 @@ public final class ChatMarkersManager extends Manager {
|
|||
|
||||
/**
|
||||
* Get the singleton instance of ChatMarkersManager.
|
||||
*
|
||||
*
|
||||
* @param connection
|
||||
* @return the instance of ChatMarkersManager
|
||||
*/
|
||||
|
@ -74,7 +74,7 @@ public final class ChatMarkersManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns true if Chat Markers is supported by the server.
|
||||
*
|
||||
*
|
||||
* @return true if Chat Markers is supported by the server.
|
||||
* @throws NotConnectedException
|
||||
* @throws XMPPErrorException
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue