mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-24 04:52:05 +01:00
Fixes spelling (includes one API change)
Mostly benign changes. Added one new method to replace a method with a spelling mistake in its name. Kept the old method, marked as 'deprecated'.
This commit is contained in:
parent
38c6dd21b4
commit
c85bcadd81
140 changed files with 270 additions and 265 deletions
10
build.gradle
10
build.gradle
|
@ -209,7 +209,7 @@ allprojects {
|
||||||
options.compilerArgs = [
|
options.compilerArgs = [
|
||||||
'-Xlint:all',
|
'-Xlint:all',
|
||||||
// Set '-options' because a non-java7 javac will emit a
|
// Set '-options' because a non-java7 javac will emit a
|
||||||
// warning if source/traget is set to 1.7 and
|
// warning if source/target is set to 1.7 and
|
||||||
// bootclasspath is *not* set.
|
// bootclasspath is *not* set.
|
||||||
// TODO implement a sound heuristic to determine a java7
|
// TODO implement a sound heuristic to determine a java7
|
||||||
// rt.jar on the build host. And if none is found,
|
// rt.jar on the build host. And if none is found,
|
||||||
|
@ -268,7 +268,7 @@ allprojects {
|
||||||
if (JavaVersion.current().isJava8Compatible()) {
|
if (JavaVersion.current().isJava8Compatible()) {
|
||||||
tasks.withType(Javadoc) {
|
tasks.withType(Javadoc) {
|
||||||
// The '-quiet' as second argument is actually a hack,
|
// The '-quiet' as second argument is actually a hack,
|
||||||
// since the one paramater addStringOption doesn't seem to
|
// since the one parameter addStringOption doesn't seem to
|
||||||
// work, we extra add '-quiet', which is added anyway by
|
// work, we extra add '-quiet', which is added anyway by
|
||||||
// gradle.
|
// gradle.
|
||||||
// TODO: This enables all doclint check but
|
// TODO: This enables all doclint check but
|
||||||
|
@ -342,7 +342,7 @@ configure (junit4Projects) {
|
||||||
|
|
||||||
// We need to evaluate the child projects first because
|
// We need to evaluate the child projects first because
|
||||||
// - javadocAll needs the smack-core child to have already resolved
|
// - javadocAll needs the smack-core child to have already resolved
|
||||||
// the jXMPP/MiniDNS dependencies, so that we can the resovled
|
// the jXMPP/MiniDNS dependencies, so that we can the resolved
|
||||||
// version to link to those project's javadoc.
|
// version to link to those project's javadoc.
|
||||||
// - We use the child's project description as description for the
|
// - We use the child's project description as description for the
|
||||||
// Maven POM.
|
// Maven POM.
|
||||||
|
@ -418,7 +418,7 @@ task maybeCheckForSnapshotDependencies {
|
||||||
// Don't check for Snapshot dependencies if this is a snapshot.
|
// Don't check for Snapshot dependencies if this is a snapshot.
|
||||||
onlyIf { isReleaseVersion }
|
onlyIf { isReleaseVersion }
|
||||||
// Run in the execution phase, not in configuration phase, as the
|
// Run in the execution phase, not in configuration phase, as the
|
||||||
// 'each' forces the runtime configuration to be resovled, which
|
// 'each' forces the runtime configuration to be resolved, which
|
||||||
// causes "Cannot change dependencies of configuration after it
|
// causes "Cannot change dependencies of configuration after it
|
||||||
// has been included in dependency resolution." errors.
|
// has been included in dependency resolution." errors.
|
||||||
// See https://discuss.gradle.org/t/23153
|
// See https://discuss.gradle.org/t/23153
|
||||||
|
@ -795,7 +795,7 @@ def getResolvedVersion(queriedProject = 'smack-core', component) {
|
||||||
.resolvedArtifacts
|
.resolvedArtifacts
|
||||||
.findAll {
|
.findAll {
|
||||||
// 'it' is of type ResolvedArtifact, 'id' of
|
// 'it' is of type ResolvedArtifact, 'id' of
|
||||||
// Component*Artifcat*Identifier, and we check the
|
// Component*Artifact*Identifier, and we check the
|
||||||
// ComponentIdentifier.
|
// ComponentIdentifier.
|
||||||
it.id.getComponentIdentifier() instanceof org.gradle.api.artifacts.component.ModuleComponentIdentifier
|
it.id.getComponentIdentifier() instanceof org.gradle.api.artifacts.component.ModuleComponentIdentifier
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ SMACK_EXCEPTIONS[SmackException]="if Smack detected an exceptional situation."
|
||||||
SMACK_EXCEPTIONS[XMPPException]="if an XMPP protocol error was received."
|
SMACK_EXCEPTIONS[XMPPException]="if an XMPP protocol error was received."
|
||||||
SMACK_EXCEPTIONS[SmackSaslException]="if a SASL specific error occurred."
|
SMACK_EXCEPTIONS[SmackSaslException]="if a SASL specific error occurred."
|
||||||
SMACK_EXCEPTIONS[SASLErrorException]="if a SASL protocol error was returned."
|
SMACK_EXCEPTIONS[SASLErrorException]="if a SASL protocol error was returned."
|
||||||
SMACK_EXCEPTIONS[NotAMucServiceException]="if the entity is not a MUC serivce."
|
SMACK_EXCEPTIONS[NotAMucServiceException]="if the entity is not a MUC service."
|
||||||
SMACK_EXCEPTIONS[NoSuchAlgorithmException]="if no such algorithm is available."
|
SMACK_EXCEPTIONS[NoSuchAlgorithmException]="if no such algorithm is available."
|
||||||
SMACK_EXCEPTIONS[KeyManagementException]="if there was a key mangement error."
|
SMACK_EXCEPTIONS[KeyManagementException]="if there was a key mangement error."
|
||||||
SMACK_EXCEPTIONS[XmppStringprepException]="if the provided string is invalid."
|
SMACK_EXCEPTIONS[XmppStringprepException]="if the provided string is invalid."
|
||||||
|
@ -53,7 +53,7 @@ SMACK_EXCEPTIONS[Exception]="if an exception occurred."
|
||||||
SMACK_EXCEPTIONS[TestNotPossibleException]="if the test is not possible."
|
SMACK_EXCEPTIONS[TestNotPossibleException]="if the test is not possible."
|
||||||
SMACK_EXCEPTIONS[TimeoutException]="if there was a timeout."
|
SMACK_EXCEPTIONS[TimeoutException]="if there was a timeout."
|
||||||
SMACK_EXCEPTIONS[IllegalStateException]="if an illegal state was encountered"
|
SMACK_EXCEPTIONS[IllegalStateException]="if an illegal state was encountered"
|
||||||
SMACK_EXCEPTIONS[NoSuchPaddingException]="if the requested padding mechanism is not availble."
|
SMACK_EXCEPTIONS[NoSuchPaddingException]="if the requested padding mechanism is not available."
|
||||||
SMACK_EXCEPTIONS[BadPaddingException]="if the input data is not padded properly."
|
SMACK_EXCEPTIONS[BadPaddingException]="if the input data is not padded properly."
|
||||||
SMACK_EXCEPTIONS[InvalidKeyException]="if the key is invalid."
|
SMACK_EXCEPTIONS[InvalidKeyException]="if the key is invalid."
|
||||||
SMACK_EXCEPTIONS[IllegalBlockSizeException]="if the input data length is incorrect."
|
SMACK_EXCEPTIONS[IllegalBlockSizeException]="if the input data length is incorrect."
|
||||||
|
|
|
@ -15,7 +15,7 @@ for p in $SUBPROJECTS; do
|
||||||
sort | \
|
sort | \
|
||||||
# Remove duplicates
|
# Remove duplicates
|
||||||
uniq | \
|
uniq | \
|
||||||
# Split multi Copyright statemtents, e.g. "2001-2013 FooBar, 2014 Baz"
|
# Split multi Copyright statements, e.g. "2001-2013 FooBar, 2014 Baz"
|
||||||
tr ',' '\n' | \
|
tr ',' '\n' | \
|
||||||
# Remove whitespaces resulting from the previous split
|
# Remove whitespaces resulting from the previous split
|
||||||
sed "s/^[ \t]*//" | \
|
sed "s/^[ \t]*//" | \
|
||||||
|
|
|
@ -163,7 +163,7 @@ public final class ServerPingWithAlarmManager extends Manager {
|
||||||
private static AlarmManager sAlarmManager;
|
private static AlarmManager sAlarmManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register a pending intent with the AlarmManager to be broadcasted every half hour and
|
* Register a pending intent with the AlarmManager to be broadcast every half hour and
|
||||||
* register the alarm broadcast receiver to receive this intent. The receiver will check all
|
* register the alarm broadcast receiver to receive this intent. The receiver will check all
|
||||||
* known questions if a ping is Necessary when invoked by the alarm intent.
|
* known questions if a ping is Necessary when invoked by the alarm intent.
|
||||||
*
|
*
|
||||||
|
|
|
@ -28,7 +28,7 @@ import android.util.Log;
|
||||||
* implementation, therefore {@link org.jivesoftware.smack.debugger.JulDebugger} is preferred.
|
* implementation, therefore {@link org.jivesoftware.smack.debugger.JulDebugger} is preferred.
|
||||||
* </p>
|
* </p>
|
||||||
* It is possible to not only print the raw sent and received stanzas but also the interpreted
|
* It is possible to not only print the raw sent and received stanzas but also the interpreted
|
||||||
* packets by Smack. By default interpreted packets won't be printed. To enable this feature
|
* packets by Smack. By default,interpreted packets won't be printed. To enable this feature
|
||||||
* just change the <code>printInterpreted</code> static variable to <code>true</code>.
|
* just change the <code>printInterpreted</code> static variable to <code>true</code>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -28,7 +28,7 @@ dependencies {
|
||||||
|
|
||||||
testFixturesApi "org.jxmpp:jxmpp-jid:$jxmppVersion:tests"
|
testFixturesApi "org.jxmpp:jxmpp-jid:$jxmppVersion:tests"
|
||||||
testFixturesApi "org.xmlunit:xmlunit-core:$xmlUnitVersion"
|
testFixturesApi "org.xmlunit:xmlunit-core:$xmlUnitVersion"
|
||||||
// Explictily add assertj-core which is a dependency of
|
// Explicitly add assertj-core which is a dependency of
|
||||||
// xmlunit-assertj, but gradle fails to resolves it with:
|
// xmlunit-assertj, but gradle fails to resolves it with:
|
||||||
// Execution failed for task ':smack-core:compileTestJava'.
|
// Execution failed for task ':smack-core:compileTestJava'.
|
||||||
// > Could not resolve all files for configuration ':smack-core:testCompileClasspath'.
|
// > Could not resolve all files for configuration ':smack-core:testCompileClasspath'.
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class MessageTest extends SmackTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
Message message = (Message) collector.nextResult(2500);
|
Message message = (Message) collector.nextResult(2500);
|
||||||
assertNotNull("Message not recieved from remote user", message);
|
assertNotNull("Message not received from remote user", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -487,7 +487,7 @@ 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
|
* 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
|
* default configuration by providing a file of the form <test case class name>.xml
|
||||||
* (e.g. RosterTest.xml).
|
* (e.g. RosterTest.xml).
|
||||||
|
|
|
@ -128,7 +128,7 @@ import org.jxmpp.stringprep.XmppStringprepException;
|
||||||
import org.jxmpp.util.XmppStringUtils;
|
import org.jxmpp.util.XmppStringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This abstract class is commonly used as super class for XMPP connection mechanisms like TCP and BOSH. Hence it
|
* This abstract class is commonly used as super class for XMPP connection mechanisms like TCP and BOSH. Hence, it
|
||||||
* provides the methods for connection state management, like {@link #connect()}, {@link #login()} and
|
* provides the methods for connection state management, like {@link #connect()}, {@link #login()} and
|
||||||
* {@link #disconnect()} (which are deliberately not provided by the {@link XMPPConnection} interface).
|
* {@link #disconnect()} (which are deliberately not provided by the {@link XMPPConnection} interface).
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -53,14 +53,14 @@ import java.util.concurrent.Executor;
|
||||||
public class AsyncButOrdered<K> {
|
public class AsyncButOrdered<K> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map with the currently pending runnables for a given key. Note that this is a weak hash map so we do not have
|
* A map with the currently pending runnables for a given key. Note that this is a weak hash map, so we do not have
|
||||||
* to take care of removing the keys ourselfs from the map.
|
* to take care of removing the keys ourselves from the map.
|
||||||
*/
|
*/
|
||||||
private final Map<K, Queue<Runnable>> pendingRunnables = new WeakHashMap<>();
|
private final Map<K, Queue<Runnable>> pendingRunnables = new WeakHashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A marker map if there is an active thread for the given key. Holds the responsible handler thread if one is
|
* A marker map if there is an active thread for the given key. Holds the responsible handler thread if one is
|
||||||
* active, otherwise the key is non-existend in the map.
|
* active, otherwise the key is non-existent in the map.
|
||||||
*/
|
*/
|
||||||
private final Map<K, Handler> threadActiveMap = new HashMap<>();
|
private final Map<K, Handler> threadActiveMap = new HashMap<>();
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ import org.minidns.util.InetAddressUtil;
|
||||||
/**
|
/**
|
||||||
* The connection configuration used for XMPP client-to-server connections. A well configured XMPP service will
|
* The connection configuration used for XMPP client-to-server connections. A well configured XMPP service will
|
||||||
* typically only require you to provide two parameters: The XMPP address, also known as the JID, of the user and the
|
* typically only require you to provide two parameters: The XMPP address, also known as the JID, of the user and the
|
||||||
* password. All other configuration parameters could ideally be determined automatically by Smack. Hence it is often
|
* password. All other configuration parameters could ideally be determined automatically by Smack. Hence, it is often
|
||||||
* enough to call {@link Builder#setXmppAddressAndPassword(CharSequence, String)}.
|
* enough to call {@link Builder#setXmppAddressAndPassword(CharSequence, String)}.
|
||||||
* <p>
|
* <p>
|
||||||
* Technically there are typically at least two parameters required: Some kind of credentials for authentication. And
|
* Technically there are typically at least two parameters required: Some kind of credentials for authentication. And
|
||||||
|
@ -248,7 +248,7 @@ public abstract class ConnectionConfiguration {
|
||||||
|
|
||||||
stanzaIdSourceFactory = builder.stanzaIdSourceFactory;
|
stanzaIdSourceFactory = builder.stanzaIdSourceFactory;
|
||||||
|
|
||||||
// If the enabledSaslmechanisms are set, then they must not be empty
|
// If the enabledSaslMechanisms are set, then they must not be empty
|
||||||
assert enabledSaslMechanisms == null || !enabledSaslMechanisms.isEmpty();
|
assert enabledSaslMechanisms == null || !enabledSaslMechanisms.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ public abstract class ConnectionConfiguration {
|
||||||
context = SSLContext.getInstance("TLS");
|
context = SSLContext.getInstance("TLS");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Remove the block below once we removed setKeystorePath(), setKeystoreType(), setCallbackHanlder() and
|
// TODO: Remove the block below once we removed setKeystorePath(), setKeystoreType(), setCallbackHandler() and
|
||||||
// setPKCS11Library() in the builder, and all related fields and the parameters of this function.
|
// setPKCS11Library() in the builder, and all related fields and the parameters of this function.
|
||||||
if (keyManagers == null) {
|
if (keyManagers == null) {
|
||||||
keyManagers = Builder.getKeyManagersFrom(keystoreType, keystorePath, callbackHandler, pkcs11Library);
|
keyManagers = Builder.getKeyManagersFrom(keystoreType, keystorePath, callbackHandler, pkcs11Library);
|
||||||
|
@ -583,7 +583,7 @@ public abstract class ConnectionConfiguration {
|
||||||
* Returns true if the connection is going to use stream compression. Stream compression
|
* Returns true if the connection is going to use stream compression. Stream compression
|
||||||
* will be requested after TLS was established (if TLS was enabled) and only if the server
|
* will be requested after TLS was established (if TLS was enabled) and only if the server
|
||||||
* offered stream compression. With stream compression network traffic can be reduced
|
* offered stream compression. With stream compression network traffic can be reduced
|
||||||
* up to 90%. By default compression is disabled.
|
* up to 90%. By default,compression is disabled.
|
||||||
*
|
*
|
||||||
* @return true if the connection is going to use stream compression.
|
* @return true if the connection is going to use stream compression.
|
||||||
*/
|
*/
|
||||||
|
@ -592,7 +592,7 @@ public abstract class ConnectionConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the given SASL mechansism is enabled in this connection configuration.
|
* Check if the given SASL mechanism is enabled in this connection configuration.
|
||||||
*
|
*
|
||||||
* @param saslMechanism TODO javadoc me please
|
* @param saslMechanism TODO javadoc me please
|
||||||
* @return true if the given SASL mechanism is enabled, false otherwise.
|
* @return true if the given SASL mechanism is enabled, false otherwise.
|
||||||
|
@ -607,7 +607,7 @@ public abstract class ConnectionConfiguration {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the explicitly enabled SASL mechanisms. May return <code>null</code> if no SASL mechanisms where
|
* Return the explicitly enabled SASL mechanisms. May return <code>null</code> if no SASL mechanisms where
|
||||||
* explicitly enabled, i.e. all SALS mechanisms supported and announced by the service will be considered.
|
* explicitly enabled, i.e. all SASL mechanisms supported and announced by the service will be considered.
|
||||||
*
|
*
|
||||||
* @return the enabled SASL mechanisms or <code>null</code>.
|
* @return the enabled SASL mechanisms or <code>null</code>.
|
||||||
*/
|
*/
|
||||||
|
@ -1090,8 +1090,7 @@ public abstract class ConnectionConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets if an initial available presence will be sent to the server. By default
|
* Sets if an initial available presence will be sent to the server. By default, * an available presence will be sent to the server indicating that this presence
|
||||||
* an available presence will be sent to the server indicating that this presence
|
|
||||||
* is not online and available to receive messages. If you want to log in without
|
* is not online and available to receive messages. If you want to log in without
|
||||||
* being 'noticed' then pass a <code>false</code> value.
|
* being 'noticed' then pass a <code>false</code> value.
|
||||||
*
|
*
|
||||||
|
@ -1266,7 +1265,7 @@ public abstract class ConnectionConfiguration {
|
||||||
* Sets if the connection is going to use compression (default false).
|
* Sets if the connection is going to use compression (default false).
|
||||||
*
|
*
|
||||||
* Compression is only activated if the server offers compression. With compression network
|
* Compression is only activated if the server offers compression. With compression network
|
||||||
* traffic can be reduced up to 90%. By default compression is disabled.
|
* traffic can be reduced up to 90%. By default,compression is disabled.
|
||||||
*
|
*
|
||||||
* @param compressionEnabled if the connection is going to use compression on the HTTP level.
|
* @param compressionEnabled if the connection is going to use compression on the HTTP level.
|
||||||
* @return a reference to this object.
|
* @return a reference to this object.
|
||||||
|
@ -1324,7 +1323,7 @@ public abstract class ConnectionConfiguration {
|
||||||
} else {
|
} else {
|
||||||
InputStream stream = TLSUtils.getDefaultTruststoreStreamIfPossible();
|
InputStream stream = TLSUtils.getDefaultTruststoreStreamIfPossible();
|
||||||
try {
|
try {
|
||||||
// Note that PKCS12 keystores need a password one some Java platforms. Hence we try the famous
|
// Note that PKCS12 keystores need a password one some Java platforms. Hence, we try the famous
|
||||||
// 'changeit' here. See https://bugs.openjdk.java.net/browse/JDK-8194702
|
// 'changeit' here. See https://bugs.openjdk.java.net/browse/JDK-8194702
|
||||||
char[] password = "changeit".toCharArray();
|
char[] password = "changeit".toCharArray();
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -53,7 +53,7 @@ import org.jxmpp.jid.EntityBareJid;
|
||||||
*
|
*
|
||||||
* <p>Once TLS has been negotiated (i.e. the connection has been secured) it is possible to
|
* <p>Once TLS has been negotiated (i.e. the connection has been secured) it is possible to
|
||||||
* register with the server or authenticate using SASL. If the
|
* register with the server or authenticate using SASL. If the
|
||||||
* server supports SASL then Smack will try to authenticate using SASL..</p>
|
* server supports SASL then Smack will try to authenticate using SASL.</p>
|
||||||
*
|
*
|
||||||
* <p>The server may support many SASL mechanisms to use for authenticating. Out of the box
|
* <p>The server may support many SASL mechanisms to use for authenticating. Out of the box
|
||||||
* Smack provides several SASL mechanisms, but it is possible to register new SASL Mechanisms. Use
|
* Smack provides several SASL mechanisms, but it is possible to register new SASL Mechanisms. Use
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class Smack {
|
||||||
public static final String SMACK_PACKAGE = SMACK_ORG + ".smack";
|
public static final String SMACK_PACKAGE = SMACK_ORG + ".smack";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Smack version information, eg "1.3.0".
|
* Returns the Smack version information, e.g."1.3.0".
|
||||||
*
|
*
|
||||||
* @return the Smack version information.
|
* @return the Smack version information.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -102,7 +102,7 @@ public final class SmackConfiguration {
|
||||||
private static HostnameVerifier defaultHostnameVerififer;
|
private static HostnameVerifier defaultHostnameVerififer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Smack version information, eg "1.3.0".
|
* Returns the Smack version information, e.g."1.3.0".
|
||||||
*
|
*
|
||||||
* @return the Smack version information.
|
* @return the Smack version information.
|
||||||
* @deprecated use {@link Smack#getVersion()} instead.
|
* @deprecated use {@link Smack#getVersion()} instead.
|
||||||
|
|
|
@ -96,7 +96,7 @@ import org.jxmpp.jid.EntityFullJid;
|
||||||
* <li>other - e.g., {@link #addStanzaListener(StanzaListener, StanzaFilter)}</li>
|
* <li>other - e.g., {@link #addStanzaListener(StanzaListener, StanzaFilter)}</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
* <p>
|
||||||
* Asynchronous callbacks are run decoupled from the connections main event loop. Hence a callback triggered by
|
* Asynchronous callbacks are run decoupled from the connections main event loop. Hence, a callback triggered by
|
||||||
* stanza B may (appear to) invoked before a callback triggered by stanza A, even though stanza A arrived before B.
|
* stanza B may (appear to) invoked before a callback triggered by stanza A, even though stanza A arrived before B.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -242,7 +242,7 @@ public interface XMPPConnection {
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param stanza the stanza to send.
|
* @param stanza the stanza to send.
|
||||||
* @return {@code true} if the stanza was successfully scheduled to be send, {@code false} otherwise.
|
* @return {@code true} if the stanza was successfully scheduled to be sent, {@code false} otherwise.
|
||||||
* @throws NotConnectedException if the connection is not connected.
|
* @throws NotConnectedException if the connection is not connected.
|
||||||
* @since 4.4.0
|
* @since 4.4.0
|
||||||
* @deprecated use {@link #sendStanzaNonBlocking(Stanza)} instead.
|
* @deprecated use {@link #sendStanzaNonBlocking(Stanza)} instead.
|
||||||
|
@ -265,7 +265,7 @@ public interface XMPPConnection {
|
||||||
* @param stanza the stanza to send.
|
* @param stanza the stanza to send.
|
||||||
* @param timeout how long to wait before giving up, in units of {@code unit}.
|
* @param timeout how long to wait before giving up, in units of {@code unit}.
|
||||||
* @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter.
|
* @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter.
|
||||||
* @return {@code true} if the stanza was successfully scheduled to be send, {@code false} otherwise.
|
* @return {@code true} if the stanza was successfully scheduled to be sent, {@code false} otherwise.
|
||||||
* @throws NotConnectedException if the connection is not connected.
|
* @throws NotConnectedException if the connection is not connected.
|
||||||
* @throws InterruptedException if the calling thread was interrupted.
|
* @throws InterruptedException if the calling thread was interrupted.
|
||||||
* @since 4.4.0
|
* @since 4.4.0
|
||||||
|
|
|
@ -57,8 +57,8 @@ public interface XmppInputOutputFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The returned {@link ByteBuffer} is going to get fliped by the caller. The callee must not flip the buffer.
|
* The returned {@link ByteBuffer} is going to get flipped by the caller. The callee must not flip the buffer.
|
||||||
* @param inputData the data this methods needs to process.
|
* @param inputData the data this method needs to process.
|
||||||
* @return a {@link ByteBuffer} or {@code null} if no data could be produced.
|
* @return a {@link ByteBuffer} or {@code null} if no data could be produced.
|
||||||
* @throws IOException in case an I/O exception occurs.
|
* @throws IOException in case an I/O exception occurs.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -390,7 +390,7 @@ public final class ModularXmppClientToServerConnection extends AbstractXMPPConne
|
||||||
|
|
||||||
// Ignore successorStateVertex if the only way to the final state is via the initial state. This happens
|
// Ignore successorStateVertex if the only way to the final state is via the initial state. This happens
|
||||||
// typically if we are in the ConnectedButUnauthenticated state on the way to ResourceboundAndAuthenticated,
|
// typically if we are in the ConnectedButUnauthenticated state on the way to ResourceboundAndAuthenticated,
|
||||||
// where we do not want to walk via InstantShutdown/Shtudown in a cycle over the initial state towards this
|
// where we do not want to walk via InstantShutdown/Shutdown in a cycle over the initial state towards this
|
||||||
// state.
|
// state.
|
||||||
if (walkStateGraphContext.wouldCauseCycle(successorStateVertex)) {
|
if (walkStateGraphContext.wouldCauseCycle(successorStateVertex)) {
|
||||||
// Ignore this successor.
|
// Ignore this successor.
|
||||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smack.datatypes;
|
||||||
import org.jivesoftware.smack.util.NumberUtil;
|
import org.jivesoftware.smack.util.NumberUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A number representing an unsigned 16-bit integer. Can be used for values with the XML schema type "xs:unsingedShort".
|
* A number representing an unsigned 16-bit integer. Can be used for values with the XML schema type "xs:unsignedShort".
|
||||||
*/
|
*/
|
||||||
public final class UInt16 extends Scalar implements Comparable<UInt16> {
|
public final class UInt16 extends Scalar implements Comparable<UInt16> {
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import org.jivesoftware.smack.util.ExceptionUtil;
|
||||||
* even block the thread since only one thread may print at a time.
|
* even block the thread since only one thread may print at a time.
|
||||||
* <p>
|
* <p>
|
||||||
* It is possible to not only print the raw sent and received stanzas but also the interpreted
|
* It is possible to not only print the raw sent and received stanzas but also the interpreted
|
||||||
* packets by Smack. By default interpreted packets won't be printed. To enable this feature
|
* packets by Smack. By default,interpreted packets won't be printed. To enable this feature
|
||||||
* just change the <code>printInterpreted</code> static variable to <code>true</code>.
|
* just change the <code>printInterpreted</code> static variable to <code>true</code>.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.jivesoftware.smack.XMPPConnection;
|
||||||
* even block the thread since only one thread may print at a time.
|
* even block the thread since only one thread may print at a time.
|
||||||
* <p>
|
* <p>
|
||||||
* It is possible to not only print the raw sent and received stanzas but also the interpreted
|
* It is possible to not only print the raw sent and received stanzas but also the interpreted
|
||||||
* packets by Smack. By default interpreted packets won't be printed. To enable this feature
|
* packets by Smack. By default,interpreted packets won't be printed. To enable this feature
|
||||||
* just change the <code>printInterpreted</code> static variable to <code>true</code>.
|
* just change the <code>printInterpreted</code> static variable to <code>true</code>.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
|
|
@ -57,7 +57,7 @@ public abstract class SmackDebugger {
|
||||||
*
|
*
|
||||||
* @param user the user@host/resource that has just logged in
|
* @param user the user@host/resource that has just logged in
|
||||||
*/
|
*/
|
||||||
// TODO: Should be replaced with a connection listener authenticed().
|
// TODO: Should be replaced with a connection listener authenticated().
|
||||||
public abstract void userHasLogged(EntityFullJid user);
|
public abstract void userHasLogged(EntityFullJid user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* <li>{@link StanzaIdFilter}: filters for stanzas with a particular stanza ID</li>
|
* <li>{@link StanzaIdFilter}: filters for stanzas with a particular stanza ID</li>
|
||||||
* <li>{@link ToMatchesFilter}: filters for stanzas that are sent to a particular address</li>
|
* <li>{@link ToMatchesFilter}: filters for stanzas that are sent to a particular address</li>
|
||||||
* <li>{@link FromMatchesFilter}: filters for stanzas that are sent from a particular address</li>
|
* <li>{@link FromMatchesFilter}: filters for stanzas that are sent from a particular address</li>
|
||||||
* <li>{@link ExtensionElementFilter}: filters for stanzas that have a particular stanza exentsion element</li>
|
* <li>{@link ExtensionElementFilter}: filters for stanzas that have a particular stanza extension element</li>
|
||||||
* <li>{@link AndFilter}: implements the logical AND operation over two or more filters</li>
|
* <li>{@link AndFilter}: implements the logical AND operation over two or more filters</li>
|
||||||
* <li>{@link OrFilter}: implements the logical OR operation over two or more filters</li>
|
* <li>{@link OrFilter}: implements the logical OR operation over two or more filters</li>
|
||||||
* <li>{@link NotFilter}: implements the logical NOT operation on a filter</li>
|
* <li>{@link NotFilter}: implements the logical NOT operation on a filter</li>
|
||||||
|
|
|
@ -118,7 +118,7 @@ public abstract class StateDescriptor {
|
||||||
if (stateClassConstructor != null) {
|
if (stateClassConstructor != null) {
|
||||||
stateClassConstructor.setAccessible(true);
|
stateClassConstructor.setAccessible(true);
|
||||||
} else {
|
} else {
|
||||||
// TODO: Add validation check that if stateClassConstructor is 'null' the cosntructState() method is overriden.
|
// TODO: Add validation check that if stateClassConstructor is 'null' the constructState() method is overridden.
|
||||||
}
|
}
|
||||||
|
|
||||||
String className = getClass().getSimpleName();
|
String className = getClass().getSimpleName();
|
||||||
|
@ -155,7 +155,7 @@ public abstract class StateDescriptor {
|
||||||
clazz = Class.forName(clazzName);
|
clazz = Class.forName(clazzName);
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
// The state descriptor class is not in classpath, which probably means that the smack module is not loaded
|
// The state descriptor class is not in classpath, which probably means that the smack module is not loaded
|
||||||
// into the classpath. Hence we can silently ignore that.
|
// into the classpath. Hence, we can silently ignore that.
|
||||||
LOGGER.log(Level.FINEST, "Ignoring unknown state descriptor '" + clazzName + "'", e);
|
LOGGER.log(Level.FINEST, "Ignoring unknown state descriptor '" + clazzName + "'", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,7 +215,7 @@ public class StateDescriptorGraph {
|
||||||
inferredForwardEdges.put(predecessor, backwardsEdge);
|
inferredForwardEdges.put(predecessor, backwardsEdge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Ensure that the intial node has their successors inferred.
|
// Ensure that the initial node has their successors inferred.
|
||||||
for (Class<? extends StateDescriptor> inferredSuccessorOfInitialStateDescriptor : inferredForwardEdges.getAll(initialStatedescriptorClass)) {
|
for (Class<? extends StateDescriptor> inferredSuccessorOfInitialStateDescriptor : inferredForwardEdges.getAll(initialStatedescriptorClass)) {
|
||||||
initialNode.getElement().addSuccessor(inferredSuccessorOfInitialStateDescriptor);
|
initialNode.getElement().addSuccessor(inferredSuccessorOfInitialStateDescriptor);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smack.packet;
|
||||||
/**
|
/**
|
||||||
* Interface to represent XMPP extension elements. Unlike {@link XmlElement}, every non-abstract class that implements
|
* Interface to represent XMPP extension elements. Unlike {@link XmlElement}, every non-abstract class that implements
|
||||||
* {@link ExtensionElement} must have a static final QNAME member of the type {@link javax.xml.namespace.QName}. This
|
* {@link ExtensionElement} must have a static final QNAME member of the type {@link javax.xml.namespace.QName}. This
|
||||||
* allows type-safe functions like {@link StanzaView#getExtension(Class)}. Hence this is a marker interface.
|
* allows type-safe functions like {@link StanzaView#getExtension(Class)}. Hence, this is a marker interface.
|
||||||
* <p>
|
* <p>
|
||||||
* Use this class when implementing new extension elements when possible. This means that every instance of your
|
* Use this class when implementing new extension elements when possible. This means that every instance of your
|
||||||
* implemented class must represent an XML element of the same qualified name.
|
* implemented class must represent an XML element of the same qualified name.
|
||||||
|
|
|
@ -95,7 +95,7 @@ public abstract class IQ extends Stanza implements IqView {
|
||||||
/**
|
/**
|
||||||
* Sets the type of the IQ packet.
|
* Sets the type of the IQ packet.
|
||||||
* <p>
|
* <p>
|
||||||
* Since the type of an IQ must present, an IllegalArgmentException will be thrown when type is
|
* Since the type of an IQ must present, an IllegalArgumentException will be thrown when type is
|
||||||
* <code>null</code>.
|
* <code>null</code>.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
@ -182,7 +182,7 @@ public abstract class IQ extends Stanza implements IqView {
|
||||||
// Add the query section if there is one.
|
// Add the query section if there is one.
|
||||||
IQChildElementXmlStringBuilder iqChildElement = getIQChildElementBuilder(
|
IQChildElementXmlStringBuilder iqChildElement = getIQChildElementBuilder(
|
||||||
new IQChildElementXmlStringBuilder(getChildElementName(), getChildElementNamespace(), null, xml.getXmlEnvironment()));
|
new IQChildElementXmlStringBuilder(getChildElementName(), getChildElementNamespace(), null, xml.getXmlEnvironment()));
|
||||||
// TOOD: Document the cases where iqChildElement is null but childElementName not. And if there are none, change
|
// TODO: Document the cases where iqChildElement is null but childElementName not. And if there are none, change
|
||||||
// the logic.
|
// the logic.
|
||||||
if (iqChildElement == null) {
|
if (iqChildElement == null) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
package org.jivesoftware.smack.packet;
|
package org.jivesoftware.smack.packet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Nonza, i.e everything that is <b>not a stanza</b> as defined
|
* A Nonza, i.e. everything that is <b>not a stanza</b> as defined
|
||||||
* RFC 6120 8. Stanzas are {@link Message}, {@link Presence} and {@link IQ}.
|
* RFC 6120 8. Stanzas are {@link Message}, {@link Presence} and {@link IQ}.
|
||||||
* Everything else should sublcass this class instead of {@link Stanza}.
|
* Everything else should sublcass this class instead of {@link Stanza}.
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -98,7 +98,7 @@ public abstract class Stanza implements StanzaView, TopLevelStreamElement {
|
||||||
protected Stanza(StanzaBuilder<?> stanzaBuilder) {
|
protected Stanza(StanzaBuilder<?> stanzaBuilder) {
|
||||||
if (stanzaBuilder.stanzaIdSource != null) {
|
if (stanzaBuilder.stanzaIdSource != null) {
|
||||||
id = stanzaBuilder.stanzaIdSource.getNewStanzaId();
|
id = stanzaBuilder.stanzaIdSource.getNewStanzaId();
|
||||||
// Note that some stanza ID sources, e.g. StanzaBuilder.PresenceBuilder.EMPTY return null here. Hence we
|
// Note that some stanza ID sources, e.g. StanzaBuilder.PresenceBuilder.EMPTY return null here. Hence, we
|
||||||
// only check that the returned string is not empty.
|
// only check that the returned string is not empty.
|
||||||
assert StringUtils.isNullOrNotEmpty(id);
|
assert StringUtils.isNullOrNotEmpty(id);
|
||||||
usedStanzaIdSource = stanzaBuilder.stanzaIdSource;
|
usedStanzaIdSource = stanzaBuilder.stanzaIdSource;
|
||||||
|
|
|
@ -87,9 +87,9 @@ public abstract class StanzaBuilder<B extends StanzaBuilder<B>> implements Stanz
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the recipent address of the stanza.
|
* Set the recipient address of the stanza.
|
||||||
*
|
*
|
||||||
* @param to whoe the stanza is being sent to.
|
* @param to whom the stanza is being sent.
|
||||||
* @return a reference to this builder.
|
* @return a reference to this builder.
|
||||||
* @throws XmppStringprepException if the provided character sequence is not a valid XMPP address.
|
* @throws XmppStringprepException if the provided character sequence is not a valid XMPP address.
|
||||||
* @see #to(Jid)
|
* @see #to(Jid)
|
||||||
|
|
|
@ -58,9 +58,9 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||||
* stream has been authenticated </td></tr>
|
* stream has been authenticated </td></tr>
|
||||||
* <tr><td> policy-violation </td><td> the entity has violated some local service
|
* <tr><td> policy-violation </td><td> the entity has violated some local service
|
||||||
* policy. </td></tr>
|
* policy. </td></tr>
|
||||||
* <tr><td> remote-connection-failed </td><td> Rthe server is unable to properly connect
|
* <tr><td> remote-connection-failed </td><td> the server is unable to properly connect
|
||||||
* to a remote entity. </td></tr>
|
* to a remote entity. </td></tr>
|
||||||
* <tr><td> resource-constraint </td><td> Rthe server lacks the system resources necessary
|
* <tr><td> resource-constraint </td><td> the server lacks the system resources necessary
|
||||||
* to service the stream. </td></tr>
|
* to service the stream. </td></tr>
|
||||||
* <tr><td> restricted-xml </td><td> the entity has attempted to send restricted XML
|
* <tr><td> restricted-xml </td><td> the entity has attempted to send restricted XML
|
||||||
* features. </td></tr>
|
* features. </td></tr>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Smack provider architecture is a system for plugging in custom XML parsing of staza extensions
|
* The Smack provider architecture is a system for plugging in custom XML parsing of stanza extensions
|
||||||
* ({@link org.jivesoftware.smack.packet.ExtensionElement}, {@link org.jivesoftware.smack.packet.IQ} stanzas and
|
* ({@link org.jivesoftware.smack.packet.ExtensionElement}, {@link org.jivesoftware.smack.packet.IQ} stanzas and
|
||||||
* {@link org.jivesoftware.smack.packet.Nonza}. Hence, there are the the following providers:
|
* {@link org.jivesoftware.smack.packet.Nonza}. Hence, there are the the following providers:
|
||||||
* <ul>
|
* <ul>
|
||||||
|
|
|
@ -358,7 +358,7 @@ public abstract class SASLMechanism implements Comparable<SASLMechanism> {
|
||||||
* SASLprep the given String. The resulting String is in UTF-8.
|
* SASLprep the given String. The resulting String is in UTF-8.
|
||||||
*
|
*
|
||||||
* @param string the String to sasl prep.
|
* @param string the String to sasl prep.
|
||||||
* @return the given String SASL preped
|
* @return the given String SASL prepped
|
||||||
* @see <a href="http://tools.ietf.org/html/rfc4013">RFC 4013 - SASLprep: Stringprep Profile for User Names and Passwords</a>
|
* @see <a href="http://tools.ietf.org/html/rfc4013">RFC 4013 - SASLprep: Stringprep Profile for User Names and Passwords</a>
|
||||||
*/
|
*/
|
||||||
protected static String saslPrep(String string) {
|
protected static String saslPrep(String string) {
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class MAC {
|
||||||
HMAC_SHA1 = Mac.getInstance(HMACSHA1);
|
HMAC_SHA1 = Mac.getInstance(HMACSHA1);
|
||||||
}
|
}
|
||||||
catch (NoSuchAlgorithmException e) {
|
catch (NoSuchAlgorithmException e) {
|
||||||
// Smack wont be able to function normally if this exception is thrown, wrap it into
|
// Smack won't be able to function normally if this exception is thrown, wrap it into
|
||||||
// an ISE and make the user aware of the problem.
|
// an ISE and make the user aware of the problem.
|
||||||
throw new IllegalStateException(e);
|
throw new IllegalStateException(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class MD5 {
|
||||||
MD5_DIGEST = MessageDigest.getInstance(StringUtils.MD5);
|
MD5_DIGEST = MessageDigest.getInstance(StringUtils.MD5);
|
||||||
}
|
}
|
||||||
catch (NoSuchAlgorithmException e) {
|
catch (NoSuchAlgorithmException e) {
|
||||||
// Smack wont be able to function normally if this exception is thrown, wrap it into
|
// Smack won't be able to function normally if this exception is thrown, wrap it into
|
||||||
// an ISE and make the user aware of the problem.
|
// an ISE and make the user aware of the problem.
|
||||||
throw new IllegalStateException(e);
|
throw new IllegalStateException(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,7 +230,7 @@ public class PacketParserUtils {
|
||||||
// Assume this is the end tag of the start tag at the
|
// Assume this is the end tag of the start tag at the
|
||||||
// beginning of this method. Typical examples where this
|
// beginning of this method. Typical examples where this
|
||||||
// happens are body elements containing the empty string,
|
// happens are body elements containing the empty string,
|
||||||
// ie. <body></body>, which appears to be valid XMPP, or a
|
// i.e. <body></body>, which appears to be valid XMPP, or a
|
||||||
// least it's not explicitly forbidden by RFC 6121 5.2.3
|
// least it's not explicitly forbidden by RFC 6121 5.2.3
|
||||||
return "";
|
return "";
|
||||||
} else {
|
} else {
|
||||||
|
@ -850,7 +850,7 @@ public class PacketParserUtils {
|
||||||
throws XmlPullParserException, IOException {
|
throws XmlPullParserException, IOException {
|
||||||
ParserUtils.assertAtStartTag(parser);
|
ParserUtils.assertAtStartTag(parser);
|
||||||
assert parser.getNamespace().equals(StartTls.NAMESPACE);
|
assert parser.getNamespace().equals(StartTls.NAMESPACE);
|
||||||
int initalDepth = parser.getDepth();
|
int initialDepth = parser.getDepth();
|
||||||
boolean required = false;
|
boolean required = false;
|
||||||
outerloop: while (true) {
|
outerloop: while (true) {
|
||||||
XmlPullParser.Event event = parser.next();
|
XmlPullParser.Event event = parser.next();
|
||||||
|
@ -864,7 +864,7 @@ public class PacketParserUtils {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case END_ELEMENT:
|
case END_ELEMENT:
|
||||||
if (parser.getDepth() == initalDepth) {
|
if (parser.getDepth() == initialDepth) {
|
||||||
break outerloop;
|
break outerloop;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -146,7 +146,7 @@ public class ParserUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prase a string to a boolean value as per "xs:boolean". Valid input strings are "true", "1" for true, and "false", "0" for false.
|
* Phrase a string to a boolean value as per "xs:boolean". Valid input strings are "true", "1" for true, and "false", "0" for false.
|
||||||
*
|
*
|
||||||
* @param booleanString the input string.
|
* @param booleanString the input string.
|
||||||
* @return the boolean representation of the input string
|
* @return the boolean representation of the input string
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class SHA1 {
|
||||||
SHA1_DIGEST = MessageDigest.getInstance(StringUtils.SHA1);
|
SHA1_DIGEST = MessageDigest.getInstance(StringUtils.SHA1);
|
||||||
}
|
}
|
||||||
catch (NoSuchAlgorithmException e) {
|
catch (NoSuchAlgorithmException e) {
|
||||||
// Smack wont be able to function normally if this exception is thrown, wrap it into
|
// Smack won't be able to function normally if this exception is thrown, wrap it into
|
||||||
// an ISE and make the user aware of the problem.
|
// an ISE and make the user aware of the problem.
|
||||||
throw new IllegalStateException(e);
|
throw new IllegalStateException(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -343,7 +343,7 @@ public class StringUtils {
|
||||||
try {
|
try {
|
||||||
randomString(charBuffer, random, alphabet, numRandomChars);
|
randomString(charBuffer, random, alphabet, numRandomChars);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// This should never happen if we calcuate the buffer size correctly.
|
// This should never happen if we calculate the buffer size correctly.
|
||||||
throw new AssertionError(e);
|
throw new AssertionError(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,8 @@
|
||||||
* </p>
|
* </p>
|
||||||
* <h2>Best Practices</h2>
|
* <h2>Best Practices</h2>
|
||||||
* <p>
|
* <p>
|
||||||
* We recommend that applications using Smack's DNSSEC API do not ask the user if DNSSEC is avaialble. Instead they
|
* We recommend that applications using Smack's DNSSEC API do not ask the user if DNSSEC is available. Instead they
|
||||||
* should check for DNSSEC suport on every connection attempt. Once DNSSEC support has been discovered, the application
|
* should check for DNSSEC support on every connection attempt. Once DNSSEC support has been discovered, the application
|
||||||
* should use the `needsDnssec` mode for all future connection attempts. The same scheme can be applied when using DANE.
|
* should use the `needsDnssec` mode for all future connection attempts. The same scheme can be applied when using DANE.
|
||||||
* This approach is similar to the scheme established by to <a href="https://tools.ietf.org/html/rfc6797">HTTP Strict
|
* This approach is similar to the scheme established by to <a href="https://tools.ietf.org/html/rfc6797">HTTP Strict
|
||||||
* Transport Security" (HSTS, RFC 6797</a>.
|
* Transport Security" (HSTS, RFC 6797</a>.
|
||||||
|
|
|
@ -39,9 +39,9 @@ import org.jxmpp.stringprep.XmppStringprepException;
|
||||||
* A dummy implementation of {@link XMPPConnection}, intended to be used during
|
* A dummy implementation of {@link XMPPConnection}, intended to be used during
|
||||||
* unit tests.
|
* unit tests.
|
||||||
*
|
*
|
||||||
* Instances store any packets that are delivered to be send using the
|
* Instances store any packets that are delivered to be sent using the
|
||||||
* {@link #sendStanza(Stanza)} method in a blocking queue. The content of this queue
|
* {@link #sendStanza(Stanza)} method in a blocking queue. The content of this queue
|
||||||
* can be inspected using {@link #getSentPacket()}. Typically these queues are
|
* can be inspected using {@link #getSentPacket()}. Typically, these queues are
|
||||||
* used to retrieve a message that was generated by the client.
|
* used to retrieve a message that was generated by the client.
|
||||||
*
|
*
|
||||||
* Packets that should be processed by the client to simulate a received stanza
|
* Packets that should be processed by the client to simulate a received stanza
|
||||||
|
|
|
@ -41,7 +41,7 @@ import org.jxmpp.stringprep.XmppStringprepException;
|
||||||
* Note that this test is based on the assumption that it is possible to trigger a full garbage collection run, which is
|
* Note that this test is based on the assumption that it is possible to trigger a full garbage collection run, which is
|
||||||
* not the case. See also this
|
* not the case. See also this
|
||||||
* <a href="https://stackoverflow.com/questions/1481178/how-to-force-garbage-collection-in-java">stackoverflow
|
* <a href="https://stackoverflow.com/questions/1481178/how-to-force-garbage-collection-in-java">stackoverflow
|
||||||
* question</a>. Hence the {@link #triggerGarbageCollection()} method defined in this class is not portable and depends
|
* question</a>. Hence, the {@link #triggerGarbageCollection()} method defined in this class is not portable and depends
|
||||||
* on implementation depended Java Virtual Machine behavior.
|
* on implementation depended Java Virtual Machine behavior.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
|
|
@ -47,7 +47,7 @@ import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||||
import org.jivesoftware.smackx.hashes.element.HashElement;
|
import org.jivesoftware.smackx.hashes.element.HashElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manager that can be used to determine support for hash functions. By default the Manager announces support for
|
* Manager that can be used to determine support for hash functions. By default,the Manager announces support for
|
||||||
* XEP-0300, as well as for the recommended set of hash algorithms. Those contain SHA256, SHA384, SHA512, SHA3-256,
|
* XEP-0300, as well as for the recommended set of hash algorithms. Those contain SHA256, SHA384, SHA512, SHA3-256,
|
||||||
* SHA3-384, SHA3-512, BLAKE2B256, BLAKE2B384 and BLAKE2B512. Those algorithms got recommended here:
|
* SHA3-384, SHA3-512, BLAKE2B256, BLAKE2B384 and BLAKE2B512. Those algorithms got recommended here:
|
||||||
* <a href="https://xmpp.org/extensions/xep-0300.html#recommendations">https://xmpp.org/extensions/xep-0300.html#recommendations</a>.
|
* <a href="https://xmpp.org/extensions/xep-0300.html#recommendations">https://xmpp.org/extensions/xep-0300.html#recommendations</a>.
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
* AbstractHttpOverXmpp.Data data = new AbstractHttpOverXmpp.Data(child);
|
* AbstractHttpOverXmpp.Data data = new AbstractHttpOverXmpp.Data(child);
|
||||||
*
|
*
|
||||||
* // create request
|
* // create request
|
||||||
* HttpOverXmppReq req = HttpOverXmppReq.buider()
|
* HttpOverXmppReq req = HttpOverXmppReq.builder()
|
||||||
* .setMethod(HttpMethod.POST)
|
* .setMethod(HttpMethod.POST)
|
||||||
* .setResource("/mailbox")
|
* .setResource("/mailbox")
|
||||||
* .setHeaders(headers)
|
* .setHeaders(headers)
|
||||||
|
|
|
@ -146,7 +146,7 @@
|
||||||
* <pre>
|
* <pre>
|
||||||
* <code>
|
* <code>
|
||||||
* IoTDiscoveryManager iotDiscoveryManager = IoTDiscoveryManager.getInstanceFor(connection);
|
* IoTDiscoveryManager iotDiscoveryManager = IoTDiscoveryManager.getInstanceFor(connection);
|
||||||
* iotDiscovyerManager.registerThing(thing);
|
* iotDiscoveryManager.registerThing(thing);
|
||||||
* </code>
|
* </code>
|
||||||
* </pre>
|
* </pre>
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -162,7 +162,7 @@
|
||||||
* Things can usually only be used by other things if they are friends. Since a
|
* Things can usually only be used by other things if they are friends. Since a
|
||||||
* thing normally can't decide on its own if an incoming friendship request
|
* thing normally can't decide on its own if an incoming friendship request
|
||||||
* should be granted or not, we can delegate this decision to a provisioning
|
* should be granted or not, we can delegate this decision to a provisioning
|
||||||
* service. Smack provides the `IoTProvisinoManager` to deal with friendship and
|
* service. Smack provides the `IoTProvisionManager` to deal with friendship and
|
||||||
* provisioning.
|
* provisioning.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
* <h2>Usage</h2>
|
* <h2>Usage</h2>
|
||||||
* <p>
|
* <p>
|
||||||
* The most important class is the {@link org.jivesoftware.smackx.message_markup.element.MarkupElement} class, which
|
* The most important class is the {@link org.jivesoftware.smackx.message_markup.element.MarkupElement} class, which
|
||||||
* contains a Builder to construct message markup..
|
* contains a Builder to construct message markup.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* To start creating a Message Markup Extension, call
|
* To start creating a Message Markup Extension, call
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* <code>
|
* <code>
|
||||||
* Message message = new Message("Alice is a realy nice person.");
|
* Message message = new Message("Alice is a really nice person.");
|
||||||
* BareJid alice = JidCreate.bareFrom("alice@capulet.lit");
|
* BareJid alice = JidCreate.bareFrom("alice@capulet.lit");
|
||||||
* ReferenceManager.addMention(message, 0, 5, alice);
|
* ReferenceManager.addMention(message, 0, 5, alice);
|
||||||
* </code>
|
* </code>
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class ExplicitMessageEncryptionElementTest extends SmackTestSuite {
|
||||||
public void addToMessageTest() {
|
public void addToMessageTest() {
|
||||||
Message message = StanzaBuilder.buildMessage().build();
|
Message message = StanzaBuilder.buildMessage().build();
|
||||||
|
|
||||||
// Check inital state (no elements)
|
// Check initial state (no elements)
|
||||||
assertNull(ExplicitMessageEncryptionElement.from(message));
|
assertNull(ExplicitMessageEncryptionElement.from(message));
|
||||||
assertFalse(ExplicitMessageEncryptionElement.hasProtocol(message,
|
assertFalse(ExplicitMessageEncryptionElement.hasProtocol(message,
|
||||||
ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol.omemoVAxolotl));
|
ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol.omemoVAxolotl));
|
||||||
|
@ -75,7 +75,7 @@ public class ExplicitMessageEncryptionElementTest extends SmackTestSuite {
|
||||||
assertTrue(ExplicitMessageEncryptionElement.hasProtocol(message,
|
assertTrue(ExplicitMessageEncryptionElement.hasProtocol(message,
|
||||||
ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol.omemoVAxolotl));
|
ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol.omemoVAxolotl));
|
||||||
|
|
||||||
// Check, if adding additional OMEMO wont add another element
|
// Check, if adding additional OMEMO won't add another element
|
||||||
ExplicitMessageEncryptionElement.set(messageBuilder,
|
ExplicitMessageEncryptionElement.set(messageBuilder,
|
||||||
ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol.omemoVAxolotl);
|
ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol.omemoVAxolotl);
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class FileTransferTest extends SmackTestCase {
|
||||||
fail();
|
fail();
|
||||||
}
|
}
|
||||||
byte [] array = queue.take();
|
byte [] array = queue.take();
|
||||||
assertEquals("Recieved file not equal to sent file.", testTransfer, array);
|
assertEquals("Received file not equal to sent file.", testTransfer, array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class OfflineMessageManagerTest extends SmackTestCase {
|
||||||
/**
|
/**
|
||||||
* While user2 is connected but unavailable, user1 sends 2 messages to user1. User2 then
|
* While user2 is connected but unavailable, user1 sends 2 messages to user1. User2 then
|
||||||
* performs some "Flexible Offline Message Retrieval" checking the number of offline messages,
|
* performs some "Flexible Offline Message Retrieval" checking the number of offline messages,
|
||||||
* retriving the headers, then the real messages of the headers and finally removing the
|
* retrieving the headers, then the real messages of the headers and finally removing the
|
||||||
* loaded messages.
|
* loaded messages.
|
||||||
*/
|
*/
|
||||||
public void testReadAndDelete() {
|
public void testReadAndDelete() {
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class ServiceDiscoveryManagerTest extends SmackTestCase {
|
||||||
*/
|
*/
|
||||||
public void testXHTMLFeature() {
|
public void testXHTMLFeature() {
|
||||||
// Check for local XHTML service support
|
// Check for local XHTML service support
|
||||||
// By default the XHTML service support is enabled in all the connections
|
// By default,the XHTML service support is enabled in all the connections
|
||||||
assertTrue(XHTMLManager.isServiceEnabled(getConnection(0)));
|
assertTrue(XHTMLManager.isServiceEnabled(getConnection(0)));
|
||||||
assertTrue(XHTMLManager.isServiceEnabled(getConnection(1)));
|
assertTrue(XHTMLManager.isServiceEnabled(getConnection(1)));
|
||||||
// Check for XHTML support in connection1 from connection2
|
// Check for XHTML support in connection1 from connection2
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class MultipleAddresses implements ExtensionElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of addresses that matches the specified type. Examples of address
|
* Returns the list of addresses that matches the specified type. Examples of address
|
||||||
* type are: TO, CC, BCC, etc..
|
* type are: TO, CC, BCC, etc.
|
||||||
*
|
*
|
||||||
* @param type Examples of address type are: TO, CC, BCC, etc.
|
* @param type Examples of address type are: TO, CC, BCC, etc.
|
||||||
* @return the list of addresses that matches the specified type.
|
* @return the list of addresses that matches the specified type.
|
||||||
|
|
|
@ -44,13 +44,13 @@ import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||||
import org.jxmpp.jid.Jid;
|
import org.jxmpp.jid.Jid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Block communications with contancts and other entities using XEP-0191.
|
* Block communications with contacts and other entities using XEP-0191.
|
||||||
* Allows to
|
* Allows to
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>Check push notifications support</li>
|
* <li>Check push notifications support</li>
|
||||||
* <li>Get blocking list</li>
|
* <li>Get blocking list</li>
|
||||||
* <li>Block contact</li>
|
* <li>Block contact</li>
|
||||||
* <li>Unblock conact</li>
|
* <li>Unblock contact</li>
|
||||||
* <li>Unblock all</li>
|
* <li>Unblock all</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
|
|
|
@ -103,7 +103,7 @@ public final class BookmarkManager {
|
||||||
*
|
*
|
||||||
* @param name the name of the conference
|
* @param name the name of the conference
|
||||||
* @param jid the jid of the conference
|
* @param jid the jid of the conference
|
||||||
* @param isAutoJoin whether or not to join this conference automatically on login
|
* @param isAutoJoin whether to join this conference automatically on login
|
||||||
* @param nickname the nickname to use for the user when joining the conference
|
* @param nickname the nickname to use for the user when joining the conference
|
||||||
* @param password the password to use for the user when joining the conference
|
* @param password the password to use for the user when joining the conference
|
||||||
* @throws XMPPErrorException thrown when there is an issue retrieving the current bookmarks from
|
* @throws XMPPErrorException thrown when there is an issue retrieving the current bookmarks from
|
||||||
|
@ -166,7 +166,7 @@ public final class BookmarkManager {
|
||||||
* Returns an unmodifiable collection of all bookmarked urls.
|
* Returns an unmodifiable collection of all bookmarked urls.
|
||||||
*
|
*
|
||||||
* @return returns an unmodifiable collection of all bookmarked urls.
|
* @return returns an unmodifiable collection of all bookmarked urls.
|
||||||
* @throws XMPPErrorException thrown when there is a problem retriving bookmarks from the server.
|
* @throws XMPPErrorException thrown when there is a problem retrieving bookmarks from the server.
|
||||||
* @throws NoResponseException if there was no response from the server.
|
* @throws NoResponseException if there was no response from the server.
|
||||||
* @throws NotConnectedException if the XMPP connection is not connected.
|
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||||
* @throws InterruptedException if the calling thread was interrupted.
|
* @throws InterruptedException if the calling thread was interrupted.
|
||||||
|
@ -181,8 +181,8 @@ public final class BookmarkManager {
|
||||||
*
|
*
|
||||||
* @param URL the url of the bookmark
|
* @param URL the url of the bookmark
|
||||||
* @param name the name of the bookmark
|
* @param name the name of the bookmark
|
||||||
* @param isRSS whether or not the url is an rss feed
|
* @param isRSS whether the url is an RSS feed
|
||||||
* @throws XMPPErrorException thrown when there is an error retriving or saving bookmarks from or to
|
* @throws XMPPErrorException thrown when there is an error retrieving or saving bookmarks from or to
|
||||||
* the server
|
* the server
|
||||||
* @throws NoResponseException if there was no response from the server.
|
* @throws NoResponseException if there was no response from the server.
|
||||||
* @throws NotConnectedException if the XMPP connection is not connected.
|
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||||
|
@ -210,7 +210,7 @@ public final class BookmarkManager {
|
||||||
* Removes a url from the bookmarks.
|
* Removes a url from the bookmarks.
|
||||||
*
|
*
|
||||||
* @param bookmarkURL the url of the bookmark to remove
|
* @param bookmarkURL the url of the bookmark to remove
|
||||||
* @throws XMPPErrorException thrown if there is an error retriving or saving bookmarks from or to
|
* @throws XMPPErrorException thrown if there is an error retrieving or saving bookmarks from or to
|
||||||
* the server.
|
* the server.
|
||||||
* @throws NoResponseException if there was no response from the server.
|
* @throws NoResponseException if there was no response from the server.
|
||||||
* @throws NotConnectedException if the XMPP connection is not connected.
|
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||||
|
|
|
@ -511,7 +511,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of session IDs that should be ignored by the InitialtionListener
|
* Returns the list of session IDs that should be ignored by the InitiationListener
|
||||||
*
|
*
|
||||||
* @return list of session IDs
|
* @return list of session IDs
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -139,7 +139,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
||||||
/* timeout for connecting to the SOCKS5 proxy selected by the target */
|
/* timeout for connecting to the SOCKS5 proxy selected by the target */
|
||||||
private int proxyConnectionTimeout = 10000;
|
private int proxyConnectionTimeout = 10000;
|
||||||
|
|
||||||
/* blacklist of errornous SOCKS5 proxies */
|
/* blacklist of erroneous SOCKS5 proxies */
|
||||||
private final Set<Jid> proxyBlacklist = Collections.synchronizedSet(new HashSet<Jid>());
|
private final Set<Jid> proxyBlacklist = Collections.synchronizedSet(new HashSet<Jid>());
|
||||||
|
|
||||||
/* remember the last proxy that worked to prioritize it */
|
/* remember the last proxy that worked to prioritize it */
|
||||||
|
@ -390,7 +390,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set whether or not the bytestream manager will annouce the local stream host(s), i.e. the local SOCKS5 proxy.
|
* Set whether the bytestream manager will announce the local stream host(s), i.e. the local SOCKS5 proxy.
|
||||||
*
|
*
|
||||||
* @param announceLocalStreamHost TODO javadoc me please
|
* @param announceLocalStreamHost TODO javadoc me please
|
||||||
* @see #isAnnouncingLocalStreamHostEnabled()
|
* @see #isAnnouncingLocalStreamHostEnabled()
|
||||||
|
@ -580,7 +580,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
||||||
proxyInfo = serviceDiscoveryManager.discoverInfo(item.getEntityID());
|
proxyInfo = serviceDiscoveryManager.discoverInfo(item.getEntityID());
|
||||||
}
|
}
|
||||||
catch (NoResponseException | XMPPErrorException e) {
|
catch (NoResponseException | XMPPErrorException e) {
|
||||||
// blacklist errornous server
|
// blacklist erroneous server
|
||||||
proxyBlacklist.add(item.getEntityID());
|
proxyBlacklist.add(item.getEntityID());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -627,7 +627,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
||||||
streamHosts.addAll(response.getStreamHosts());
|
streamHosts.addAll(response.getStreamHosts());
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
// blacklist errornous proxies
|
// blacklist erroneous proxies
|
||||||
this.proxyBlacklist.add(proxy);
|
this.proxyBlacklist.add(proxy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -796,7 +796,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of session IDs that should be ignored by the InitialtionListener
|
* Returns the list of session IDs that should be ignored by the InitiationListener
|
||||||
*
|
*
|
||||||
* @return list of session IDs
|
* @return list of session IDs
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class Socks5Client {
|
||||||
byte[] connectionRequest;
|
byte[] connectionRequest;
|
||||||
byte[] connectionResponse;
|
byte[] connectionResponse;
|
||||||
/*
|
/*
|
||||||
* use DataInputStream/DataOutpuStream to assure read and write is completed in a single
|
* use DataInputStream/DataOutputStream to assure read and write is completed in a single
|
||||||
* statement
|
* statement
|
||||||
*/
|
*/
|
||||||
DataInputStream in = new DataInputStream(socket.getInputStream());
|
DataInputStream in = new DataInputStream(socket.getInputStream());
|
||||||
|
|
|
@ -91,7 +91,7 @@ import org.jxmpp.util.cache.LruCache;
|
||||||
* but XEP-0030 then XEP-0030 mechanisms are transparently used.
|
* but XEP-0030 then XEP-0030 mechanisms are transparently used.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* The caches used by Smack for Entity Capabilities is non-persisent per default. However, it is is also possible to set
|
* The caches used by Smack for Entity Capabilities is non-persistent per default. However, it is is also possible to set
|
||||||
* a persistent Entity Capabilities cache, which is recommended.
|
* a persistent Entity Capabilities cache, which is recommended.
|
||||||
* </p>
|
* </p>
|
||||||
* <h2>Examples</h2>
|
* <h2>Examples</h2>
|
||||||
|
@ -226,7 +226,7 @@ public final class EntityCapsManager extends Manager {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Node version (node#ver) of a JID. Returns a String or null if
|
* Get the Node version (node#ver) of a JID. Returns a String or null if
|
||||||
* EntiyCapsManager does not have any information.
|
* EntityCapsManager does not have any information.
|
||||||
*
|
*
|
||||||
* @param jid TODO javadoc me please
|
* @param jid TODO javadoc me please
|
||||||
* the user (Full JID)
|
* the user (Full JID)
|
||||||
|
|
|
@ -654,7 +654,7 @@ public final class AdHocCommandManager extends Manager {
|
||||||
public AdHocCommandHandler getCommandInstance() throws InstantiationException,
|
public AdHocCommandHandler getCommandInstance() throws InstantiationException,
|
||||||
IllegalAccessException, IllegalArgumentException, InvocationTargetException {
|
IllegalAccessException, IllegalArgumentException, InvocationTargetException {
|
||||||
String sessionId;
|
String sessionId;
|
||||||
// TODO: The code below contains a race condition. Use CopncurrentHashMap.computeIfAbsent() to remove the
|
// TODO: The code below contains a race condition. Use ConcurrentHashMap.computeIfAbsent() to remove the
|
||||||
// race condition once Smack's minimum Android API level 24 or higher.
|
// race condition once Smack's minimum Android API level 24 or higher.
|
||||||
int attempt = 0;
|
int attempt = 0;
|
||||||
do {
|
do {
|
||||||
|
|
|
@ -23,14 +23,14 @@ import org.jivesoftware.smack.packet.Stanza;
|
||||||
import org.jivesoftware.smackx.delay.DelayInformationManager;
|
import org.jivesoftware.smackx.delay.DelayInformationManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters stanza with delay information, ie. stanzas that got delayed for some reason
|
* Filters stanza with delay information, i.e. stanzas that got delayed for some reason
|
||||||
*/
|
*/
|
||||||
public final class DelayedStanzaFilter implements StanzaFilter {
|
public final class DelayedStanzaFilter implements StanzaFilter {
|
||||||
|
|
||||||
public static final StanzaFilter INSTANCE = new DelayedStanzaFilter();
|
public static final StanzaFilter INSTANCE = new DelayedStanzaFilter();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters stanzas that got not delayed, ie. have no delayed information
|
* Filters stanzas that got not delayed, i.e. have no delayed information
|
||||||
*/
|
*/
|
||||||
public static final StanzaFilter NOT_DELAYED_STANZA = new NotFilter(INSTANCE);
|
public static final StanzaFilter NOT_DELAYED_STANZA = new NotFilter(INSTANCE);
|
||||||
|
|
||||||
|
|
|
@ -294,7 +294,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
||||||
/**
|
/**
|
||||||
* Returns all identities of this client as unmodifiable Collection.
|
* Returns all identities of this client as unmodifiable Collection.
|
||||||
*
|
*
|
||||||
* @return all identies as set
|
* @return all identities as a set
|
||||||
*/
|
*/
|
||||||
public Set<DiscoverInfo.Identity> getIdentities() {
|
public Set<DiscoverInfo.Identity> getIdentities() {
|
||||||
Set<Identity> res = new HashSet<>(identities);
|
Set<Identity> res = new HashSet<>(identities);
|
||||||
|
|
|
@ -215,7 +215,7 @@ public class DiscoverInfo extends IQ implements DiscoverInfoView {
|
||||||
*
|
*
|
||||||
* @param category category the category to look for.
|
* @param category category the category to look for.
|
||||||
* @param type type the type to look for.
|
* @param type type the type to look for.
|
||||||
* @return a list of Identites with the given category and type.
|
* @return a list of Identities with the given category and type.
|
||||||
*/
|
*/
|
||||||
public List<Identity> getIdentities(String category, String type) {
|
public List<Identity> getIdentities(String category, String type) {
|
||||||
List<Identity> res = new ArrayList<>(identities.size());
|
List<Identity> res = new ArrayList<>(identities.size());
|
||||||
|
|
|
@ -51,7 +51,7 @@ import org.jivesoftware.smack.util.CloseableUtil;
|
||||||
* The second way that a file can be received through this class is by invoking
|
* The second way that a file can be received through this class is by invoking
|
||||||
* the {@link #receiveFile(File)} method. This method returns immediately and
|
* the {@link #receiveFile(File)} method. This method returns immediately and
|
||||||
* takes as its parameter a file on the local file system where the file
|
* takes as its parameter a file on the local file system where the file
|
||||||
* recieved from the transfer will be put.
|
* received from the transfer will be put.
|
||||||
*
|
*
|
||||||
* @author Alexander Wenckus
|
* @author Alexander Wenckus
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -52,7 +52,7 @@ public abstract class StreamNegotiator extends Manager {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A event manager for stream initiation requests send to us.
|
* An event manager for stream initiation requests send to us.
|
||||||
* <p>
|
* <p>
|
||||||
* Those are typical XEP-45 Open or XEP-65 Bytestream IQ requests. The even key is in the format
|
* Those are typical XEP-45 Open or XEP-65 Bytestream IQ requests. The even key is in the format
|
||||||
* "initiationFrom + '\t' + streamId"
|
* "initiationFrom + '\t' + streamId"
|
||||||
|
|
|
@ -144,7 +144,7 @@
|
||||||
* <li>**isDone()** - Similar to getProgress() except it returns a _boolean_. If the state is rejected, canceled, error,
|
* <li>**isDone()** - Similar to getProgress() except it returns a _boolean_. If the state is rejected, canceled, error,
|
||||||
* or complete then true will be returned and false otherwise.</li>
|
* or complete then true will be returned and false otherwise.</li>
|
||||||
* <li>**getError()** - If there is an error during the file transfer this method will return the type of error that
|
* <li>**getError()** - If there is an error during the file transfer this method will return the type of error that
|
||||||
* occured.</li>
|
* occurred.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* <h3>Examples</h3>
|
* <h3>Examples</h3>
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -43,7 +43,7 @@ import org.jxmpp.jid.Jid;
|
||||||
* <br>
|
* <br>
|
||||||
* To publish a UserLocation, please use {@link #publishGeoLocation(GeoLocation)} method. This will publish the node.
|
* To publish a UserLocation, please use {@link #publishGeoLocation(GeoLocation)} method. This will publish the node.
|
||||||
* <br>
|
* <br>
|
||||||
* To stop publishing a UserLocation, please use {@link #stopPublishingGeolocation()} method. This will send a disble publishing signal.
|
* To stop publishing a UserLocation, please use {@link #stopPublishingGeolocation()} method. This will send a disable publishing signal.
|
||||||
* <br>
|
* <br>
|
||||||
* To add a {@link PepEventListener} in order to remain updated with other users GeoLocation, use {@link #addGeoLocationListener(PepEventListener)} method.
|
* To add a {@link PepEventListener} in order to remain updated with other users GeoLocation, use {@link #addGeoLocationListener(PepEventListener)} method.
|
||||||
* <br>
|
* <br>
|
||||||
|
|
|
@ -41,7 +41,7 @@ public interface PrivateData {
|
||||||
String getNamespace();
|
String getNamespace();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the XML reppresentation of the PrivateData.
|
* Returns the XML representation of the PrivateData.
|
||||||
*
|
*
|
||||||
* @return the private data as XML.
|
* @return the private data as XML.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -52,7 +52,7 @@ import org.jxmpp.jid.FullJid;
|
||||||
* | transport-info
|
* | transport-info
|
||||||
* | transport-reject
|
* | transport-reject
|
||||||
* | transport-replace
|
* | transport-replace
|
||||||
* │ initator (RECOMMENDED for session initiate, NOT RECOMMENDED otherwise, full JID, XEP-0166 § 7.1)
|
* │ initiator (RECOMMENDED for session initiate, NOT RECOMMENDED otherwise, full JID, XEP-0166 § 7.1)
|
||||||
* │ responder (RECOMMENDED for session accept, NOT RECOMMENDED otherwise, full JID. XEP-0166 § 7.1)
|
* │ responder (RECOMMENDED for session accept, NOT RECOMMENDED otherwise, full JID. XEP-0166 § 7.1)
|
||||||
* │ sid (REQUIRED, SHOULD match XML Nmtoken production)
|
* │ sid (REQUIRED, SHOULD match XML Nmtoken production)
|
||||||
* │
|
* │
|
||||||
|
|
|
@ -71,7 +71,7 @@ public final class JingleContent implements XmlElement {
|
||||||
private final JingleContentTransport transport;
|
private final JingleContentTransport transport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a content description..
|
* Creates a content description.
|
||||||
*/
|
*/
|
||||||
private JingleContent(Creator creator, String disposition, String name, Senders senders,
|
private JingleContent(Creator creator, String disposition, String name, Senders senders,
|
||||||
JingleContentDescription description, JingleContentTransport transport) {
|
JingleContentDescription description, JingleContentTransport transport) {
|
||||||
|
|
|
@ -70,7 +70,7 @@ chat.sendMessage(message);</code>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>When you send a Java object as a property, only clients running Java will be able to interpret the data. So,
|
* <li>When you send a Java object as a property, only clients running Java will be able to interpret the data. So,
|
||||||
* consider using a series of primitive values to transfer data instead.</li>
|
* consider using a series of primitive values to transfer data instead.</li>
|
||||||
* <li>Objects sent as property values must implement Serialiable. Additionally, both the sender and receiver must have
|
* <li>Objects sent as property values must implement Serializable. Additionally, both the sender and receiver must have
|
||||||
* identical versions of the class, or a serialization exception will occur when de-serializing the object.</li>
|
* identical versions of the class, or a serialization exception will occur when de-serializing the object.</li>
|
||||||
* <li>Serialized objects can potentially be quite large, which will use more bandwidth and server resources.</li>
|
* <li>Serialized objects can potentially be quite large, which will use more bandwidth and server resources.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
|
|
|
@ -55,10 +55,10 @@ public class Affiliate {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the affiliation of the afffiliated user. Possible affiliations are: "owner", "admin",
|
* Returns the affiliation of the affiliated user. Possible affiliations are: "owner", "admin",
|
||||||
* "member", "outcast". This information will always be available.
|
* "member", "outcast". This information will always be available.
|
||||||
*
|
*
|
||||||
* @return the affiliation of the afffiliated user.
|
* @return the affiliation of the affiliated user.
|
||||||
*/
|
*/
|
||||||
public MUCAffiliation getAffiliation() {
|
public MUCAffiliation getAffiliation() {
|
||||||
return affiliation;
|
return affiliation;
|
||||||
|
|
|
@ -25,7 +25,7 @@ import org.jxmpp.jid.parts.Resourcepart;
|
||||||
* Default implementation of the ParticipantStatusListener interface.<p>
|
* Default implementation of the ParticipantStatusListener interface.<p>
|
||||||
*
|
*
|
||||||
* This class does not provide any behavior by default. It just avoids having
|
* This class does not provide any behavior by default. It just avoids having
|
||||||
* to implement all the inteface methods if the user is only interested in implementing
|
* to implement all the interface methods if the user is only interested in implementing
|
||||||
* some of the methods.
|
* some of the methods.
|
||||||
*
|
*
|
||||||
* @author Gaston Dombiak
|
* @author Gaston Dombiak
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.jxmpp.jid.Jid;
|
||||||
* Default implementation of the UserStatusListener interface.<p>
|
* Default implementation of the UserStatusListener interface.<p>
|
||||||
*
|
*
|
||||||
* This class does not provide any behavior by default. It just avoids having
|
* This class does not provide any behavior by default. It just avoids having
|
||||||
* to implement all the inteface methods if the user is only interested in implementing
|
* to implement all the interface methods if the user is only interested in implementing
|
||||||
* some of the methods.
|
* some of the methods.
|
||||||
*
|
*
|
||||||
* @author Gaston Dombiak
|
* @author Gaston Dombiak
|
||||||
|
|
|
@ -285,7 +285,7 @@ public class MucConfigFormManager {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the room supports its visibility being controlled vioa configuration.
|
* Check if the room supports its visibility being controlled via configuration.
|
||||||
*
|
*
|
||||||
* @return <code>true</code> if supported, <code>false</code> if not.
|
* @return <code>true</code> if supported, <code>false</code> if not.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -351,7 +351,7 @@ public class MultiUserChat {
|
||||||
* @throws NoResponseException if there was no response from the remote entity.
|
* @throws NoResponseException if there was no response from the remote entity.
|
||||||
* @throws XMPPErrorException if there was an XMPP error returned.
|
* @throws XMPPErrorException if there was an XMPP error returned.
|
||||||
* @throws InterruptedException if the calling thread was interrupted.
|
* @throws InterruptedException if the calling thread was interrupted.
|
||||||
* @throws NotAMucServiceException if the entity is not a MUC serivce.
|
* @throws NotAMucServiceException if the entity is not a MUC service.
|
||||||
* @see <a href="http://xmpp.org/extensions/xep-0045.html#enter">XEP-45 7.2 Entering a Room</a>
|
* @see <a href="http://xmpp.org/extensions/xep-0045.html#enter">XEP-45 7.2 Entering a Room</a>
|
||||||
*/
|
*/
|
||||||
private Presence enter(MucEnterConfiguration conf) throws NotConnectedException, NoResponseException,
|
private Presence enter(MucEnterConfiguration conf) throws NotConnectedException, NoResponseException,
|
||||||
|
@ -365,7 +365,7 @@ public class MultiUserChat {
|
||||||
// field is in the form "roomName@service/nickname"
|
// field is in the form "roomName@service/nickname"
|
||||||
Presence joinPresence = conf.getJoinPresence(this);
|
Presence joinPresence = conf.getJoinPresence(this);
|
||||||
|
|
||||||
// Setup the messageListeners and presenceListeners *before* the join presence is send.
|
// Set up the messageListeners and presenceListeners *before* the join presence is sent.
|
||||||
connection.addStanzaListener(messageListener, fromRoomGroupchatFilter);
|
connection.addStanzaListener(messageListener, fromRoomGroupchatFilter);
|
||||||
StanzaFilter presenceFromRoomFilter = new AndFilter(fromRoomFilter,
|
StanzaFilter presenceFromRoomFilter = new AndFilter(fromRoomFilter,
|
||||||
StanzaTypeFilter.PRESENCE,
|
StanzaTypeFilter.PRESENCE,
|
||||||
|
@ -401,12 +401,12 @@ public class MultiUserChat {
|
||||||
StanzaCollector presenceStanzaCollector = null;
|
StanzaCollector presenceStanzaCollector = null;
|
||||||
final Presence reflectedSelfPresence;
|
final Presence reflectedSelfPresence;
|
||||||
try {
|
try {
|
||||||
// This stanza collector will collect the final self presence from the MUC, which also signals that we have successful entered the MUC.
|
// This stanza collector will collect the final self presence from the MUC, which also signals that we have successfully entered the MUC.
|
||||||
StanzaCollector selfPresenceCollector = connection.createStanzaCollectorAndSend(responseFilter, joinPresence);
|
StanzaCollector selfPresenceCollector = connection.createStanzaCollectorAndSend(responseFilter, joinPresence);
|
||||||
StanzaCollector.Configuration presenceStanzaCollectorConfguration = StanzaCollector.newConfiguration().setCollectorToReset(
|
StanzaCollector.Configuration presenceStanzaCollectorConfiguration = StanzaCollector.newConfiguration().setCollectorToReset(
|
||||||
selfPresenceCollector).setStanzaFilter(presenceFromRoomFilter);
|
selfPresenceCollector).setStanzaFilter(presenceFromRoomFilter);
|
||||||
// This stanza collector is used to reset the timeout of the selfPresenceCollector.
|
// This stanza collector is used to reset the timeout of the selfPresenceCollector.
|
||||||
presenceStanzaCollector = connection.createStanzaCollector(presenceStanzaCollectorConfguration);
|
presenceStanzaCollector = connection.createStanzaCollector(presenceStanzaCollectorConfiguration);
|
||||||
reflectedSelfPresence = selfPresenceCollector.nextResultOrThrow(conf.getTimeout());
|
reflectedSelfPresence = selfPresenceCollector.nextResultOrThrow(conf.getTimeout());
|
||||||
}
|
}
|
||||||
catch (NotConnectedException | InterruptedException | NoResponseException | XMPPErrorException e) {
|
catch (NotConnectedException | InterruptedException | NoResponseException | XMPPErrorException e) {
|
||||||
|
@ -423,15 +423,15 @@ public class MultiUserChat {
|
||||||
synchronized (presenceListener) {
|
synchronized (presenceListener) {
|
||||||
// Only continue after we have received *and* processed the reflected self-presence. Since presences are
|
// Only continue after we have received *and* processed the reflected self-presence. Since presences are
|
||||||
// handled in an extra listener, we may return from enter() without having processed all presences of the
|
// handled in an extra listener, we may return from enter() without having processed all presences of the
|
||||||
// participants, resulting in a e.g. to low participant counter after enter(). Hence we wait here until the
|
// participants, resulting in a e.g. to low participant counter after enter(). Hence, we wait here until the
|
||||||
// processing is done.
|
// processing is done.
|
||||||
while (!processedReflectedSelfPresence) {
|
while (!processedReflectedSelfPresence) {
|
||||||
presenceListener.wait();
|
presenceListener.wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This presence must be send from a full JID. We use the resourcepart of this JID as nick, since the room may
|
// This presence must be sent from a full JID. We use the resourcepart of this JID as nick, since the room may
|
||||||
// performed roomnick rewriting
|
// have performed roomnick rewriting
|
||||||
Resourcepart receivedNickname = reflectedSelfPresence.getFrom().getResourceOrThrow();
|
Resourcepart receivedNickname = reflectedSelfPresence.getFrom().getResourceOrThrow();
|
||||||
setNickname(receivedNickname);
|
setNickname(receivedNickname);
|
||||||
|
|
||||||
|
@ -481,7 +481,7 @@ public class MultiUserChat {
|
||||||
* @throws NotConnectedException if the XMPP connection is not connected.
|
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||||
* @throws MucAlreadyJoinedException if already joined the Multi-User Chat.7y
|
* @throws MucAlreadyJoinedException if already joined the Multi-User Chat.7y
|
||||||
* @throws MissingMucCreationAcknowledgeException if there MUC creation was not acknowledged by the service.
|
* @throws MissingMucCreationAcknowledgeException if there MUC creation was not acknowledged by the service.
|
||||||
* @throws NotAMucServiceException if the entity is not a MUC serivce.
|
* @throws NotAMucServiceException if the entity is not a MUC service.
|
||||||
*/
|
*/
|
||||||
public synchronized MucCreateConfigFormHandle create(Resourcepart nickname) throws NoResponseException,
|
public synchronized MucCreateConfigFormHandle create(Resourcepart nickname) throws NoResponseException,
|
||||||
XMPPErrorException, InterruptedException, MucAlreadyJoinedException,
|
XMPPErrorException, InterruptedException, MucAlreadyJoinedException,
|
||||||
|
@ -515,7 +515,7 @@ public class MultiUserChat {
|
||||||
* @throws InterruptedException if the calling thread was interrupted.
|
* @throws InterruptedException if the calling thread was interrupted.
|
||||||
* @throws NotConnectedException if the XMPP connection is not connected.
|
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||||
* @throws MucAlreadyJoinedException if already joined the Multi-User Chat.7y
|
* @throws MucAlreadyJoinedException if already joined the Multi-User Chat.7y
|
||||||
* @throws NotAMucServiceException if the entity is not a MUC serivce.
|
* @throws NotAMucServiceException if the entity is not a MUC service.
|
||||||
*/
|
*/
|
||||||
public synchronized MucCreateConfigFormHandle createOrJoin(Resourcepart nickname) throws NoResponseException, XMPPErrorException,
|
public synchronized MucCreateConfigFormHandle createOrJoin(Resourcepart nickname) throws NoResponseException, XMPPErrorException,
|
||||||
InterruptedException, MucAlreadyJoinedException, NotConnectedException, NotAMucServiceException {
|
InterruptedException, MucAlreadyJoinedException, NotConnectedException, NotAMucServiceException {
|
||||||
|
@ -537,7 +537,7 @@ public class MultiUserChat {
|
||||||
* @throws InterruptedException if the calling thread was interrupted.
|
* @throws InterruptedException if the calling thread was interrupted.
|
||||||
* @throws MucAlreadyJoinedException if the MUC is already joined
|
* @throws MucAlreadyJoinedException if the MUC is already joined
|
||||||
* @throws NotConnectedException if the XMPP connection is not connected.
|
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||||
* @throws NotAMucServiceException if the entity is not a MUC serivce.
|
* @throws NotAMucServiceException if the entity is not a MUC service.
|
||||||
*/
|
*/
|
||||||
public synchronized MucCreateConfigFormHandle createOrJoin(MucEnterConfiguration mucEnterConfiguration)
|
public synchronized MucCreateConfigFormHandle createOrJoin(MucEnterConfiguration mucEnterConfiguration)
|
||||||
throws NoResponseException, XMPPErrorException, InterruptedException, MucAlreadyJoinedException, NotConnectedException, NotAMucServiceException {
|
throws NoResponseException, XMPPErrorException, InterruptedException, MucAlreadyJoinedException, NotConnectedException, NotAMucServiceException {
|
||||||
|
@ -610,7 +610,7 @@ public class MultiUserChat {
|
||||||
* @throws XMPPErrorException if there was an XMPP error returned.
|
* @throws XMPPErrorException if there was an XMPP error returned.
|
||||||
* @throws NotConnectedException if the XMPP connection is not connected.
|
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||||
* @throws InterruptedException if the calling thread was interrupted.
|
* @throws InterruptedException if the calling thread was interrupted.
|
||||||
* @throws NotAMucServiceException if the entity is not a MUC serivce.
|
* @throws NotAMucServiceException if the entity is not a MUC service.
|
||||||
*/
|
*/
|
||||||
public MucCreateConfigFormHandle createOrJoinIfNecessary(Resourcepart nickname, String password) throws NoResponseException,
|
public MucCreateConfigFormHandle createOrJoinIfNecessary(Resourcepart nickname, String password) throws NoResponseException,
|
||||||
XMPPErrorException, NotConnectedException, InterruptedException, NotAMucServiceException {
|
XMPPErrorException, NotConnectedException, InterruptedException, NotAMucServiceException {
|
||||||
|
@ -646,7 +646,7 @@ public class MultiUserChat {
|
||||||
* @throws NoResponseException if there was no response from the server.
|
* @throws NoResponseException if there was no response from the server.
|
||||||
* @throws NotConnectedException if the XMPP connection is not connected.
|
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||||
* @throws InterruptedException if the calling thread was interrupted.
|
* @throws InterruptedException if the calling thread was interrupted.
|
||||||
* @throws NotAMucServiceException if the entity is not a MUC serivce.
|
* @throws NotAMucServiceException if the entity is not a MUC service.
|
||||||
*/
|
*/
|
||||||
public Presence join(Resourcepart nickname) throws NoResponseException, XMPPErrorException,
|
public Presence join(Resourcepart nickname) throws NoResponseException, XMPPErrorException,
|
||||||
NotConnectedException, InterruptedException, NotAMucServiceException {
|
NotConnectedException, InterruptedException, NotAMucServiceException {
|
||||||
|
@ -676,7 +676,7 @@ public class MultiUserChat {
|
||||||
* @throws InterruptedException if the calling thread was interrupted.
|
* @throws InterruptedException if the calling thread was interrupted.
|
||||||
* @throws NotConnectedException if the XMPP connection is not connected.
|
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||||
* @throws NoResponseException if there was no response from the server.
|
* @throws NoResponseException if there was no response from the server.
|
||||||
* @throws NotAMucServiceException if the entity is not a MUC serivce.
|
* @throws NotAMucServiceException if the entity is not a MUC service.
|
||||||
*/
|
*/
|
||||||
public void join(Resourcepart nickname, String password) throws XMPPErrorException, InterruptedException, NoResponseException, NotConnectedException, NotAMucServiceException {
|
public void join(Resourcepart nickname, String password) throws XMPPErrorException, InterruptedException, NoResponseException, NotConnectedException, NotAMucServiceException {
|
||||||
MucEnterConfiguration.Builder builder = getEnterConfigurationBuilder(nickname).withPassword(
|
MucEnterConfiguration.Builder builder = getEnterConfigurationBuilder(nickname).withPassword(
|
||||||
|
@ -709,7 +709,7 @@ public class MultiUserChat {
|
||||||
* @throws NoResponseException if there was no response from the server.
|
* @throws NoResponseException if there was no response from the server.
|
||||||
* @throws NotConnectedException if the XMPP connection is not connected.
|
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||||
* @throws InterruptedException if the calling thread was interrupted.
|
* @throws InterruptedException if the calling thread was interrupted.
|
||||||
* @throws NotAMucServiceException if the entity is not a MUC serivce.
|
* @throws NotAMucServiceException if the entity is not a MUC service.
|
||||||
*/
|
*/
|
||||||
public synchronized Presence join(MucEnterConfiguration mucEnterConfiguration)
|
public synchronized Presence join(MucEnterConfiguration mucEnterConfiguration)
|
||||||
throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException, NotAMucServiceException {
|
throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException, NotAMucServiceException {
|
||||||
|
@ -833,9 +833,9 @@ public class MultiUserChat {
|
||||||
/**
|
/**
|
||||||
* Returns the room's configuration form that the room's owner can use.
|
* Returns the room's configuration form that the room's owner can use.
|
||||||
* The configuration form allows to set the room's language,
|
* The configuration form allows to set the room's language,
|
||||||
* enable logging, specify room's type, etc..
|
* enable logging, specify room's type, etc.
|
||||||
*
|
*
|
||||||
* @return the Form that contains the fields to complete together with the instrucions or
|
* @return the Form that contains the fields to complete together with the instructions or
|
||||||
* <code>null</code> if no configuration is possible.
|
* <code>null</code> if no configuration is possible.
|
||||||
* @throws XMPPErrorException if an error occurs asking the configuration form for the room.
|
* @throws XMPPErrorException if an error occurs asking the configuration form for the room.
|
||||||
* @throws NoResponseException if there was no response from the server.
|
* @throws NoResponseException if there was no response from the server.
|
||||||
|
@ -889,7 +889,7 @@ public class MultiUserChat {
|
||||||
* error to the user (error code 405).
|
* error to the user (error code 405).
|
||||||
*
|
*
|
||||||
* @return the registration Form that contains the fields to complete together with the
|
* @return the registration Form that contains the fields to complete together with the
|
||||||
* instrucions or <code>null</code> if no registration is possible.
|
* instructions or <code>null</code> if no registration is possible.
|
||||||
* @throws XMPPErrorException if an error occurs asking the registration form for the room or a
|
* @throws XMPPErrorException if an error occurs asking the registration form for the room or a
|
||||||
* 405 error if the user is not allowed to register with the room.
|
* 405 error if the user is not allowed to register with the room.
|
||||||
* @throws NoResponseException if there was no response from the server.
|
* @throws NoResponseException if there was no response from the server.
|
||||||
|
@ -1598,7 +1598,7 @@ public class MultiUserChat {
|
||||||
/**
|
/**
|
||||||
* Grants moderator privileges to participants or visitors. Room administrators may grant
|
* Grants moderator privileges to participants or visitors. Room administrators may grant
|
||||||
* moderator privileges. A moderator is allowed to kick users, grant and revoke voice, invite
|
* moderator privileges. A moderator is allowed to kick users, grant and revoke voice, invite
|
||||||
* other users, modify room's subject plus all the partcipants privileges.
|
* other users, modify room's subject plus all the participant privileges.
|
||||||
*
|
*
|
||||||
* @param nicknames the nicknames of the occupants to grant moderator privileges.
|
* @param nicknames the nicknames of the occupants to grant moderator privileges.
|
||||||
* @throws XMPPErrorException if an error occurs granting moderator privileges to a user.
|
* @throws XMPPErrorException if an error occurs granting moderator privileges to a user.
|
||||||
|
@ -1613,7 +1613,7 @@ public class MultiUserChat {
|
||||||
/**
|
/**
|
||||||
* Grants moderator privileges to a participant or visitor. Room administrators may grant
|
* Grants moderator privileges to a participant or visitor. Room administrators may grant
|
||||||
* moderator privileges. A moderator is allowed to kick users, grant and revoke voice, invite
|
* moderator privileges. A moderator is allowed to kick users, grant and revoke voice, invite
|
||||||
* other users, modify room's subject plus all the partcipants privileges.
|
* other users, modify room's subject plus all the participant privileges.
|
||||||
*
|
*
|
||||||
* @param nickname the nickname of the occupant to grant moderator privileges.
|
* @param nickname the nickname of the occupant to grant moderator privileges.
|
||||||
* @throws XMPPErrorException if an error occurs granting moderator privileges to a user.
|
* @throws XMPPErrorException if an error occurs granting moderator privileges to a user.
|
||||||
|
@ -2171,7 +2171,7 @@ public class MultiUserChat {
|
||||||
/**
|
/**
|
||||||
* Polls for and returns the next message, or <code>null</code> if there isn't
|
* Polls for and returns the next message, or <code>null</code> if there isn't
|
||||||
* a message immediately available. This method provides significantly different
|
* a message immediately available. This method provides significantly different
|
||||||
* functionalty than the {@link #nextMessage()} method since it's non-blocking.
|
* functionality than the {@link #nextMessage()} method since it's non-blocking.
|
||||||
* In other words, the method call will always return immediately, whereas the
|
* In other words, the method call will always return immediately, whereas the
|
||||||
* nextMessage method will return only when a message is available (or after
|
* nextMessage method will return only when a message is available (or after
|
||||||
* a specific timeout).
|
* a specific timeout).
|
||||||
|
@ -2204,7 +2204,7 @@ public class MultiUserChat {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the next available message in the chat. The method call will block
|
* Returns the next available message in the chat. The method call will block
|
||||||
* (not return) until a stanza is available or the <code>timeout</code> has elapased.
|
* (not return) until a stanza is available or the <code>timeout</code> has elapsed.
|
||||||
* If the timeout elapses without a result, <code>null</code> will be returned.
|
* If the timeout elapses without a result, <code>null</code> will be returned.
|
||||||
*
|
*
|
||||||
* @param timeout the maximum amount of time to wait for the next message.
|
* @param timeout the maximum amount of time to wait for the next message.
|
||||||
|
|
|
@ -298,7 +298,7 @@ public final class MultiUserChatManager extends Manager {
|
||||||
* {@link MultiUserChat#join(org.jxmpp.jid.parts.Resourcepart) join} the chat room. On some server implementations, the room will not be
|
* {@link MultiUserChat#join(org.jxmpp.jid.parts.Resourcepart) join} the chat room. On some server implementations, the room will not be
|
||||||
* created until the first person joins it.
|
* created until the first person joins it.
|
||||||
* <p>
|
* <p>
|
||||||
* Most XMPP servers use a sub-domain for the chat service (eg chat.example.com for the XMPP server example.com).
|
* Most XMPP servers use a sub-domain for the chat service (e.g.chat.example.com for the XMPP server example.com).
|
||||||
* You must ensure that the room address you're trying to connect to includes the proper chat sub-domain.
|
* You must ensure that the room address you're trying to connect to includes the proper chat sub-domain.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
@ -481,7 +481,7 @@ public final class MultiUserChatManager extends Manager {
|
||||||
* @throws NoResponseException if there was no response from the remote entity.
|
* @throws NoResponseException if there was no response from the remote entity.
|
||||||
* @throws NotConnectedException if the XMPP connection is not connected.
|
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||||
* @throws InterruptedException if the calling thread was interrupted.
|
* @throws InterruptedException if the calling thread was interrupted.
|
||||||
* @throws NotAMucServiceException if the entity is not a MUC serivce.
|
* @throws NotAMucServiceException if the entity is not a MUC service.
|
||||||
* @since 4.3.1
|
* @since 4.3.1
|
||||||
*/
|
*/
|
||||||
public Map<EntityBareJid, HostedRoom> getRoomsHostedBy(DomainBareJid serviceName) throws NoResponseException, XMPPErrorException,
|
public Map<EntityBareJid, HostedRoom> getRoomsHostedBy(DomainBareJid serviceName) throws NoResponseException, XMPPErrorException,
|
||||||
|
|
|
@ -129,7 +129,7 @@ public interface ParticipantStatusListener {
|
||||||
/**
|
/**
|
||||||
* Called when an administrator grants moderator privileges to a user. This means that the user
|
* Called when an administrator grants moderator privileges to a user. This means that the user
|
||||||
* will be able to kick users, grant and revoke voice, invite other users, modify room's
|
* will be able to kick users, grant and revoke voice, invite other users, modify room's
|
||||||
* subject plus all the partcipants privileges.
|
* subject plus all the participant privileges.
|
||||||
*
|
*
|
||||||
* @param participant the participant that was granted moderator privileges in the room
|
* @param participant the participant that was granted moderator privileges in the room
|
||||||
* (e.g. room@conference.jabber.org/nick).
|
* (e.g. room@conference.jabber.org/nick).
|
||||||
|
@ -140,7 +140,7 @@ public interface ParticipantStatusListener {
|
||||||
/**
|
/**
|
||||||
* Called when an administrator revokes moderator privileges from a user. This means that the
|
* Called when an administrator revokes moderator privileges from a user. This means that the
|
||||||
* user will no longer be able to kick users, grant and revoke voice, invite other users,
|
* user will no longer be able to kick users, grant and revoke voice, invite other users,
|
||||||
* modify room's subject plus all the partcipants privileges.
|
* modify room's subject plus all the participant privileges.
|
||||||
*
|
*
|
||||||
* @param participant the participant that was revoked moderator privileges in the room
|
* @param participant the participant that was revoked moderator privileges in the room
|
||||||
* (e.g. room@conference.jabber.org/nick).
|
* (e.g. room@conference.jabber.org/nick).
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class RoomInfo {
|
||||||
*/
|
*/
|
||||||
private final boolean moderated;
|
private final boolean moderated;
|
||||||
/**
|
/**
|
||||||
* Every presence stanza can include the JID of every occupant unless the owner deactives this
|
* Every presence stanza can include the JID of every occupant unless the owner deactivates this
|
||||||
* configuration.
|
* configuration.
|
||||||
*/
|
*/
|
||||||
private final boolean nonanonymous;
|
private final boolean nonanonymous;
|
||||||
|
@ -250,7 +250,7 @@ public class RoomInfo {
|
||||||
/**
|
/**
|
||||||
* Returns the room name.
|
* Returns the room name.
|
||||||
* <p>
|
* <p>
|
||||||
* The name returnd here was provided as value of the name attribute
|
* The name returned here was provided as value of the name attribute
|
||||||
* of the returned identity within the disco#info result.
|
* of the returned identity within the disco#info result.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
@ -324,9 +324,9 @@ public class RoomInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if users musy provide a valid password in order to join the room.
|
* Returns true if users must provide a valid password in order to join the room.
|
||||||
*
|
*
|
||||||
* @return true if users musy provide a valid password in order to join the room.
|
* @return true if users must provide a valid password in order to join the room.
|
||||||
*/
|
*/
|
||||||
public boolean isPasswordProtected() {
|
public boolean isPasswordProtected() {
|
||||||
return passwordProtected;
|
return passwordProtected;
|
||||||
|
|
|
@ -39,7 +39,7 @@ public interface UserStatusListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a moderator kicked your user from the room. This means that you are no longer
|
* Called when a moderator kicked your user from the room. This means that you are no longer
|
||||||
* participanting in the room.
|
* participating in the room.
|
||||||
*
|
*
|
||||||
* @param actor the moderator that kicked your user from the room (e.g. user@host.org).
|
* @param actor the moderator that kicked your user from the room (e.g. user@host.org).
|
||||||
* @param reason the reason provided by the actor to kick you from the room.
|
* @param reason the reason provided by the actor to kick you from the room.
|
||||||
|
@ -106,7 +106,7 @@ public interface UserStatusListener {
|
||||||
/**
|
/**
|
||||||
* Called when an administrator grants moderator privileges to your user. This means that you
|
* Called when an administrator grants moderator privileges to your user. This means that you
|
||||||
* will be able to kick users, grant and revoke voice, invite other users, modify room's
|
* will be able to kick users, grant and revoke voice, invite other users, modify room's
|
||||||
* subject plus all the partcipants privileges.
|
* subject plus all the participant privileges.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
default void moderatorGranted() {
|
default void moderatorGranted() {
|
||||||
|
@ -115,7 +115,7 @@ public interface UserStatusListener {
|
||||||
/**
|
/**
|
||||||
* Called when an administrator revokes moderator privileges from your user. This means that
|
* Called when an administrator revokes moderator privileges from your user. This means that
|
||||||
* you will no longer be able to kick users, grant and revoke voice, invite other users,
|
* you will no longer be able to kick users, grant and revoke voice, invite other users,
|
||||||
* modify room's subject plus all the partcipants privileges.
|
* modify room's subject plus all the participant privileges.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
default void moderatorRevoked() {
|
default void moderatorRevoked() {
|
||||||
|
|
|
@ -534,7 +534,7 @@
|
||||||
* </p>
|
* </p>
|
||||||
* <h3>Usage</h3>
|
* <h3>Usage</h3>
|
||||||
* <p>
|
* <p>
|
||||||
* In order to grant membership to a room, administrator privileges or owner priveliges just send
|
* In order to grant membership to a room, administrator privileges or owner privileges just send
|
||||||
* **grantMembership(String jid)**, **grantAdmin(String jid)** or **grantOwnership(String jid)** to _**MultiUserChat**_
|
* **grantMembership(String jid)**, **grantAdmin(String jid)** or **grantOwnership(String jid)** to _**MultiUserChat**_
|
||||||
* respectively. Use **revokeMembership(String jid)**, **revokeAdmin(String jid)** or revokeOwnership(String jid)** to
|
* respectively. Use **revokeMembership(String jid)**, **revokeAdmin(String jid)** or revokeOwnership(String jid)** to
|
||||||
* revoke the membership to a room, administrator privileges or owner priveliges respectively.
|
* revoke the membership to a room, administrator privileges or owner priveliges respectively.
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class Nick implements ExtensionElement {
|
||||||
public static final QName QNAME = new QName(NAMESPACE, "nick");
|
public static final QName QNAME = new QName(NAMESPACE, "nick");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deprected, do not use.
|
* Deprecated, do not use.
|
||||||
*
|
*
|
||||||
* @deprecated use {@link #QNAME} instead.
|
* @deprecated use {@link #QNAME} instead.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -288,7 +288,7 @@ public final class PepManager extends Manager {
|
||||||
*/
|
*/
|
||||||
public LeafNode publish(String nodeId, Item item) throws NotConnectedException, InterruptedException,
|
public LeafNode publish(String nodeId, Item item) throws NotConnectedException, InterruptedException,
|
||||||
NoResponseException, XMPPErrorException, NotALeafNodeException {
|
NoResponseException, XMPPErrorException, NotALeafNodeException {
|
||||||
// PEP nodes are auto created if not existent. Hence Use PubSubManager.tryToPublishAndPossibleAutoCreate() here.
|
// PEP nodes are auto created if not existent. Hence, use PubSubManager.tryToPublishAndPossibleAutoCreate() here.
|
||||||
return pepPubSubManager.tryToPublishAndPossibleAutoCreate(nodeId, item);
|
return pepPubSubManager.tryToPublishAndPossibleAutoCreate(nodeId, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -150,11 +150,11 @@ public final class PingManager extends Manager {
|
||||||
|
|
||||||
// We may received an error response from an intermediate service returning an error like
|
// We may received an error response from an intermediate service returning an error like
|
||||||
// 'remote-server-not-found' or 'remote-server-timeout' to us (which would fake the 'from' address,
|
// 'remote-server-not-found' or 'remote-server-timeout' to us (which would fake the 'from' address,
|
||||||
// see RFC 6120 § 8.3.1 2.). Or the recipient could became unavailable.
|
// see RFC 6120 § 8.3.1 2.). Or the recipient could become unavailable.
|
||||||
|
|
||||||
// Sticking with the current rules of RFC 6120/6121, it is undecidable at this point whether we received an
|
// Sticking with the current rules of RFC 6120/6121, it is undecidable at this point whether we received an
|
||||||
// error response from the pinged entity or not. This is because a service-unavailable error condition is
|
// error response from the pinged entity or not. This is because a service-unavailable error condition is
|
||||||
// *required* (as per the RFCs) to be send back in both relevant cases:
|
// *required* (as per the RFCs) to be sent back in both relevant cases:
|
||||||
// 1. When the receiving entity is unaware of the IQ request type. RFC 6120 § 8.4.:
|
// 1. When the receiving entity is unaware of the IQ request type. RFC 6120 § 8.4.:
|
||||||
// "If an intended recipient receives an IQ stanza of type "get" or
|
// "If an intended recipient receives an IQ stanza of type "get" or
|
||||||
// "set" containing a child element qualified by a namespace it does
|
// "set" containing a child element qualified by a namespace it does
|
||||||
|
@ -244,7 +244,7 @@ public final class PingManager extends Manager {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same as calling {@link #ping(Jid, long)} with the defaultpacket reply
|
* Same as calling {@link #ping(Jid, long)} with the default packet reply
|
||||||
* timeout.
|
* timeout.
|
||||||
*
|
*
|
||||||
* @param jid The id of the entity the ping is being sent to
|
* @param jid The id of the entity the ping is being sent to
|
||||||
|
|
|
@ -156,7 +156,7 @@
|
||||||
* <p>
|
* <p>
|
||||||
* In order to handle privacy changes, clients SHOULD listen manager’s updates. When a list is changed the manager
|
* In order to handle privacy changes, clients SHOULD listen manager’s updates. When a list is changed the manager
|
||||||
* notifies every added listener. Listeners MUST implement the <code>PrivacyListListener</code> interface. Clients may
|
* notifies every added listener. Listeners MUST implement the <code>PrivacyListListener</code> interface. Clients may
|
||||||
* need to react when a privacy list is modified. The <code>PrivacyListManager</code> lets you add listerners that will
|
* need to react when a privacy list is modified. The <code>PrivacyListManager</code> lets you add listeners that will
|
||||||
* be notified when a list has been changed. Listeners should implement the <code>PrivacyListListener</code> interface.
|
* be notified when a list has been changed. Listeners should implement the <code>PrivacyListListener</code> interface.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -171,7 +171,7 @@ public class PrivacyItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets wheather the receiver allows or denies incoming messages or not.
|
* Sets whether the receiver allows or denies incoming messages or not.
|
||||||
*
|
*
|
||||||
* @param filterMessage indicates if the receiver allows or denies incoming messages or not.
|
* @param filterMessage indicates if the receiver allows or denies incoming messages or not.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -263,7 +263,7 @@ public final class PubSubManager extends Manager {
|
||||||
DataForm submitForm = config.getDataFormToSubmit();
|
DataForm submitForm = config.getDataFormToSubmit();
|
||||||
request.addExtension(new FormNode(FormNodeType.CONFIGURE, submitForm));
|
request.addExtension(new FormNode(FormNodeType.CONFIGURE, submitForm));
|
||||||
NodeType nodeType = config.getNodeType();
|
NodeType nodeType = config.getNodeType();
|
||||||
// Note that some implementations do to have the pubsub#node_type field in their defauilt configuration,
|
// Note that some implementations do to have the pubsub#node_type field in their default configuration,
|
||||||
// which I believe to be a bug. However, since PubSub specifies the default node type to be 'leaf' we assume
|
// which I believe to be a bug. However, since PubSub specifies the default node type to be 'leaf' we assume
|
||||||
// leaf if the field does not exist.
|
// leaf if the field does not exist.
|
||||||
isLeafNode = nodeType == null || nodeType == NodeType.leaf;
|
isLeafNode = nodeType == null || nodeType == NodeType.leaf;
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class SimplePayload implements XmlElement {
|
||||||
* @param elementName The root element name (of the payload)
|
* @param elementName The root element name (of the payload)
|
||||||
* @param namespace The namespace of the payload, null if there is none
|
* @param namespace The namespace of the payload, null if there is none
|
||||||
* @param xmlPayload The payload data
|
* @param xmlPayload The payload data
|
||||||
* @deprecated use {@link #SimplePayload(String)} insteas.
|
* @deprecated use {@link #SimplePayload(String)} instead.
|
||||||
*/
|
*/
|
||||||
// TODO: Remove in Smack 4.5
|
// TODO: Remove in Smack 4.5
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
|
|
@ -150,7 +150,7 @@ public class ReportedData {
|
||||||
/**
|
/**
|
||||||
* Creates a new column with the specified definition.
|
* Creates a new column with the specified definition.
|
||||||
*
|
*
|
||||||
* @param label the columns's label.
|
* @param label the column's label.
|
||||||
* @param variable the variable name of the column.
|
* @param variable the variable name of the column.
|
||||||
* @param type the format for the returned data.
|
* @param type the format for the returned data.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -122,7 +122,7 @@ public final class VCard extends IQ {
|
||||||
private String photoBinval;
|
private String photoBinval;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Such as DESC ROLE GEO etc.. see XEP-0054
|
* Such as DESC ROLE GEO etc. see XEP-0054
|
||||||
*/
|
*/
|
||||||
private final Map<String, String> otherSimpleFields = new HashMap<>();
|
private final Map<String, String> otherSimpleFields = new HashMap<>();
|
||||||
|
|
||||||
|
@ -575,7 +575,7 @@ public final class VCard extends IQ {
|
||||||
* Load VCard information for a given user. XMPPConnection should be authenticated and not anonymous.
|
* Load VCard information for a given user. XMPPConnection should be authenticated and not anonymous.
|
||||||
*
|
*
|
||||||
* @param connection connection.
|
* @param connection connection.
|
||||||
* @param user user whos information we want to load.
|
* @param user user whose information we want to load.
|
||||||
*
|
*
|
||||||
* @throws XMPPErrorException if there was an XMPP error returned.
|
* @throws XMPPErrorException if there was an XMPP error returned.
|
||||||
* @throws NoResponseException if there was no response from the server.
|
* @throws NoResponseException if there was no response from the server.
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class BooleanFormField extends SingleValueFormField {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the value of the booelan field. Note that, if no explicit boolean value is provided, in the form of "true",
|
* Get the value of the boolean field. Note that, if no explicit boolean value is provided, in the form of "true",
|
||||||
* "false", "0", or "1", then the default value of a boolean field is <code>false</code>, according to
|
* "false", "0", or "1", then the default value of a boolean field is <code>false</code>, according to
|
||||||
* XEP-0004 § 3.3.
|
* XEP-0004 § 3.3.
|
||||||
*
|
*
|
||||||
|
|
|
@ -152,7 +152,7 @@
|
||||||
* Before you start to send XHTML messages to a user you should discover if the user supports XHTML messages. There are
|
* Before you start to send XHTML messages to a user you should discover if the user supports XHTML messages. There are
|
||||||
* two ways to achieve the discovery, explicitly and implicitly. Explicit is when you first try to discover if the user
|
* two ways to achieve the discovery, explicitly and implicitly. Explicit is when you first try to discover if the user
|
||||||
* supports XHTML before sending any XHTML message. Implicit is when you send XHTML messages without first discovering
|
* supports XHTML before sending any XHTML message. Implicit is when you send XHTML messages without first discovering
|
||||||
* if the conversation partner's client supports XHTML and depenging on the answer (normal message or XHTML message) you
|
* if the conversation partner's client supports XHTML and depending on the answer (normal message or XHTML message) you
|
||||||
* find out if the user supports XHTML messages or not. This section explains how to explicitly discover for XHTML
|
* find out if the user supports XHTML messages or not. This section explains how to explicitly discover for XHTML
|
||||||
* support.
|
* support.
|
||||||
* </p>
|
* </p>
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class Chat {
|
||||||
/**
|
/**
|
||||||
* Returns the name of the user the chat is with.
|
* Returns the name of the user the chat is with.
|
||||||
*
|
*
|
||||||
* @return the name of the user the chat is occuring with.
|
* @return the name of the user the chat is occurring with.
|
||||||
*/
|
*/
|
||||||
public EntityJid getParticipant() {
|
public EntityJid getParticipant() {
|
||||||
return participant;
|
return participant;
|
||||||
|
|
|
@ -118,8 +118,8 @@ import org.jxmpp.util.cache.LruCache;
|
||||||
* Every entry in the roster has presence associated with it. The
|
* Every entry in the roster has presence associated with it. The
|
||||||
* {@link #getPresence(BareJid)} method will return a Presence object with the
|
* {@link #getPresence(BareJid)} method will return a Presence object with the
|
||||||
* user's presence or `null` if the user is not online or you are not subscribed
|
* user's presence or `null` if the user is not online or you are not subscribed
|
||||||
* to the user's presence. _Note:_ Presence subscription is nnot tied to the
|
* to the user's presence. _Note:_ Presence subscription is not tied to the
|
||||||
* user being on the roster, and vice versa: You could be subscriped to a remote
|
* user being on the roster, and vice versa: You could be subscribed to a remote
|
||||||
* users presence without the user in your roster, and a remote user can be in
|
* users presence without the user in your roster, and a remote user can be in
|
||||||
* your roster without any presence subscription relation.
|
* your roster without any presence subscription relation.
|
||||||
* </p>
|
* </p>
|
||||||
|
@ -242,13 +242,13 @@ public final class Roster extends Manager {
|
||||||
private static boolean rosterLoadedAtLoginDefault = true;
|
private static boolean rosterLoadedAtLoginDefault = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default subscription processing mode to use when a Roster is created. By default
|
* The default subscription processing mode to use when a Roster is created. By default,
|
||||||
* all subscription requests are automatically rejected.
|
* all subscription requests are automatically rejected.
|
||||||
*/
|
*/
|
||||||
private static SubscriptionMode defaultSubscriptionMode = SubscriptionMode.reject_all;
|
private static SubscriptionMode defaultSubscriptionMode = SubscriptionMode.reject_all;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The initial maximum size of the map holding presence information of entities without an Roster entry. Currently
|
* The initial maximum size of the map holding presence information of entities without a Roster entry. Currently
|
||||||
* {@value #INITIAL_DEFAULT_NON_ROSTER_PRESENCE_MAP_SIZE}.
|
* {@value #INITIAL_DEFAULT_NON_ROSTER_PRESENCE_MAP_SIZE}.
|
||||||
*/
|
*/
|
||||||
public static final int INITIAL_DEFAULT_NON_ROSTER_PRESENCE_MAP_SIZE = 1024;
|
public static final int INITIAL_DEFAULT_NON_ROSTER_PRESENCE_MAP_SIZE = 1024;
|
||||||
|
@ -285,7 +285,7 @@ public final class Roster extends Manager {
|
||||||
private final Map<BareJid, Map<Resourcepart, Presence>> presenceMap = new ConcurrentHashMap<>();
|
private final Map<BareJid, Map<Resourcepart, Presence>> presenceMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Like {@link presenceMap} but for presences of entities not in our Roster.
|
* Like {@link #presenceMap} but for presences of entities not in our Roster.
|
||||||
*/
|
*/
|
||||||
// TODO Ideally we want here to use a LRU cache like Map which will evict all superfluous items
|
// TODO Ideally we want here to use a LRU cache like Map which will evict all superfluous items
|
||||||
// if their maximum size is lowered below the current item count. LruCache does not provide
|
// if their maximum size is lowered below the current item count. LruCache does not provide
|
||||||
|
@ -299,7 +299,7 @@ public final class Roster extends Manager {
|
||||||
private final Set<RosterLoadedListener> rosterLoadedListeners = new LinkedHashSet<>();
|
private final Set<RosterLoadedListener> rosterLoadedListeners = new LinkedHashSet<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mutually exclude roster listener invocation and changing the {@link entries} map. Also used
|
* Mutually exclude roster listener invocation and changing the {@link #entries} map. Also used
|
||||||
* to synchronize access to either the roster listeners or the entries map.
|
* to synchronize access to either the roster listeners or the entries map.
|
||||||
*/
|
*/
|
||||||
private final Object rosterListenersAndEntriesLock = new Object();
|
private final Object rosterListenersAndEntriesLock = new Object();
|
||||||
|
@ -439,7 +439,7 @@ public final class Roster extends Manager {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that all available presences received so far in a eventually existing previous session are
|
// Ensure that all available presences received so far in an eventually existing previous session are
|
||||||
// marked 'offline'.
|
// marked 'offline'.
|
||||||
setOfflinePresencesAndResetLoaded();
|
setOfflinePresencesAndResetLoaded();
|
||||||
|
|
||||||
|
@ -760,7 +760,7 @@ public final class Roster extends Manager {
|
||||||
*
|
*
|
||||||
* @param user the user. (e.g. johndoe@jabber.org)
|
* @param user the user. (e.g. johndoe@jabber.org)
|
||||||
* @param name the nickname of the user.
|
* @param name the nickname of the user.
|
||||||
* @param groups the list of group names the entry will belong to, or <code>null</code> if the
|
* @param groups the list of group names the entry will belong to, or <code>null</code> if
|
||||||
* the roster entry won't belong to a group.
|
* the roster entry won't belong to a group.
|
||||||
* @throws NoResponseException if there was no response from the server.
|
* @throws NoResponseException if there was no response from the server.
|
||||||
* @throws XMPPErrorException if an XMPP exception occurs.
|
* @throws XMPPErrorException if an XMPP exception occurs.
|
||||||
|
@ -818,7 +818,7 @@ public final class Roster extends Manager {
|
||||||
*
|
*
|
||||||
* @param jid the XMPP address of the contact (e.g. johndoe@jabber.org)
|
* @param jid the XMPP address of the contact (e.g. johndoe@jabber.org)
|
||||||
* @param name the nickname of the user.
|
* @param name the nickname of the user.
|
||||||
* @param groups the list of group names the entry will belong to, or <code>null</code> if the
|
* @param groups the list of group names the entry will belong to, or <code>null</code> if
|
||||||
* the roster entry won't belong to a group.
|
* the roster entry won't belong to a group.
|
||||||
* @throws NoResponseException if there was no response from the server.
|
* @throws NoResponseException if there was no response from the server.
|
||||||
* @throws XMPPErrorException if an XMPP exception occurs.
|
* @throws XMPPErrorException if an XMPP exception occurs.
|
||||||
|
@ -839,7 +839,7 @@ public final class Roster extends Manager {
|
||||||
*
|
*
|
||||||
* @param user the user. (e.g. johndoe@jabber.org)
|
* @param user the user. (e.g. johndoe@jabber.org)
|
||||||
* @param name the nickname of the user.
|
* @param name the nickname of the user.
|
||||||
* @param groups the list of group names the entry will belong to, or <code>null</code> if the
|
* @param groups the list of group names the entry will belong to, or <code>null</code> if
|
||||||
* the roster entry won't belong to a group.
|
* the roster entry won't belong to a group.
|
||||||
* @throws NoResponseException if there was no response from the server.
|
* @throws NoResponseException if there was no response from the server.
|
||||||
* @throws XMPPErrorException if an XMPP exception occurs.
|
* @throws XMPPErrorException if an XMPP exception occurs.
|
||||||
|
@ -1042,7 +1042,7 @@ public final class Roster extends Manager {
|
||||||
* Returns the roster entry associated with the given XMPP address or
|
* Returns the roster entry associated with the given XMPP address or
|
||||||
* <code>null</code> if the user is not an entry in the roster.
|
* <code>null</code> if the user is not an entry in the roster.
|
||||||
*
|
*
|
||||||
* @param jid the XMPP address of the user (eg "jsmith@example.com"). The address could be
|
* @param jid the XMPP address of the user (e.g."jsmith@example.com"). The address could be
|
||||||
* in any valid format (e.g. "domain/resource", "user@domain" or "user@domain/resource").
|
* in any valid format (e.g. "domain/resource", "user@domain" or "user@domain/resource").
|
||||||
* @return the roster entry or <code>null</code> if it does not exist.
|
* @return the roster entry or <code>null</code> if it does not exist.
|
||||||
*/
|
*/
|
||||||
|
@ -1056,7 +1056,7 @@ public final class Roster extends Manager {
|
||||||
/**
|
/**
|
||||||
* Returns true if the specified XMPP address is an entry in the roster.
|
* Returns true if the specified XMPP address is an entry in the roster.
|
||||||
*
|
*
|
||||||
* @param jid the XMPP address of the user (eg "jsmith@example.com"). The
|
* @param jid the XMPP address of the user (e.g."jsmith@example.com"). The
|
||||||
* address must be a bare JID e.g. "domain/resource" or
|
* address must be a bare JID e.g. "domain/resource" or
|
||||||
* "user@domain".
|
* "user@domain".
|
||||||
* @return true if the XMPP address is an entry in the roster.
|
* @return true if the XMPP address is an entry in the roster.
|
||||||
|
@ -1118,11 +1118,11 @@ public final class Roster extends Manager {
|
||||||
* {@link RosterListener}.
|
* {@link RosterListener}.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param jid the XMPP address of the user (eg "jsmith@example.com"). The
|
* @param jid the XMPP address of the user (e.g."jsmith@example.com"). The
|
||||||
* address must be a bare JID e.g. "domain/resource" or
|
* address must be a bare JID e.g. "domain/resource" or
|
||||||
* "user@domain".
|
* "user@domain".
|
||||||
* @return the user's current presence, or unavailable presence if the user is offline
|
* @return the user's current presence, or unavailable presence if the user is offline
|
||||||
* or if no presence information is available..
|
* or if no presence information is available.
|
||||||
*/
|
*/
|
||||||
public Presence getPresence(BareJid jid) {
|
public Presence getPresence(BareJid jid) {
|
||||||
Map<Resourcepart, Presence> userPresences = getPresencesInternal(jid);
|
Map<Resourcepart, Presence> userPresences = getPresencesInternal(jid);
|
||||||
|
|
|
@ -108,7 +108,7 @@ public final class RosterEntry extends Manager {
|
||||||
packet.setType(IQ.Type.set);
|
packet.setType(IQ.Type.set);
|
||||||
|
|
||||||
// Create a new roster item with the current RosterEntry and the *new* name. Note that we can't set the name of
|
// Create a new roster item with the current RosterEntry and the *new* name. Note that we can't set the name of
|
||||||
// RosterEntry right away, as otherwise the updated event wont get fired, because equalsDeep would return true.
|
// RosterEntry right away, as otherwise the updated event won't get fired, because equalsDeep would return true.
|
||||||
packet.addRosterItem(toRosterItem(this, name));
|
packet.addRosterItem(toRosterItem(this, name));
|
||||||
connection().sendIqRequestAndWaitForResponse(packet);
|
connection().sendIqRequestAndWaitForResponse(packet);
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ public final class RosterEntry extends Manager {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an copied list of the roster groups that this entry belongs to.
|
* Returns a copied list of the roster groups that this entry belongs to.
|
||||||
*
|
*
|
||||||
* @return an iterator for the groups this entry belongs to.
|
* @return an iterator for the groups this entry belongs to.
|
||||||
*/
|
*/
|
||||||
|
@ -306,7 +306,7 @@ public final class RosterEntry extends Manager {
|
||||||
*
|
*
|
||||||
* @param entry the roster entry.
|
* @param entry the roster entry.
|
||||||
* @param name the name of the roster item.
|
* @param name the name of the roster item.
|
||||||
* @param includeAskAttribute whether or not to include the 'ask' attribute.
|
* @param includeAskAttribute whether to include the 'ask' attribute.
|
||||||
* @return the roster item.
|
* @return the roster item.
|
||||||
*/
|
*/
|
||||||
private static RosterPacket.Item toRosterItem(RosterEntry entry, String name, boolean includeAskAttribute) {
|
private static RosterPacket.Item toRosterItem(RosterEntry entry, String name, boolean includeAskAttribute) {
|
||||||
|
|
|
@ -116,7 +116,7 @@ public class RosterGroup extends Manager {
|
||||||
* Returns the roster entry associated with the given XMPP address or
|
* Returns the roster entry associated with the given XMPP address or
|
||||||
* <code>null</code> if the user is not an entry in the group.
|
* <code>null</code> if the user is not an entry in the group.
|
||||||
*
|
*
|
||||||
* @param user the XMPP address of the user (eg "jsmith@example.com").
|
* @param user the XMPP address of the user (e.g."jsmith@example.com").
|
||||||
* @return the roster entry or <code>null</code> if it does not exist in the group.
|
* @return the roster entry or <code>null</code> if it does not exist in the group.
|
||||||
*/
|
*/
|
||||||
public RosterEntry getEntry(Jid user) {
|
public RosterEntry getEntry(Jid user) {
|
||||||
|
|
|
@ -100,8 +100,8 @@ public class XmppConnectionStressTest {
|
||||||
|
|
||||||
for (int c = 0; c < payloadChunkCount; c++) {
|
for (int c = 0; c < payloadChunkCount; c++) {
|
||||||
int payloadChunkSize = random.nextInt(configuration.maxPayloadChunkSize) + 1;
|
int payloadChunkSize = random.nextInt(configuration.maxPayloadChunkSize) + 1;
|
||||||
String payloadCunk = StringUtils.randomString(payloadChunkSize, random);
|
String payloadChunk = StringUtils.randomString(payloadChunkSize, random);
|
||||||
JivePropertiesManager.addProperty(messageBuilder, "payload-chunk-" + c, payloadCunk);
|
JivePropertiesManager.addProperty(messageBuilder, "payload-chunk-" + c, payloadChunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
JivePropertiesManager.addProperty(messageBuilder, MESSAGE_NUMBER_PROPERTY, i);
|
JivePropertiesManager.addProperty(messageBuilder, MESSAGE_NUMBER_PROPERTY, i);
|
||||||
|
@ -184,7 +184,7 @@ public class XmppConnectionStressTest {
|
||||||
Exception exception = new Exception(exceptionMessage.toString());
|
Exception exception = new Exception(exceptionMessage.toString());
|
||||||
receiveExceptions.put(connection, exception);
|
receiveExceptions.put(connection, exception);
|
||||||
// TODO: Current Smack design does not guarantee that the listener won't be invoked again.
|
// TODO: Current Smack design does not guarantee that the listener won't be invoked again.
|
||||||
// This is because the decission to invoke a sync listeners is done at a different place
|
// This is because the decision to invoke a sync listeners is done at a different place
|
||||||
// then invoking the listener.
|
// then invoking the listener.
|
||||||
connection.removeSyncStanzaListener(this);
|
connection.removeSyncStanzaListener(this);
|
||||||
receivedSemaphore.release();
|
receivedSemaphore.release();
|
||||||
|
@ -338,7 +338,7 @@ public class XmppConnectionStressTest {
|
||||||
sb.append("Exceptions while sending and/or receiving.");
|
sb.append("Exceptions while sending and/or receiving.");
|
||||||
|
|
||||||
if (!sendExceptions.isEmpty()) {
|
if (!sendExceptions.isEmpty()) {
|
||||||
sb.append(" Send exxceptions: ");
|
sb.append(" Send exceptions: ");
|
||||||
for (Map.Entry<XMPPConnection, Exception> entry : sendExceptions.entrySet()) {
|
for (Map.Entry<XMPPConnection, Exception> entry : sendExceptions.entrySet()) {
|
||||||
sb.append(entry.getKey()).append(": ").append(entry.getValue()).append(';');
|
sb.append(entry.getKey()).append(": ").append(entry.getValue()).append(';');
|
||||||
}
|
}
|
||||||
|
|
|
@ -432,7 +432,7 @@ public class SmackIntegrationTestFramework {
|
||||||
final Class<?>[] parameterTypes = method.getParameterTypes();
|
final Class<?>[] parameterTypes = method.getParameterTypes();
|
||||||
if (parameterTypes.length > 0) {
|
if (parameterTypes.length > 0) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"SmackIntegrationTest annotaton on " + method + " that takes arguments ");
|
"SmackIntegrationTest annotation on " + method + " that takes arguments ");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LowLevel:
|
case LowLevel:
|
||||||
|
|
|
@ -155,7 +155,7 @@ public final class XmppConnectionDescriptor<
|
||||||
|
|
||||||
return XmppConnectionDescriptor.buildWith(ModularXmppClientToServerConnection.class, ModularXmppClientToServerConnectionConfiguration.class, ModularXmppClientToServerConnectionConfiguration.Builder.class)
|
return XmppConnectionDescriptor.buildWith(ModularXmppClientToServerConnection.class, ModularXmppClientToServerConnectionConfiguration.class, ModularXmppClientToServerConnectionConfiguration.Builder.class)
|
||||||
.withNickname(nickname)
|
.withNickname(nickname)
|
||||||
.applyExtraConfguration(cb -> {
|
.applyExtraConfiguration(cb -> {
|
||||||
cb.removeAllModules();
|
cb.removeAllModules();
|
||||||
ModularXmppClientToServerConnectionModuleDescriptor webSocketModuleDescriptor =
|
ModularXmppClientToServerConnectionModuleDescriptor webSocketModuleDescriptor =
|
||||||
XmppWebSocketTransportModuleDescriptor.getBuilder(cb)
|
XmppWebSocketTransportModuleDescriptor.getBuilder(cb)
|
||||||
|
@ -184,7 +184,13 @@ public final class XmppConnectionDescriptor<
|
||||||
nickname = connectionClass.getSimpleName();
|
nickname = connectionClass.getSimpleName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO Remove in Smack 4.6
|
||||||
|
@Deprecated // Replaced by applyExtraConfiguration(Consumer<CCB> extraBuilder)
|
||||||
public Builder<C, CC, CCB> applyExtraConfguration(Consumer<CCB> extraBuilder) {
|
public Builder<C, CC, CCB> applyExtraConfguration(Consumer<CCB> extraBuilder) {
|
||||||
|
return applyExtraConfiguration(extraBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder<C, CC, CCB> applyExtraConfiguration(Consumer<CCB> extraBuilder) {
|
||||||
this.extraBuilder = extraBuilder;
|
this.extraBuilder = extraBuilder;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ public class XmppConnectionManager {
|
||||||
addConnectionDescriptor(
|
addConnectionDescriptor(
|
||||||
XmppConnectionDescriptor.buildWith(ModularXmppClientToServerConnection.class, ModularXmppClientToServerConnectionConfiguration.class, ModularXmppClientToServerConnectionConfiguration.Builder.class)
|
XmppConnectionDescriptor.buildWith(ModularXmppClientToServerConnection.class, ModularXmppClientToServerConnectionConfiguration.class, ModularXmppClientToServerConnectionConfiguration.Builder.class)
|
||||||
.withNickname("modular-nocompress")
|
.withNickname("modular-nocompress")
|
||||||
.applyExtraConfguration(cb -> cb.removeModule(CompressionModuleDescriptor.class))
|
.applyExtraConfiguration(cb -> cb.removeModule(CompressionModuleDescriptor.class))
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
addConnectionDescriptor(
|
addConnectionDescriptor(
|
||||||
|
|
|
@ -145,7 +145,7 @@
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td>disabledSpecifications</td>
|
* <td>disabledSpecifications</td>
|
||||||
* <td>List of specificatinos for which to disable tests</td>
|
* <td>List of specifications for which to disable tests</td>
|
||||||
* </tr>
|
* </tr>
|
||||||
* <tr>
|
* <tr>
|
||||||
* <td>defaultConnection</td>
|
* <td>defaultConnection</td>
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class LoginIntegrationTest extends AbstractSmackLowLevelIntegrationTest {
|
||||||
* @throws IOException if an I/O error occurred.
|
* @throws IOException if an I/O error occurred.
|
||||||
* @throws SmackException if Smack detected an exceptional situation.
|
* @throws SmackException if Smack detected an exceptional situation.
|
||||||
* @throws NoSuchAlgorithmException if no such algorithm is available.
|
* @throws NoSuchAlgorithmException if no such algorithm is available.
|
||||||
* @throws KeyManagementException if there was a key mangement error.
|
* @throws KeyManagementException if there was a key management error.
|
||||||
*/
|
*/
|
||||||
@SmackIntegrationTest
|
@SmackIntegrationTest
|
||||||
public void testInvalidLogin(UnconnectedConnectionSource unconnectedConnectionSource) throws SmackException, IOException, XMPPException,
|
public void testInvalidLogin(UnconnectedConnectionSource unconnectedConnectionSource) throws SmackException, IOException, XMPPException,
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue