mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-25 13:32:07 +01:00
Compare commits
No commits in common. "44ad01a3467719566c8a3d12736ca60ec6bf1d1b" and "01cd0507b6ca1473a3ec3d30bd56dfbd6bb19e55" have entirely different histories.
44ad01a346
...
01cd0507b6
108 changed files with 330 additions and 768 deletions
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
|
@ -1,5 +1,8 @@
|
||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
|
env:
|
||||||
|
GRADLE_VERSION: 6.7.1
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -38,6 +41,12 @@ jobs:
|
||||||
key: gradle-caches-${{ hashFiles('**/build.gradle') }}
|
key: gradle-caches-${{ hashFiles('**/build.gradle') }}
|
||||||
restore-keys:
|
restore-keys:
|
||||||
gradle-caches
|
gradle-caches
|
||||||
|
- name: Cache Gradle Binary
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/gradle-bin-${GRADLE_VERSION}/
|
||||||
|
key: gradle-bin-${GRADLE_VERSION}
|
||||||
- name: Cache Android SDK
|
- name: Cache Android SDK
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
|
@ -48,6 +57,11 @@ jobs:
|
||||||
android-
|
android-
|
||||||
|
|
||||||
# Pre-reqs
|
# Pre-reqs
|
||||||
|
- name: Grab gradle wrapper
|
||||||
|
run: |
|
||||||
|
wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-all.zip
|
||||||
|
unzip gradle-${GRADLE_VERSION}-all.zip
|
||||||
|
echo "PATH_TO_GRADLE=./gradle-${GRADLE_VERSION}/bin/gradle" >> $GITHUB_ENV
|
||||||
- name: Install GraphViz
|
- name: Install GraphViz
|
||||||
run: sudo apt update && sudo apt install graphviz
|
run: sudo apt update && sudo apt install graphviz
|
||||||
- name: Install Android SDK Manager
|
- name: Install Android SDK Manager
|
||||||
|
@ -58,21 +72,21 @@ jobs:
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
- name: Gradle Check
|
- name: Gradle Check
|
||||||
run: ./gradlew check --stacktrace
|
run: ${PATH_TO_GRADLE} check --stacktrace
|
||||||
|
|
||||||
# Test local publish
|
# Test local publish
|
||||||
- name: Gradle publish
|
- name: Gradle publish
|
||||||
run: ./gradlew publishToMavenLocal --stacktrace
|
run: ${PATH_TO_GRADLE} publishToMavenLocal --stacktrace
|
||||||
|
|
||||||
# Javadoc
|
# Javadoc
|
||||||
- name: Javadoc
|
- name: Javadoc
|
||||||
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
|
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
|
||||||
run: ./gradlew javadocAll --stacktrace
|
run: ${PATH_TO_GRADLE} javadocAll --stacktrace
|
||||||
|
|
||||||
# Test Coverage Report
|
# Test Coverage Report
|
||||||
- name: Jacoco Test Coverage
|
- name: Jacoco Test Coverage
|
||||||
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
|
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
|
||||||
run: ./gradlew jacocoRootReport coveralls
|
run: ${PATH_TO_GRADLE} jacocoRootReport coveralls
|
||||||
env:
|
env:
|
||||||
COVERALLS_REPO_TOKEN: S2ecSJja2cKJa9yv45C8ZFPohXuRrTXKd
|
COVERALLS_REPO_TOKEN: S2ecSJja2cKJa9yv45C8ZFPohXuRrTXKd
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,7 @@ allprojects {
|
||||||
smackMinAndroidSdk = 19
|
smackMinAndroidSdk = 19
|
||||||
junitVersion = '5.7.1'
|
junitVersion = '5.7.1'
|
||||||
commonsIoVersion = '2.6'
|
commonsIoVersion = '2.6'
|
||||||
bouncyCastleVersion = '1.70'
|
bouncyCastleVersion = '1.69'
|
||||||
guavaVersion = '30.1-jre'
|
guavaVersion = '30.1-jre'
|
||||||
mockitoVersion = '3.7.7'
|
mockitoVersion = '3.7.7'
|
||||||
orgReflectionsVersion = '0.9.11'
|
orgReflectionsVersion = '0.9.11'
|
||||||
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
5
gradle/wrapper/gradle-wrapper.properties
vendored
5
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,5 +0,0 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
|
||||||
distributionPath=wrapper/dists
|
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
|
||||||
zipStorePath=wrapper/dists
|
|
185
gradlew
vendored
185
gradlew
vendored
|
@ -1,185 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
#
|
|
||||||
# Copyright 2015 the original author or authors.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
##
|
|
||||||
## Gradle start up script for UN*X
|
|
||||||
##
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
|
||||||
# Resolve links: $0 may be a link
|
|
||||||
PRG="$0"
|
|
||||||
# Need this for relative symlinks.
|
|
||||||
while [ -h "$PRG" ] ; do
|
|
||||||
ls=`ls -ld "$PRG"`
|
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
|
||||||
PRG="$link"
|
|
||||||
else
|
|
||||||
PRG=`dirname "$PRG"`"/$link"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
SAVED="`pwd`"
|
|
||||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
||||||
APP_HOME="`pwd -P`"
|
|
||||||
cd "$SAVED" >/dev/null
|
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=`basename "$0"`
|
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
||||||
MAX_FD="maximum"
|
|
||||||
|
|
||||||
warn () {
|
|
||||||
echo "$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
die () {
|
|
||||||
echo
|
|
||||||
echo "$*"
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
|
||||||
cygwin=false
|
|
||||||
msys=false
|
|
||||||
darwin=false
|
|
||||||
nonstop=false
|
|
||||||
case "`uname`" in
|
|
||||||
CYGWIN* )
|
|
||||||
cygwin=true
|
|
||||||
;;
|
|
||||||
Darwin* )
|
|
||||||
darwin=true
|
|
||||||
;;
|
|
||||||
MINGW* )
|
|
||||||
msys=true
|
|
||||||
;;
|
|
||||||
NONSTOP* )
|
|
||||||
nonstop=true
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
||||||
# IBM's JDK on AIX uses strange locations for the executables
|
|
||||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
|
||||||
else
|
|
||||||
JAVACMD="$JAVA_HOME/bin/java"
|
|
||||||
fi
|
|
||||||
if [ ! -x "$JAVACMD" ] ; then
|
|
||||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
location of your Java installation."
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
JAVACMD="java"
|
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
location of your Java installation."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
|
||||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
|
||||||
MAX_FD_LIMIT=`ulimit -H -n`
|
|
||||||
if [ $? -eq 0 ] ; then
|
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
|
||||||
MAX_FD="$MAX_FD_LIMIT"
|
|
||||||
fi
|
|
||||||
ulimit -n $MAX_FD
|
|
||||||
if [ $? -ne 0 ] ; then
|
|
||||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Darwin, add options to specify how the application appears in the dock
|
|
||||||
if $darwin; then
|
|
||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
||||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
||||||
|
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
||||||
SEP=""
|
|
||||||
for dir in $ROOTDIRSRAW ; do
|
|
||||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
||||||
SEP="|"
|
|
||||||
done
|
|
||||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
||||||
# Add a user-defined pattern to the cygpath arguments
|
|
||||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
||||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
||||||
fi
|
|
||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
||||||
i=0
|
|
||||||
for arg in "$@" ; do
|
|
||||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
||||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
||||||
|
|
||||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
||||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
||||||
else
|
|
||||||
eval `echo args$i`="\"$arg\""
|
|
||||||
fi
|
|
||||||
i=`expr $i + 1`
|
|
||||||
done
|
|
||||||
case $i in
|
|
||||||
0) set -- ;;
|
|
||||||
1) set -- "$args0" ;;
|
|
||||||
2) set -- "$args0" "$args1" ;;
|
|
||||||
3) set -- "$args0" "$args1" "$args2" ;;
|
|
||||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
||||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
||||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
||||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
||||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
||||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Escape application args
|
|
||||||
save () {
|
|
||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
|
||||||
echo " "
|
|
||||||
}
|
|
||||||
APP_ARGS=`save "$@"`
|
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
|
89
gradlew.bat
vendored
89
gradlew.bat
vendored
|
@ -1,89 +0,0 @@
|
||||||
@rem
|
|
||||||
@rem Copyright 2015 the original author or authors.
|
|
||||||
@rem
|
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
@rem you may not use this file except in compliance with the License.
|
|
||||||
@rem You may obtain a copy of the License at
|
|
||||||
@rem
|
|
||||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
@rem
|
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
@rem See the License for the specific language governing permissions and
|
|
||||||
@rem limitations under the License.
|
|
||||||
@rem
|
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
|
||||||
@rem ##########################################################################
|
|
||||||
@rem
|
|
||||||
@rem Gradle startup script for Windows
|
|
||||||
@rem
|
|
||||||
@rem ##########################################################################
|
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
|
||||||
set APP_BASE_NAME=%~n0
|
|
||||||
set APP_HOME=%DIRNAME%
|
|
||||||
|
|
||||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
|
||||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
|
||||||
|
|
||||||
@rem Find java.exe
|
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
|
||||||
if "%ERRORLEVEL%" == "0" goto execute
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:execute
|
|
||||||
@rem Setup the command line
|
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
|
||||||
|
|
||||||
:end
|
|
||||||
@rem End local scope for the variables with windows NT shell
|
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
|
||||||
|
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:mainEnd
|
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
|
||||||
:omega
|
|
|
@ -77,8 +77,7 @@ public final class BOSHConfiguration extends ConnectionConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
public URI getURI() throws URISyntaxException {
|
public URI getURI() throws URISyntaxException {
|
||||||
String uri = (https ? "https://" : "http://") + getHostString() + ":" + this.port + file;
|
return new URI((https ? "https://" : "http://") + this.host + ":" + this.port + file);
|
||||||
return new URI(uri);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, String> getHttpHeaders() {
|
public Map<String, String> getHttpHeaders() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2009 Jive Software, 2018-2022 Florian Schmaus.
|
* Copyright 2009 Jive Software, 2018-2021 Florian Schmaus.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -694,10 +694,10 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We use an extra object for {@link #notifyWaitingThreads()} and {@link #waitFor(Supplier)}, because all state
|
* We use an extra object for {@link #notifyWaitingThreads()} and {@link #waitForConditionOrConnectionException(Supplier)}, because all state
|
||||||
* changing methods of the connection are synchronized using the connection instance as monitor. If we now would
|
* changing methods of the connection are synchronized using the connection instance as monitor. If we now would
|
||||||
* also use the connection instance for the internal process to wait for a condition, the {@link Object#wait()}
|
* also use the connection instance for the internal process to wait for a condition, the {@link Object#wait()}
|
||||||
* would leave the monitor when it waits, which would allow for another potential call to a state changing function
|
* would leave the monitor when it waites, which would allow for another potential call to a state changing function
|
||||||
* to proceed.
|
* to proceed.
|
||||||
*/
|
*/
|
||||||
private final Object internalMonitor = new Object();
|
private final Object internalMonitor = new Object();
|
||||||
|
@ -722,18 +722,22 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void waitForConditionOrThrowConnectionException(Supplier<Boolean> condition, String waitFor) throws InterruptedException, SmackException, XMPPException {
|
protected final boolean waitForConditionOrConnectionException(Supplier<Boolean> condition) throws InterruptedException {
|
||||||
boolean success = waitFor(() -> condition.get().booleanValue() || hasCurrentConnectionException());
|
return waitFor(() -> condition.get().booleanValue() || hasCurrentConnectionException());
|
||||||
if (hasCurrentConnectionException()) {
|
}
|
||||||
throwCurrentConnectionException();
|
|
||||||
}
|
|
||||||
|
|
||||||
// If there was no connection exception and we still did not successfully wait for the condition to hold, then
|
protected final void waitForConditionOrConnectionException(Supplier<Boolean> condition, String waitFor) throws InterruptedException, NoResponseException {
|
||||||
// we ran into a no-response timeout.
|
boolean success = waitForConditionOrConnectionException(condition);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
throw NoResponseException.newWith(this, waitFor);
|
throw NoResponseException.newWith(this, waitFor);
|
||||||
}
|
}
|
||||||
// Otherwise we successfully awaited the condition.
|
}
|
||||||
|
|
||||||
|
protected final void waitForConditionOrThrowConnectionException(Supplier<Boolean> condition, String waitFor) throws InterruptedException, SmackException, XMPPException {
|
||||||
|
waitForConditionOrConnectionException(condition, waitFor);
|
||||||
|
if (hasCurrentConnectionException()) {
|
||||||
|
throwCurrentConnectionException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Resourcepart bindResourceAndEstablishSession(Resourcepart resource)
|
protected Resourcepart bindResourceAndEstablishSession(Resourcepart resource)
|
||||||
|
@ -2006,18 +2010,11 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
||||||
}, timeout, TimeUnit.MILLISECONDS);
|
}, timeout, TimeUnit.MILLISECONDS);
|
||||||
|
|
||||||
addAsyncStanzaListener(stanzaListener, replyFilter);
|
addAsyncStanzaListener(stanzaListener, replyFilter);
|
||||||
Runnable sendOperation = () -> {
|
try {
|
||||||
try {
|
sendStanza(stanza);
|
||||||
sendStanza(stanza);
|
}
|
||||||
}
|
catch (NotConnectedException | InterruptedException exception) {
|
||||||
catch (NotConnectedException | InterruptedException exception) {
|
future.setException(exception);
|
||||||
future.setException(exception);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if (SmackConfiguration.TRUELY_ASYNC_SENDS) {
|
|
||||||
Async.go(sendOperation);
|
|
||||||
} else {
|
|
||||||
sendOperation.run();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return future;
|
return future;
|
||||||
|
|
|
@ -302,16 +302,6 @@ public abstract class ConnectionConfiguration {
|
||||||
return new SmackTlsContext(context, daneVerifier);
|
return new SmackTlsContext(context, daneVerifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHostString() {
|
|
||||||
if (hostAddress != null) {
|
|
||||||
return hostAddress.toString();
|
|
||||||
}
|
|
||||||
if (host != null) {
|
|
||||||
return host.toString();
|
|
||||||
}
|
|
||||||
return xmppServiceDomain.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DnsName getHost() {
|
public DnsName getHost() {
|
||||||
return host;
|
return host;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2003-2007 Jive Software, 2018-2022 Florian Schmaus.
|
* Copyright 2003-2007 Jive Software, 2018-2021 Florian Schmaus.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -386,14 +386,4 @@ public final class SmackConfiguration {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* If enabled, causes {@link AbstractXMPPConnection} to create a thread for every asynchronous send operation. This
|
|
||||||
* is meant to work-around a shortcoming of Smack 4.4, where certain send operations are not asynchronous even if
|
|
||||||
* they should be. This is an expert setting, do not toggle if you do not understand the consequences or have been
|
|
||||||
* told to do so. Note that it is expected that this will not be needed in future Smack versions.
|
|
||||||
*
|
|
||||||
* @since 4.4.6
|
|
||||||
*/
|
|
||||||
public static boolean TRUELY_ASYNC_SENDS = false;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ package org.jivesoftware.smack.provider;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.Bind;
|
import org.jivesoftware.smack.packet.Bind;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -28,10 +27,10 @@ import org.jxmpp.jid.EntityFullJid;
|
||||||
import org.jxmpp.jid.impl.JidCreate;
|
import org.jxmpp.jid.impl.JidCreate;
|
||||||
import org.jxmpp.jid.parts.Resourcepart;
|
import org.jxmpp.jid.parts.Resourcepart;
|
||||||
|
|
||||||
public class BindIQProvider extends IqProvider<Bind> {
|
public class BindIQProvider extends IQProvider<Bind> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Bind parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public Bind parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
String name;
|
String name;
|
||||||
Bind bind = null;
|
Bind bind = null;
|
||||||
outerloop: while (true) {
|
outerloop: while (true) {
|
||||||
|
|
|
@ -37,11 +37,8 @@ import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
* abstract class <b>must</b> have a public, no-argument constructor.
|
* abstract class <b>must</b> have a public, no-argument constructor.
|
||||||
*
|
*
|
||||||
* @author Matt Tucker
|
* @author Matt Tucker
|
||||||
* @deprecated Use {@link IqProvider} instead
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
public abstract class IQProvider<I extends IQ> extends IqProvider<I> {
|
||||||
// TODO: Remove in Smack 4.6.
|
|
||||||
public abstract class LegacyIQProvider<I extends IQ> extends IqProvider<I> {
|
|
||||||
|
|
||||||
public final I parse(XmlPullParser parser) throws IOException, XmlPullParserException, SmackParsingException {
|
public final I parse(XmlPullParser parser) throws IOException, XmlPullParserException, SmackParsingException {
|
||||||
return parse(parser, (XmlEnvironment) null);
|
return parse(parser, (XmlEnvironment) null);
|
|
@ -28,7 +28,7 @@ import org.jivesoftware.smack.packet.IQ;
|
||||||
public final class IQProviderInfo extends AbstractProviderInfo {
|
public final class IQProviderInfo extends AbstractProviderInfo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines an IQ provider which implements the {@link IqProvider} interface.
|
* Defines an IQ provider which implements the <code>IQProvider</code> interface.
|
||||||
*
|
*
|
||||||
* @param elementName Element that provider parses.
|
* @param elementName Element that provider parses.
|
||||||
* @param namespace Namespace that provider parses.
|
* @param namespace Namespace that provider parses.
|
||||||
|
|
|
@ -21,7 +21,6 @@ import java.lang.reflect.InvocationTargetException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
@ -43,7 +42,7 @@ public class IntrospectionProvider{
|
||||||
*/
|
*/
|
||||||
// TODO: Remove in Smack 4.6.
|
// TODO: Remove in Smack 4.6.
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public abstract static class IQIntrospectionProvider<I extends IQ> extends IqProvider<I> {
|
public abstract static class IQIntrospectionProvider<I extends IQ> extends IQProvider<I> {
|
||||||
private final Class<I> elementClass;
|
private final Class<I> elementClass;
|
||||||
|
|
||||||
protected IQIntrospectionProvider(Class<I> elementClass) {
|
protected IQIntrospectionProvider(Class<I> elementClass) {
|
||||||
|
@ -52,7 +51,7 @@ public class IntrospectionProvider{
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public I parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public I parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
try {
|
try {
|
||||||
return (I) parseWithIntrospection(elementClass, parser, initialDepth);
|
return (I) parseWithIntrospection(elementClass, parser, initialDepth);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,17 +23,9 @@ import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
import org.jivesoftware.smack.packet.IqData;
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
/**
|
|
||||||
* An abstract class for parsing custom {@link IQ} packets. Each IqProvider must be registered with the {@link
|
|
||||||
* ProviderManager} for it to be used. Every implementation of this abstract class <b>must</b> have a public,
|
|
||||||
* no-argument constructor.
|
|
||||||
*
|
|
||||||
* @param <I> the {@link IQ} that is parsed by implementations.
|
|
||||||
*/
|
|
||||||
public abstract class IqProvider<I extends IQ> extends AbstractProvider<I> {
|
public abstract class IqProvider<I extends IQ> extends AbstractProvider<I> {
|
||||||
|
|
||||||
public final I parse(XmlPullParser parser, IqData iqCommon)
|
public final I parse(XmlPullParser parser, IqData iqCommon)
|
||||||
|
@ -48,8 +40,6 @@ public abstract class IqProvider<I extends IQ> extends AbstractProvider<I> {
|
||||||
|
|
||||||
I i = wrapExceptions(() -> parse(parser, initialDepth, iqData, xmlEnvironment));
|
I i = wrapExceptions(() -> parse(parser, initialDepth, iqData, xmlEnvironment));
|
||||||
|
|
||||||
// Parser should be at end tag of the consumed/parsed element
|
|
||||||
ParserUtils.forwardToEndTagOfDepth(parser, initialDepth);
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.jivesoftware.smack.util.PacketParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the {@link IqProvider} and {@link ExtensionElementProvider} information from a standard provider file in preparation
|
* Loads the {@link IQProvider} and {@link ExtensionElementProvider} information from a standard provider file in preparation
|
||||||
* for loading into the {@link ProviderManager}.
|
* for loading into the {@link ProviderManager}.
|
||||||
*
|
*
|
||||||
* @author Robin Collier
|
* @author Robin Collier
|
||||||
|
@ -76,7 +76,7 @@ public class ProviderFileLoader implements ProviderLoader {
|
||||||
switch (typeName) {
|
switch (typeName) {
|
||||||
case "iqProvider":
|
case "iqProvider":
|
||||||
// Attempt to load the provider class and then create
|
// Attempt to load the provider class and then create
|
||||||
// a new instance if it's an IqProvider. Otherwise, if it's
|
// a new instance if it's an IQProvider. Otherwise, if it's
|
||||||
// an IQ class, add the class object itself, then we'll use
|
// an IQ class, add the class object itself, then we'll use
|
||||||
// reflection later to create instances of the class.
|
// reflection later to create instances of the class.
|
||||||
// Add the provider to the map.
|
// Add the provider to the map.
|
||||||
|
@ -85,7 +85,7 @@ public class ProviderFileLoader implements ProviderLoader {
|
||||||
iqProviders.add(new IQProviderInfo(elementName, namespace, iqProvider));
|
iqProviders.add(new IQProviderInfo(elementName, namespace, iqProvider));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
exceptions.add(new IllegalArgumentException(className + " is not a IqProvider"));
|
exceptions.add(new IllegalArgumentException(className + " is not a IQProvider"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "extensionProvider":
|
case "extensionProvider":
|
||||||
|
|
|
@ -34,11 +34,11 @@ import org.jivesoftware.smack.util.XmppElementUtil;
|
||||||
/**
|
/**
|
||||||
* Manages providers for parsing custom XML sub-documents of XMPP packets. Two types of
|
* Manages providers for parsing custom XML sub-documents of XMPP packets. Two types of
|
||||||
* providers exist:<ul>
|
* providers exist:<ul>
|
||||||
* <li>IqProvider -- parses IQ requests into Java objects.
|
* <li>IQProvider -- parses IQ requests into Java objects.
|
||||||
* <li>PacketExtension -- parses XML sub-documents attached to packets into
|
* <li>PacketExtension -- parses XML sub-documents attached to packets into
|
||||||
* PacketExtension instances.</ul>
|
* PacketExtension instances.</ul>
|
||||||
*
|
*
|
||||||
* <b>IqProvider</b><p>
|
* <b>IQProvider</b><p>
|
||||||
*
|
*
|
||||||
* By default, Smack only knows how to process IQ packets with sub-packets that
|
* By default, Smack only knows how to process IQ packets with sub-packets that
|
||||||
* are in a few namespaces such as:<ul>
|
* are in a few namespaces such as:<ul>
|
||||||
|
@ -63,8 +63,8 @@ import org.jivesoftware.smack.util.XmppElementUtil;
|
||||||
*
|
*
|
||||||
* Each IQ provider is associated with an element name and a namespace. If multiple provider
|
* Each IQ provider is associated with an element name and a namespace. If multiple provider
|
||||||
* entries attempt to register to handle the same namespace, the first entry loaded from the
|
* entries attempt to register to handle the same namespace, the first entry loaded from the
|
||||||
* classpath will take precedence. The IQ provider class can either implement the IqProvider
|
* classpath will take precedence. The IQ provider class can either implement the IQProvider
|
||||||
* interface, or extend the IQ class. In the former case, each IqProvider is responsible for
|
* interface, or extend the IQ class. In the former case, each IQProvider is responsible for
|
||||||
* parsing the raw XML stream to create an IQ instance. In the latter case, bean introspection
|
* parsing the raw XML stream to create an IQ instance. In the latter case, bean introspection
|
||||||
* is used to try to automatically set properties of the IQ instance using the values found
|
* is used to try to automatically set properties of the IQ instance using the values found
|
||||||
* in the IQ stanza XML. For example, an XMPP time stanza resembles the following:
|
* in the IQ stanza XML. For example, an XMPP time stanza resembles the following:
|
||||||
|
@ -173,11 +173,11 @@ public final class ProviderManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an unmodifiable collection of all IqProvider instances. Each object
|
* Returns an unmodifiable collection of all IQProvider instances. Each object
|
||||||
* in the collection will either be an IqProvider instance, or a Class object
|
* in the collection will either be an IQProvider instance, or a Class object
|
||||||
* that implements the IqProvider interface.
|
* that implements the IQProvider interface.
|
||||||
*
|
*
|
||||||
* @return all IqProvider instances.
|
* @return all IQProvider instances.
|
||||||
*/
|
*/
|
||||||
public static List<IqProvider<IQ>> getIQProviders() {
|
public static List<IqProvider<IQ>> getIQProviders() {
|
||||||
List<IqProvider<IQ>> providers = new ArrayList<>(iqProviders.size());
|
List<IqProvider<IQ>> providers = new ArrayList<>(iqProviders.size());
|
||||||
|
@ -186,7 +186,7 @@ public final class ProviderManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an IQ provider (must be an instance of IqProvider or Class object that is an IQ)
|
* Adds an IQ provider (must be an instance of IQProvider or Class object that is an IQ)
|
||||||
* with the specified element name and name space. The provider will override any providers
|
* with the specified element name and name space. The provider will override any providers
|
||||||
* loaded through the classpath.
|
* loaded through the classpath.
|
||||||
*
|
*
|
||||||
|
|
|
@ -20,7 +20,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.util.FileUtils;
|
import org.jivesoftware.smack.util.FileUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
@ -61,10 +60,10 @@ public class ProviderConfigTest {
|
||||||
Assert.assertNotNull(ProviderManager.getIQProvider("provider", "test:file_provider"));
|
Assert.assertNotNull(ProviderManager.getIQProvider("provider", "test:file_provider"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TestIQProvider extends IqProvider<IQ> {
|
public static class TestIQProvider extends IQProvider<IQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) {
|
public IQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import org.jivesoftware.smack.SmackConfiguration;
|
import org.jivesoftware.smack.SmackConfiguration;
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
|
@ -38,10 +37,10 @@ public class ProviderManagerTest {
|
||||||
assertTrue(SmackConfiguration.isSmackInitialized());
|
assertTrue(SmackConfiguration.isSmackInitialized());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TestIQProvider extends IqProvider<IQ> {
|
public static class TestIQProvider extends IQProvider<IQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) {
|
public IQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,19 +18,18 @@ package org.jivesoftware.smackx.dox.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.dox.element.DnsIq;
|
import org.jivesoftware.smackx.dox.element.DnsIq;
|
||||||
|
|
||||||
public class DnsIqProvider extends IqProvider<DnsIq> {
|
public class DnsIqProvider extends IQProvider<DnsIq> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DnsIq parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public DnsIq parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException, IOException, SmackParsingException {
|
throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
String base64DnsMessage = parser.nextText();
|
String base64DnsMessage = parser.nextText();
|
||||||
return new DnsIq(base64DnsMessage);
|
return new DnsIq(base64DnsMessage);
|
||||||
|
|
|
@ -20,7 +20,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.NamedElement;
|
import org.jivesoftware.smack.packet.NamedElement;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.StringUtils;
|
import org.jivesoftware.smack.util.StringUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -35,7 +35,7 @@ import org.jivesoftware.smackx.shim.provider.HeadersProvider;
|
||||||
* @author Andriy Tsykholyas
|
* @author Andriy Tsykholyas
|
||||||
* @see <a href="http://xmpp.org/extensions/xep-0332.html">XEP-0332: HTTP over XMPP transport</a>
|
* @see <a href="http://xmpp.org/extensions/xep-0332.html">XEP-0332: HTTP over XMPP transport</a>
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractHttpOverXmppProvider<H extends AbstractHttpOverXmpp> extends IqProvider<H> {
|
public abstract class AbstractHttpOverXmppProvider<H extends AbstractHttpOverXmpp> extends IQProvider<H> {
|
||||||
|
|
||||||
private static final String ELEMENT_DATA = "data";
|
private static final String ELEMENT_DATA = "data";
|
||||||
private static final String ELEMENT_TEXT = "text";
|
private static final String ELEMENT_TEXT = "text";
|
||||||
|
|
|
@ -18,7 +18,6 @@ package org.jivesoftware.smackx.hoxt.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
|
@ -41,7 +40,7 @@ public class HttpOverXmppReqProvider extends AbstractHttpOverXmppProvider<HttpOv
|
||||||
private static final String ATTRIBUTE_MAX_CHUNK_SIZE = "maxChunkSize";
|
private static final String ATTRIBUTE_MAX_CHUNK_SIZE = "maxChunkSize";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpOverXmppReq parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws IOException, XmlPullParserException, SmackParsingException {
|
public HttpOverXmppReq parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws IOException, XmlPullParserException, SmackParsingException {
|
||||||
HttpOverXmppReq.Builder builder = HttpOverXmppReq.builder();
|
HttpOverXmppReq.Builder builder = HttpOverXmppReq.builder();
|
||||||
builder.setResource(parser.getAttributeValue("", ATTRIBUTE_RESOURCE));
|
builder.setResource(parser.getAttributeValue("", ATTRIBUTE_RESOURCE));
|
||||||
builder.setVersion(parser.getAttributeValue("", ATTRIBUTE_VERSION));
|
builder.setVersion(parser.getAttributeValue("", ATTRIBUTE_VERSION));
|
||||||
|
|
|
@ -18,7 +18,6 @@ package org.jivesoftware.smackx.hoxt.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
@ -40,7 +39,7 @@ public class HttpOverXmppRespProvider extends AbstractHttpOverXmppProvider<HttpO
|
||||||
private static final String ATTRIBUTE_STATUS_CODE = "statusCode";
|
private static final String ATTRIBUTE_STATUS_CODE = "statusCode";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpOverXmppResp parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws IOException, XmlPullParserException, SmackParsingException {
|
public HttpOverXmppResp parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws IOException, XmlPullParserException, SmackParsingException {
|
||||||
String version = parser.getAttributeValue("", ATTRIBUTE_VERSION);
|
String version = parser.getAttributeValue("", ATTRIBUTE_VERSION);
|
||||||
String statusMessage = parser.getAttributeValue("", ATTRIBUTE_STATUS_MESSAGE);
|
String statusMessage = parser.getAttributeValue("", ATTRIBUTE_STATUS_MESSAGE);
|
||||||
String statusCodeString = parser.getAttributeValue("", ATTRIBUTE_STATUS_CODE);
|
String statusCodeString = parser.getAttributeValue("", ATTRIBUTE_STATUS_CODE);
|
||||||
|
|
|
@ -21,9 +21,8 @@ import java.net.URL;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -39,10 +38,10 @@ import org.jivesoftware.smackx.httpfileupload.element.Slot_V0_2;
|
||||||
* @author Grigory Fedorov
|
* @author Grigory Fedorov
|
||||||
* @see <a href="http://xmpp.org/extensions/xep-0363.html">XEP-0363: HTTP File Upload</a>
|
* @see <a href="http://xmpp.org/extensions/xep-0363.html">XEP-0363: HTTP File Upload</a>
|
||||||
*/
|
*/
|
||||||
public class SlotProvider extends IqProvider<Slot> {
|
public class SlotProvider extends IQProvider<Slot> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Slot parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public Slot parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
final String namespace = parser.getNamespace();
|
final String namespace = parser.getNamespace();
|
||||||
|
|
||||||
final UploadService.Version version = HttpFileUploadManager.namespaceToVersion(namespace);
|
final UploadService.Version version = HttpFileUploadManager.namespaceToVersion(namespace);
|
||||||
|
|
|
@ -20,9 +20,8 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -33,10 +32,10 @@ import org.jivesoftware.smackx.iot.control.element.SetDoubleData;
|
||||||
import org.jivesoftware.smackx.iot.control.element.SetIntData;
|
import org.jivesoftware.smackx.iot.control.element.SetIntData;
|
||||||
import org.jivesoftware.smackx.iot.control.element.SetLongData;
|
import org.jivesoftware.smackx.iot.control.element.SetLongData;
|
||||||
|
|
||||||
public class IoTSetRequestProvider extends IqProvider<IoTSetRequest> {
|
public class IoTSetRequestProvider extends IQProvider<IoTSetRequest> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IoTSetRequest parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public IoTSetRequest parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
List<SetData> data = new ArrayList<>(4);
|
List<SetData> data = new ArrayList<>(4);
|
||||||
outerloop: while (true) {
|
outerloop: while (true) {
|
||||||
final XmlPullParser.Event eventType = parser.next();
|
final XmlPullParser.Event eventType = parser.next();
|
||||||
|
|
|
@ -16,17 +16,16 @@
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smackx.iot.control.provider;
|
package org.jivesoftware.smackx.iot.control.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.iot.control.element.IoTSetResponse;
|
import org.jivesoftware.smackx.iot.control.element.IoTSetResponse;
|
||||||
|
|
||||||
public class IoTSetResponseProvider extends IqProvider<IoTSetResponse> {
|
public class IoTSetResponseProvider extends IQProvider<IoTSetResponse> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IoTSetResponse parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) {
|
public IoTSetResponse parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) {
|
||||||
return new IoTSetResponse();
|
return new IoTSetResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,18 +18,17 @@ package org.jivesoftware.smackx.iot.data.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.iot.data.element.IoTDataReadOutAccepted;
|
import org.jivesoftware.smackx.iot.data.element.IoTDataReadOutAccepted;
|
||||||
|
|
||||||
public class IoTDataReadOutAcceptedProvider extends IqProvider<IoTDataReadOutAccepted> {
|
public class IoTDataReadOutAcceptedProvider extends IQProvider<IoTDataReadOutAccepted> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IoTDataReadOutAccepted parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws IOException {
|
public IoTDataReadOutAccepted parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws IOException {
|
||||||
int seqNr = ParserUtils.getIntegerAttributeOrThrow(parser, "seqnr", "IoT data request <accepted/> without sequence number");
|
int seqNr = ParserUtils.getIntegerAttributeOrThrow(parser, "seqnr", "IoT data request <accepted/> without sequence number");
|
||||||
boolean queued = ParserUtils.getBooleanAttribute(parser, "queued", false);
|
boolean queued = ParserUtils.getBooleanAttribute(parser, "queued", false);
|
||||||
return new IoTDataReadOutAccepted(seqNr, queued);
|
return new IoTDataReadOutAccepted(seqNr, queued);
|
||||||
|
|
|
@ -18,18 +18,17 @@ package org.jivesoftware.smackx.iot.data.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.iot.data.element.IoTDataRequest;
|
import org.jivesoftware.smackx.iot.data.element.IoTDataRequest;
|
||||||
|
|
||||||
public class IoTDataRequestProvider extends IqProvider<IoTDataRequest> {
|
public class IoTDataRequestProvider extends IQProvider<IoTDataRequest> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IoTDataRequest parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws IOException {
|
public IoTDataRequest parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws IOException {
|
||||||
int seqNr = ParserUtils.getIntegerAttributeOrThrow(parser, "seqnr", "IoT data request without sequence number");
|
int seqNr = ParserUtils.getIntegerAttributeOrThrow(parser, "seqnr", "IoT data request without sequence number");
|
||||||
boolean momentary = ParserUtils.getBooleanAttribute(parser, "momentary", false);
|
boolean momentary = ParserUtils.getBooleanAttribute(parser, "momentary", false);
|
||||||
return new IoTDataRequest(seqNr, momentary);
|
return new IoTDataRequest(seqNr, momentary);
|
||||||
|
|
|
@ -16,9 +16,8 @@
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smackx.iot.discovery.provider;
|
package org.jivesoftware.smackx.iot.discovery.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
|
@ -29,10 +28,10 @@ import org.jivesoftware.smackx.iot.parser.NodeInfoParser;
|
||||||
import org.jxmpp.jid.Jid;
|
import org.jxmpp.jid.Jid;
|
||||||
import org.jxmpp.stringprep.XmppStringprepException;
|
import org.jxmpp.stringprep.XmppStringprepException;
|
||||||
|
|
||||||
public class IoTClaimedProvider extends IqProvider<IoTClaimed> {
|
public class IoTClaimedProvider extends IQProvider<IoTClaimed> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IoTClaimed parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmppStringprepException {
|
public IoTClaimed parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmppStringprepException {
|
||||||
Jid jid = ParserUtils.getJidAttribute(parser);
|
Jid jid = ParserUtils.getJidAttribute(parser);
|
||||||
NodeInfo nodeInfo = NodeInfoParser.parse(parser);
|
NodeInfo nodeInfo = NodeInfoParser.parse(parser);
|
||||||
return new IoTClaimed(jid, nodeInfo);
|
return new IoTClaimed(jid, nodeInfo);
|
||||||
|
|
|
@ -16,9 +16,8 @@
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smackx.iot.discovery.provider;
|
package org.jivesoftware.smackx.iot.discovery.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
|
@ -29,10 +28,10 @@ import org.jivesoftware.smackx.iot.parser.NodeInfoParser;
|
||||||
import org.jxmpp.jid.Jid;
|
import org.jxmpp.jid.Jid;
|
||||||
import org.jxmpp.stringprep.XmppStringprepException;
|
import org.jxmpp.stringprep.XmppStringprepException;
|
||||||
|
|
||||||
public class IoTDisownProvider extends IqProvider<IoTDisown> {
|
public class IoTDisownProvider extends IQProvider<IoTDisown> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IoTDisown parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmppStringprepException {
|
public IoTDisown parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmppStringprepException {
|
||||||
Jid jid = ParserUtils.getJidAttribute(parser);
|
Jid jid = ParserUtils.getJidAttribute(parser);
|
||||||
NodeInfo nodeInfo = NodeInfoParser.parse(parser);
|
NodeInfo nodeInfo = NodeInfoParser.parse(parser);
|
||||||
return new IoTDisown(jid, nodeInfo);
|
return new IoTDisown(jid, nodeInfo);
|
||||||
|
|
|
@ -16,19 +16,18 @@
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smackx.iot.discovery.provider;
|
package org.jivesoftware.smackx.iot.discovery.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.iot.discovery.element.IoTDisowned;
|
import org.jivesoftware.smackx.iot.discovery.element.IoTDisowned;
|
||||||
import org.jivesoftware.smackx.iot.element.NodeInfo;
|
import org.jivesoftware.smackx.iot.element.NodeInfo;
|
||||||
import org.jivesoftware.smackx.iot.parser.NodeInfoParser;
|
import org.jivesoftware.smackx.iot.parser.NodeInfoParser;
|
||||||
|
|
||||||
public class IoTDisownedProvider extends IqProvider<IoTDisowned> {
|
public class IoTDisownedProvider extends IQProvider<IoTDisowned> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IoTDisowned parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) {
|
public IoTDisowned parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) {
|
||||||
NodeInfo nodeInfo = NodeInfoParser.parse(parser);
|
NodeInfo nodeInfo = NodeInfoParser.parse(parser);
|
||||||
return new IoTDisowned(nodeInfo);
|
return new IoTDisowned(nodeInfo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,9 +20,8 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -32,10 +31,10 @@ import org.jivesoftware.smackx.iot.discovery.element.Tag;
|
||||||
import org.jivesoftware.smackx.iot.element.NodeInfo;
|
import org.jivesoftware.smackx.iot.element.NodeInfo;
|
||||||
import org.jivesoftware.smackx.iot.parser.NodeInfoParser;
|
import org.jivesoftware.smackx.iot.parser.NodeInfoParser;
|
||||||
|
|
||||||
public class IoTRegisterProvider extends IqProvider<IoTRegister> {
|
public class IoTRegisterProvider extends IQProvider<IoTRegister> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IoTRegister parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public IoTRegister parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
boolean selfOwned = ParserUtils.getBooleanAttribute(parser, "selfOwned", false);
|
boolean selfOwned = ParserUtils.getBooleanAttribute(parser, "selfOwned", false);
|
||||||
NodeInfo nodeInfo = NodeInfoParser.parse(parser);
|
NodeInfo nodeInfo = NodeInfoParser.parse(parser);
|
||||||
List<Tag> tags = new ArrayList<>();
|
List<Tag> tags = new ArrayList<>();
|
||||||
|
|
|
@ -18,9 +18,8 @@ package org.jivesoftware.smackx.iot.discovery.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
|
@ -31,10 +30,10 @@ import org.jivesoftware.smackx.iot.parser.NodeInfoParser;
|
||||||
import org.jxmpp.jid.BareJid;
|
import org.jxmpp.jid.BareJid;
|
||||||
import org.jxmpp.jid.Jid;
|
import org.jxmpp.jid.Jid;
|
||||||
|
|
||||||
public class IoTRemoveProvider extends IqProvider<IoTRemove> {
|
public class IoTRemoveProvider extends IQProvider<IoTRemove> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IoTRemove parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws IOException {
|
public IoTRemove parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws IOException {
|
||||||
Jid jid = ParserUtils.getJidAttribute(parser);
|
Jid jid = ParserUtils.getJidAttribute(parser);
|
||||||
if (jid.hasResource()) {
|
if (jid.hasResource()) {
|
||||||
// TODO: Should be SmackParseException.
|
// TODO: Should be SmackParseException.
|
||||||
|
|
|
@ -16,19 +16,18 @@
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smackx.iot.discovery.provider;
|
package org.jivesoftware.smackx.iot.discovery.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.iot.discovery.element.IoTRemoved;
|
import org.jivesoftware.smackx.iot.discovery.element.IoTRemoved;
|
||||||
import org.jivesoftware.smackx.iot.element.NodeInfo;
|
import org.jivesoftware.smackx.iot.element.NodeInfo;
|
||||||
import org.jivesoftware.smackx.iot.parser.NodeInfoParser;
|
import org.jivesoftware.smackx.iot.parser.NodeInfoParser;
|
||||||
|
|
||||||
public class IoTRemovedProvider extends IqProvider<IoTRemoved> {
|
public class IoTRemovedProvider extends IQProvider<IoTRemoved> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IoTRemoved parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) {
|
public IoTRemoved parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) {
|
||||||
NodeInfo nodeInfo = NodeInfoParser.parse(parser);
|
NodeInfo nodeInfo = NodeInfoParser.parse(parser);
|
||||||
return new IoTRemoved(nodeInfo);
|
return new IoTRemoved(nodeInfo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,19 +16,18 @@
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smackx.iot.discovery.provider;
|
package org.jivesoftware.smackx.iot.discovery.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.iot.discovery.element.IoTUnregister;
|
import org.jivesoftware.smackx.iot.discovery.element.IoTUnregister;
|
||||||
import org.jivesoftware.smackx.iot.element.NodeInfo;
|
import org.jivesoftware.smackx.iot.element.NodeInfo;
|
||||||
import org.jivesoftware.smackx.iot.parser.NodeInfoParser;
|
import org.jivesoftware.smackx.iot.parser.NodeInfoParser;
|
||||||
|
|
||||||
public class IoTUnregisterProvider extends IqProvider<IoTUnregister> {
|
public class IoTUnregisterProvider extends IQProvider<IoTUnregister> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IoTUnregister parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) {
|
public IoTUnregister parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) {
|
||||||
NodeInfo nodeInfo = NodeInfoParser.parse(parser);
|
NodeInfo nodeInfo = NodeInfoParser.parse(parser);
|
||||||
return new IoTUnregister(nodeInfo);
|
return new IoTUnregister(nodeInfo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,17 +16,16 @@
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smackx.iot.provisioning.provider;
|
package org.jivesoftware.smackx.iot.provisioning.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.iot.provisioning.element.ClearCache;
|
import org.jivesoftware.smackx.iot.provisioning.element.ClearCache;
|
||||||
|
|
||||||
public class ClearCacheProvider extends IqProvider<ClearCache> {
|
public class ClearCacheProvider extends IQProvider<ClearCache> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ClearCache parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) {
|
public ClearCache parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) {
|
||||||
return new ClearCache();
|
return new ClearCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,17 +16,16 @@
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smackx.iot.provisioning.provider;
|
package org.jivesoftware.smackx.iot.provisioning.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.iot.provisioning.element.ClearCacheResponse;
|
import org.jivesoftware.smackx.iot.provisioning.element.ClearCacheResponse;
|
||||||
|
|
||||||
public class ClearCacheResponseProvider extends IqProvider<ClearCacheResponse> {
|
public class ClearCacheResponseProvider extends IQProvider<ClearCacheResponse> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ClearCacheResponse parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) {
|
public ClearCacheResponse parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) {
|
||||||
return new ClearCacheResponse();
|
return new ClearCacheResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,8 @@
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smackx.iot.provisioning.provider;
|
package org.jivesoftware.smackx.iot.provisioning.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
|
@ -27,10 +26,10 @@ import org.jivesoftware.smackx.iot.provisioning.element.IoTIsFriend;
|
||||||
import org.jxmpp.jid.Jid;
|
import org.jxmpp.jid.Jid;
|
||||||
import org.jxmpp.stringprep.XmppStringprepException;
|
import org.jxmpp.stringprep.XmppStringprepException;
|
||||||
|
|
||||||
public class IoTIsFriendProvider extends IqProvider<IoTIsFriend> {
|
public class IoTIsFriendProvider extends IQProvider<IoTIsFriend> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IoTIsFriend parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmppStringprepException {
|
public IoTIsFriend parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmppStringprepException {
|
||||||
Jid jid = ParserUtils.getJidAttribute(parser);
|
Jid jid = ParserUtils.getJidAttribute(parser);
|
||||||
return new IoTIsFriend(jid);
|
return new IoTIsFriend(jid);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,8 @@
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smackx.iot.provisioning.provider;
|
package org.jivesoftware.smackx.iot.provisioning.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
|
@ -28,10 +27,10 @@ import org.jxmpp.jid.BareJid;
|
||||||
import org.jxmpp.jid.Jid;
|
import org.jxmpp.jid.Jid;
|
||||||
import org.jxmpp.stringprep.XmppStringprepException;
|
import org.jxmpp.stringprep.XmppStringprepException;
|
||||||
|
|
||||||
public class IoTIsFriendResponseProvider extends IqProvider<IoTIsFriendResponse> {
|
public class IoTIsFriendResponseProvider extends IQProvider<IoTIsFriendResponse> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IoTIsFriendResponse parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmppStringprepException {
|
public IoTIsFriendResponse parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmppStringprepException {
|
||||||
Jid jid = ParserUtils.getJidAttribute(parser);
|
Jid jid = ParserUtils.getJidAttribute(parser);
|
||||||
BareJid bareJid = jid.asBareJid();
|
BareJid bareJid = jid.asBareJid();
|
||||||
boolean result = ParserUtils.getBooleanAttribute(parser, "result");
|
boolean result = ParserUtils.getBooleanAttribute(parser, "result");
|
||||||
|
|
|
@ -18,19 +18,18 @@ package org.jivesoftware.smackx.jid_prep.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.jid_prep.element.JidPrepIq;
|
import org.jivesoftware.smackx.jid_prep.element.JidPrepIq;
|
||||||
|
|
||||||
public class JidPrepIqProvider extends IqProvider<JidPrepIq> {
|
public class JidPrepIqProvider extends IQProvider<JidPrepIq> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JidPrepIq parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public JidPrepIq parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException, IOException, SmackParsingException {
|
throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
String jid = parser.nextText();
|
String jid = parser.nextText();
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,9 @@ package org.jivesoftware.smackx.mam.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -39,10 +38,10 @@ import org.jivesoftware.smackx.rsm.provider.RSMSetProvider;
|
||||||
* @author Fernando Ramirez
|
* @author Fernando Ramirez
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MamFinIQProvider extends IqProvider<MamFinIQ> {
|
public class MamFinIQProvider extends IQProvider<MamFinIQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MamFinIQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
public MamFinIQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
MamElementFactory elementFactory = MamElementFactory.forParser(parser);
|
MamElementFactory elementFactory = MamElementFactory.forParser(parser);
|
||||||
String queryId = parser.getAttributeValue("", "queryid");
|
String queryId = parser.getAttributeValue("", "queryid");
|
||||||
boolean complete = ParserUtils.getBooleanAttribute(parser, "complete", false);
|
boolean complete = ParserUtils.getBooleanAttribute(parser, "complete", false);
|
||||||
|
|
|
@ -20,9 +20,8 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -41,12 +40,12 @@ import org.jxmpp.jid.impl.JidCreate;
|
||||||
* @author Fernando Ramirez
|
* @author Fernando Ramirez
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MamPrefsIQProvider extends IqProvider<MamPrefsIQ> {
|
public class MamPrefsIQProvider extends IQProvider<MamPrefsIQ> {
|
||||||
|
|
||||||
public static final MamPrefsIQProvider INSTANCE = new MamPrefsIQProvider();
|
public static final MamPrefsIQProvider INSTANCE = new MamPrefsIQProvider();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MamPrefsIQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public MamPrefsIQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
MamElementFactory elementFactory = MamElementFactory.forParser(parser);
|
MamElementFactory elementFactory = MamElementFactory.forParser(parser);
|
||||||
String defaultBehaviorString = parser.getAttributeValue("", "default");
|
String defaultBehaviorString = parser.getAttributeValue("", "default");
|
||||||
DefaultBehavior defaultBehavior = null;
|
DefaultBehavior defaultBehavior = null;
|
||||||
|
|
|
@ -18,10 +18,9 @@ package org.jivesoftware.smackx.mam.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -38,10 +37,10 @@ import org.jivesoftware.smackx.xdata.provider.DataFormProvider;
|
||||||
* @author Fernando Ramirez
|
* @author Fernando Ramirez
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MamQueryIQProvider extends IqProvider<MamQueryIQ> {
|
public class MamQueryIQProvider extends IQProvider<MamQueryIQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MamQueryIQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public MamQueryIQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException, IOException, SmackParsingException {
|
throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
MamElementFactory elementFactory = MamElementFactory.forParser(parser);
|
MamElementFactory elementFactory = MamElementFactory.forParser(parser);
|
||||||
DataForm dataForm = null;
|
DataForm dataForm = null;
|
||||||
|
|
|
@ -19,9 +19,8 @@ package org.jivesoftware.smackx.muclight.provider;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -37,10 +36,10 @@ import org.jxmpp.jid.impl.JidCreate;
|
||||||
* @author Fernando Ramirez
|
* @author Fernando Ramirez
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MUCLightAffiliationsIQProvider extends IqProvider<MUCLightAffiliationsIQ> {
|
public class MUCLightAffiliationsIQProvider extends IQProvider<MUCLightAffiliationsIQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MUCLightAffiliationsIQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public MUCLightAffiliationsIQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
String version = null;
|
String version = null;
|
||||||
HashMap<Jid, MUCLightAffiliation> occupants = new HashMap<>();
|
HashMap<Jid, MUCLightAffiliation> occupants = new HashMap<>();
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,8 @@ import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -38,10 +37,10 @@ import org.jxmpp.stringprep.XmppStringprepException;
|
||||||
* @author Fernando Ramirez
|
* @author Fernando Ramirez
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MUCLightBlockingIQProvider extends IqProvider<MUCLightBlockingIQ> {
|
public class MUCLightBlockingIQProvider extends IQProvider<MUCLightBlockingIQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MUCLightBlockingIQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public MUCLightBlockingIQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
HashMap<Jid, Boolean> rooms = null;
|
HashMap<Jid, Boolean> rooms = null;
|
||||||
HashMap<Jid, Boolean> users = null;
|
HashMap<Jid, Boolean> users = null;
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,8 @@ package org.jivesoftware.smackx.muclight.provider;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -34,10 +33,10 @@ import org.jivesoftware.smackx.muclight.element.MUCLightConfigurationIQ;
|
||||||
* @author Fernando Ramirez
|
* @author Fernando Ramirez
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MUCLightConfigurationIQProvider extends IqProvider<MUCLightConfigurationIQ> {
|
public class MUCLightConfigurationIQProvider extends IQProvider<MUCLightConfigurationIQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MUCLightConfigurationIQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public MUCLightConfigurationIQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
String version = null;
|
String version = null;
|
||||||
String roomName = null;
|
String roomName = null;
|
||||||
String subject = null;
|
String subject = null;
|
||||||
|
|
|
@ -19,9 +19,8 @@ package org.jivesoftware.smackx.muclight.provider;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -38,10 +37,10 @@ import org.jxmpp.jid.impl.JidCreate;
|
||||||
* @author Fernando Ramirez
|
* @author Fernando Ramirez
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MUCLightInfoIQProvider extends IqProvider<MUCLightInfoIQ> {
|
public class MUCLightInfoIQProvider extends IQProvider<MUCLightInfoIQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MUCLightInfoIQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public MUCLightInfoIQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
String version = null;
|
String version = null;
|
||||||
String roomName = null;
|
String roomName = null;
|
||||||
String subject = null;
|
String subject = null;
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class AbstractHttpOverXmppProviderTest {
|
||||||
HttpOverXmppRespProvider provider = new HttpOverXmppRespProvider();
|
HttpOverXmppRespProvider provider = new HttpOverXmppRespProvider();
|
||||||
XmlPullParser parser = PacketParserUtils.getParserFor(string);
|
XmlPullParser parser = PacketParserUtils.getParserFor(string);
|
||||||
|
|
||||||
IQ iq = provider.parse(parser, null);
|
IQ iq = provider.parse(parser);
|
||||||
assertTrue(iq instanceof HttpOverXmppResp);
|
assertTrue(iq instanceof HttpOverXmppResp);
|
||||||
HttpOverXmppResp body = (HttpOverXmppResp) iq;
|
HttpOverXmppResp body = (HttpOverXmppResp) iq;
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class AbstractHttpOverXmppProviderTest {
|
||||||
HttpOverXmppReqProvider provider = new HttpOverXmppReqProvider();
|
HttpOverXmppReqProvider provider = new HttpOverXmppReqProvider();
|
||||||
XmlPullParser parser = PacketParserUtils.getParserFor(string);
|
XmlPullParser parser = PacketParserUtils.getParserFor(string);
|
||||||
|
|
||||||
IQ iq = provider.parse(parser, null);
|
IQ iq = provider.parse(parser);
|
||||||
assertTrue(iq instanceof HttpOverXmppReq);
|
assertTrue(iq instanceof HttpOverXmppReq);
|
||||||
HttpOverXmppReq body = (HttpOverXmppReq) iq;
|
HttpOverXmppReq body = (HttpOverXmppReq) iq;
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ public class AbstractHttpOverXmppProviderTest {
|
||||||
HttpOverXmppRespProvider provider = new HttpOverXmppRespProvider();
|
HttpOverXmppRespProvider provider = new HttpOverXmppRespProvider();
|
||||||
XmlPullParser parser = SmackTestUtil.getParserFor(string, tag, parserKind);
|
XmlPullParser parser = SmackTestUtil.getParserFor(string, tag, parserKind);
|
||||||
|
|
||||||
IQ iq = provider.parse(parser, null);
|
IQ iq = provider.parse(parser);
|
||||||
assertTrue(iq instanceof HttpOverXmppResp);
|
assertTrue(iq instanceof HttpOverXmppResp);
|
||||||
return (HttpOverXmppResp) iq;
|
return (HttpOverXmppResp) iq;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class HttpOverXmppReqProviderTest {
|
||||||
private static HttpOverXmppReq parseReq(String string) throws Exception {
|
private static HttpOverXmppReq parseReq(String string) throws Exception {
|
||||||
HttpOverXmppReqProvider provider = new HttpOverXmppReqProvider();
|
HttpOverXmppReqProvider provider = new HttpOverXmppReqProvider();
|
||||||
XmlPullParser parser = PacketParserUtils.getParserFor(string);
|
XmlPullParser parser = PacketParserUtils.getParserFor(string);
|
||||||
IQ iq = provider.parse(parser, null);
|
IQ iq = provider.parse(parser);
|
||||||
assertTrue(iq instanceof HttpOverXmppReq);
|
assertTrue(iq instanceof HttpOverXmppReq);
|
||||||
return (HttpOverXmppReq) iq;
|
return (HttpOverXmppReq) iq;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class HttpOverXmppRespProviderTest {
|
||||||
HttpOverXmppRespProvider provider = new HttpOverXmppRespProvider();
|
HttpOverXmppRespProvider provider = new HttpOverXmppRespProvider();
|
||||||
XmlPullParser parser = PacketParserUtils.getParserFor(string);
|
XmlPullParser parser = PacketParserUtils.getParserFor(string);
|
||||||
|
|
||||||
IQ iq = provider.parse(parser, null);
|
IQ iq = provider.parse(parser);
|
||||||
assertTrue(iq instanceof HttpOverXmppResp);
|
assertTrue(iq instanceof HttpOverXmppResp);
|
||||||
HttpOverXmppResp resp = (HttpOverXmppResp) iq;
|
HttpOverXmppResp resp = (HttpOverXmppResp) iq;
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ public class HttpOverXmppRespProviderTest {
|
||||||
HttpOverXmppRespProvider provider = new HttpOverXmppRespProvider();
|
HttpOverXmppRespProvider provider = new HttpOverXmppRespProvider();
|
||||||
XmlPullParser parser = PacketParserUtils.getParserFor(string);
|
XmlPullParser parser = PacketParserUtils.getParserFor(string);
|
||||||
|
|
||||||
IQ iq = provider.parse(parser, null);
|
IQ iq = provider.parse(parser);
|
||||||
assertTrue(iq instanceof HttpOverXmppResp);
|
assertTrue(iq instanceof HttpOverXmppResp);
|
||||||
HttpOverXmppResp resp = (HttpOverXmppResp) iq;
|
HttpOverXmppResp resp = (HttpOverXmppResp) iq;
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class MamFinProviderTest extends MamTest {
|
||||||
@Test
|
@Test
|
||||||
public void checkMamFinProvider() throws Exception {
|
public void checkMamFinProvider() throws Exception {
|
||||||
XmlPullParser parser = PacketParserUtils.getParserFor(exmapleMamFinXml);
|
XmlPullParser parser = PacketParserUtils.getParserFor(exmapleMamFinXml);
|
||||||
MamFinIQ mamFinIQ = new MamFinIQProvider().parse(parser, null);
|
MamFinIQ mamFinIQ = new MamFinIQProvider().parse(parser);
|
||||||
|
|
||||||
assertFalse(mamFinIQ.isComplete());
|
assertFalse(mamFinIQ.isComplete());
|
||||||
assertTrue(mamFinIQ.isStable());
|
assertTrue(mamFinIQ.isStable());
|
||||||
|
|
|
@ -60,21 +60,21 @@ public class MamPrefIQProviderTest extends MamTest {
|
||||||
public void checkMamPrefsIQProvider(XmlPullParserKind parserKind)
|
public void checkMamPrefsIQProvider(XmlPullParserKind parserKind)
|
||||||
throws XmlPullParserException, IOException, SmackParsingException {
|
throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
XmlPullParser parser1 = SmackTestUtil.getParserFor(exampleMamPrefsIQ1, parserKind);
|
XmlPullParser parser1 = SmackTestUtil.getParserFor(exampleMamPrefsIQ1, parserKind);
|
||||||
MamPrefsIQ mamPrefIQ1 = MamPrefsIQProvider.INSTANCE.parse(parser1, null);
|
MamPrefsIQ mamPrefIQ1 = MamPrefsIQProvider.INSTANCE.parse(parser1);
|
||||||
|
|
||||||
assertEquals(IQ.Type.set, mamPrefIQ1.getType());
|
assertEquals(IQ.Type.set, mamPrefIQ1.getType());
|
||||||
assertEquals(mamPrefIQ1.getAlwaysJids().get(0).toString(), "romeo@montague.lit");
|
assertEquals(mamPrefIQ1.getAlwaysJids().get(0).toString(), "romeo@montague.lit");
|
||||||
assertEquals(mamPrefIQ1.getNeverJids().get(0).toString(), "montague@montague.lit");
|
assertEquals(mamPrefIQ1.getNeverJids().get(0).toString(), "montague@montague.lit");
|
||||||
|
|
||||||
XmlPullParser parser2 = SmackTestUtil.getParserFor(exampleMamPrefsIQ2, parserKind);
|
XmlPullParser parser2 = SmackTestUtil.getParserFor(exampleMamPrefsIQ2, parserKind);
|
||||||
MamPrefsIQ mamPrefIQ2 = MamPrefsIQProvider.INSTANCE.parse(parser2, null);
|
MamPrefsIQ mamPrefIQ2 = MamPrefsIQProvider.INSTANCE.parse(parser2);
|
||||||
assertEquals(IQ.Type.set, mamPrefIQ2.getType());
|
assertEquals(IQ.Type.set, mamPrefIQ2.getType());
|
||||||
assertEquals(mamPrefIQ2.getAlwaysJids().get(0).toString(), "romeo@montague.lit");
|
assertEquals(mamPrefIQ2.getAlwaysJids().get(0).toString(), "romeo@montague.lit");
|
||||||
assertEquals(mamPrefIQ2.getAlwaysJids().get(1).toString(), "montague@montague.lit");
|
assertEquals(mamPrefIQ2.getAlwaysJids().get(1).toString(), "montague@montague.lit");
|
||||||
assertTrue(mamPrefIQ2.getNeverJids().isEmpty());
|
assertTrue(mamPrefIQ2.getNeverJids().isEmpty());
|
||||||
|
|
||||||
XmlPullParser parser3 = SmackTestUtil.getParserFor(exampleMamPrefsIQ3, parserKind);
|
XmlPullParser parser3 = SmackTestUtil.getParserFor(exampleMamPrefsIQ3, parserKind);
|
||||||
MamPrefsIQ mamPrefIQ3 = MamPrefsIQProvider.INSTANCE.parse(parser3, null);
|
MamPrefsIQ mamPrefIQ3 = MamPrefsIQProvider.INSTANCE.parse(parser3);
|
||||||
assertEquals(IQ.Type.set, mamPrefIQ3.getType());
|
assertEquals(IQ.Type.set, mamPrefIQ3.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,8 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -38,10 +37,10 @@ import org.jxmpp.jid.Jid;
|
||||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||||
* Command</a>
|
* Command</a>
|
||||||
*/
|
*/
|
||||||
public class BlockContactsIQProvider extends IqProvider<BlockContactsIQ> {
|
public class BlockContactsIQProvider extends IQProvider<BlockContactsIQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockContactsIQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public BlockContactsIQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
List<Jid> jids = new ArrayList<>();
|
List<Jid> jids = new ArrayList<>();
|
||||||
|
|
||||||
outerloop: while (true) {
|
outerloop: while (true) {
|
||||||
|
|
|
@ -21,9 +21,8 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -39,10 +38,10 @@ import org.jxmpp.jid.Jid;
|
||||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||||
* Command</a>
|
* Command</a>
|
||||||
*/
|
*/
|
||||||
public class BlockListIQProvider extends IqProvider<BlockListIQ> {
|
public class BlockListIQProvider extends IQProvider<BlockListIQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockListIQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public BlockListIQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
List<Jid> jids = null;
|
List<Jid> jids = null;
|
||||||
|
|
||||||
outerloop: while (true) {
|
outerloop: while (true) {
|
||||||
|
|
|
@ -20,9 +20,8 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -38,10 +37,10 @@ import org.jxmpp.jid.impl.JidCreate;
|
||||||
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
* @see <a href="http://xmpp.org/extensions/xep-0191.html">XEP-0191: Blocking
|
||||||
* Command</a>
|
* Command</a>
|
||||||
*/
|
*/
|
||||||
public class UnblockContactsIQProvider extends IqProvider<UnblockContactsIQ> {
|
public class UnblockContactsIQProvider extends IQProvider<UnblockContactsIQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UnblockContactsIQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public UnblockContactsIQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
List<Jid> jids = null;
|
List<Jid> jids = null;
|
||||||
|
|
||||||
outerloop: while (true) {
|
outerloop: while (true) {
|
||||||
|
|
|
@ -18,9 +18,8 @@ package org.jivesoftware.smackx.bob.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.Pair;
|
import org.jivesoftware.smack.util.Pair;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -36,10 +35,10 @@ import org.jivesoftware.smackx.bob.element.BoBIQ;
|
||||||
* @see <a href="http://xmpp.org/extensions/xep-0231.html">XEP-0231: Bits of
|
* @see <a href="http://xmpp.org/extensions/xep-0231.html">XEP-0231: Bits of
|
||||||
* Binary</a>
|
* Binary</a>
|
||||||
*/
|
*/
|
||||||
public class BoBIQProvider extends IqProvider<BoBIQ> {
|
public class BoBIQProvider extends IQProvider<BoBIQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BoBIQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public BoBIQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
Pair<ContentId, BoBData> parserResult = BoBProviderUtil.parseContentIdAndBobData(parser, initialDepth,
|
Pair<ContentId, BoBData> parserResult = BoBProviderUtil.parseContentIdAndBobData(parser, initialDepth,
|
||||||
xmlEnvironment);
|
xmlEnvironment);
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,8 @@
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smackx.bytestreams.ibb.provider;
|
package org.jivesoftware.smackx.bytestreams.ibb.provider;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.bytestreams.ibb.packet.Close;
|
import org.jivesoftware.smackx.bytestreams.ibb.packet.Close;
|
||||||
|
@ -28,10 +27,10 @@ import org.jivesoftware.smackx.bytestreams.ibb.packet.Close;
|
||||||
*
|
*
|
||||||
* @author Henning Staib
|
* @author Henning Staib
|
||||||
*/
|
*/
|
||||||
public class CloseIQProvider extends IqProvider<Close> {
|
public class CloseIQProvider extends IQProvider<Close> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Close parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) {
|
public Close parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) {
|
||||||
String sid = parser.getAttributeValue("", "sid");
|
String sid = parser.getAttributeValue("", "sid");
|
||||||
return new Close(sid);
|
return new Close(sid);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ package org.jivesoftware.smackx.bytestreams.ibb.provider;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.datatypes.UInt16;
|
import org.jivesoftware.smack.datatypes.UInt16;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException.RequiredAttributeMissingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException.RequiredAttributeMissingException;
|
||||||
|
@ -38,12 +37,12 @@ import org.jivesoftware.smackx.bytestreams.ibb.packet.DataPacketExtension;
|
||||||
*/
|
*/
|
||||||
public class DataPacketProvider {
|
public class DataPacketProvider {
|
||||||
|
|
||||||
public static class IQProvider extends org.jivesoftware.smack.provider.IqProvider<Data> {
|
public static class IQProvider extends org.jivesoftware.smack.provider.IQProvider<Data> {
|
||||||
|
|
||||||
private static final PacketExtensionProvider packetExtensionProvider = new PacketExtensionProvider();
|
private static final PacketExtensionProvider packetExtensionProvider = new PacketExtensionProvider();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Data parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public Data parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws IOException, XmlPullParserException, SmackParsingException {
|
throws IOException, XmlPullParserException, SmackParsingException {
|
||||||
DataPacketExtension data = packetExtensionProvider.parse(parser);
|
DataPacketExtension data = packetExtensionProvider.parse(parser);
|
||||||
return new Data(data);
|
return new Data(data);
|
||||||
|
|
|
@ -19,9 +19,8 @@ package org.jivesoftware.smackx.bytestreams.ibb.provider;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -33,10 +32,10 @@ import org.jivesoftware.smackx.bytestreams.ibb.packet.Open;
|
||||||
*
|
*
|
||||||
* @author Henning Staib
|
* @author Henning Staib
|
||||||
*/
|
*/
|
||||||
public class OpenIQProvider extends IqProvider<Open> {
|
public class OpenIQProvider extends IQProvider<Open> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Open parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public Open parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
String sessionID = parser.getAttributeValue("", "sid");
|
String sessionID = parser.getAttributeValue("", "sid");
|
||||||
int blockSize = Integer.parseInt(parser.getAttributeValue("", "block-size"));
|
int blockSize = Integer.parseInt(parser.getAttributeValue("", "block-size"));
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,8 @@ package org.jivesoftware.smackx.bytestreams.socks5.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -35,10 +34,10 @@ import org.jxmpp.jid.Jid;
|
||||||
*
|
*
|
||||||
* @author Alexander Wenckus
|
* @author Alexander Wenckus
|
||||||
*/
|
*/
|
||||||
public class BytestreamsProvider extends IqProvider<Bytestream> {
|
public class BytestreamsProvider extends IQProvider<Bytestream> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Bytestream parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public Bytestream parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException, IOException {
|
throws XmlPullParserException, IOException {
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
|
||||||
|
|
|
@ -19,12 +19,11 @@ package org.jivesoftware.smackx.commands.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.StanzaError;
|
import org.jivesoftware.smack.packet.StanzaError;
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -40,10 +39,10 @@ import org.jivesoftware.smackx.xdata.provider.DataFormProvider;
|
||||||
*
|
*
|
||||||
* @author Gabriel Guardincerri
|
* @author Gabriel Guardincerri
|
||||||
*/
|
*/
|
||||||
public class AdHocCommandDataProvider extends IqProvider<AdHocCommandData> {
|
public class AdHocCommandDataProvider extends IQProvider<AdHocCommandData> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AdHocCommandData parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
public AdHocCommandData parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
AdHocCommandData adHocCommandData = new AdHocCommandData();
|
AdHocCommandData adHocCommandData = new AdHocCommandData();
|
||||||
DataFormProvider dataFormProvider = new DataFormProvider();
|
DataFormProvider dataFormProvider = new DataFormProvider();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2003-2007 Jive Software, 2018-2022 Florian Schmaus.
|
* Copyright 2003-2007 Jive Software, 2018-2020 Florian Schmaus.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -937,10 +937,6 @@ public final class ServiceDiscoveryManager extends Manager {
|
||||||
* Notify the {@link EntityCapabilitiesChangedListener} about changed capabilities.
|
* Notify the {@link EntityCapabilitiesChangedListener} about changed capabilities.
|
||||||
*/
|
*/
|
||||||
private synchronized void renewEntityCapsVersion() {
|
private synchronized void renewEntityCapsVersion() {
|
||||||
if (entityCapabilitiesChangedListeners.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
renewEntityCapsRequested++;
|
renewEntityCapsRequested++;
|
||||||
if (renewEntityCapsScheduledAction != null) {
|
if (renewEntityCapsScheduledAction != null) {
|
||||||
boolean canceled = renewEntityCapsScheduledAction.cancel();
|
boolean canceled = renewEntityCapsScheduledAction.cancel();
|
||||||
|
@ -949,12 +945,9 @@ public final class ServiceDiscoveryManager extends Manager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renewEntityCapsScheduledAction = scheduleBlocking(() -> {
|
final XMPPConnection connection = connection();
|
||||||
final XMPPConnection connection = connection();
|
|
||||||
if (connection == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
renewEntityCapsScheduledAction = scheduleBlocking(() -> {
|
||||||
renewEntityCapsPerformed.incrementAndGet();
|
renewEntityCapsPerformed.incrementAndGet();
|
||||||
|
|
||||||
DiscoverInfoBuilder discoverInfoBuilder = DiscoverInfo.builder("synthetized-disco-info-response")
|
DiscoverInfoBuilder discoverInfoBuilder = DiscoverInfo.builder("synthetized-disco-info-response")
|
||||||
|
|
|
@ -19,9 +19,8 @@ package org.jivesoftware.smackx.disco.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -35,10 +34,10 @@ import org.jxmpp.jid.Jid;
|
||||||
*
|
*
|
||||||
* @author Gaston Dombiak
|
* @author Gaston Dombiak
|
||||||
*/
|
*/
|
||||||
public class DiscoverItemsProvider extends IqProvider<DiscoverItems> {
|
public class DiscoverItemsProvider extends IQProvider<DiscoverItems> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DiscoverItems parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public DiscoverItems parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException, IOException {
|
throws XmlPullParserException, IOException {
|
||||||
DiscoverItems discoverItems = new DiscoverItems();
|
DiscoverItems discoverItems = new DiscoverItems();
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
|
|
@ -20,9 +20,8 @@ package org.jivesoftware.smackx.iqlast.packet;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -101,10 +100,10 @@ public class LastActivity extends IQ {
|
||||||
*
|
*
|
||||||
* @author Derek DeMoro
|
* @author Derek DeMoro
|
||||||
*/
|
*/
|
||||||
public static class Provider extends IqProvider<LastActivity> {
|
public static class Provider extends IQProvider<LastActivity> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LastActivity parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public LastActivity parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
LastActivity lastActivity = new LastActivity();
|
LastActivity lastActivity = new LastActivity();
|
||||||
String seconds = parser.getAttributeValue("", "seconds");
|
String seconds = parser.getAttributeValue("", "seconds");
|
||||||
if (seconds != null) {
|
if (seconds != null) {
|
||||||
|
|
|
@ -31,10 +31,9 @@ import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||||
import org.jivesoftware.smack.XMPPConnection;
|
import org.jivesoftware.smack.XMPPConnection;
|
||||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.StanzaError.Condition;
|
import org.jivesoftware.smack.packet.StanzaError.Condition;
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -235,10 +234,10 @@ public final class PrivateDataManager extends Manager {
|
||||||
/**
|
/**
|
||||||
* An IQ provider to parse IQ results containing private data.
|
* An IQ provider to parse IQ results containing private data.
|
||||||
*/
|
*/
|
||||||
public static class PrivateDataIQProvider extends IqProvider<PrivateDataIQ> {
|
public static class PrivateDataIQProvider extends IQProvider<PrivateDataIQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PrivateDataIQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public PrivateDataIQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException, IOException {
|
throws XmlPullParserException, IOException {
|
||||||
PrivateData privateData = null;
|
PrivateData privateData = null;
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
|
|
@ -23,21 +23,20 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlElement;
|
import org.jivesoftware.smack.packet.XmlElement;
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.iqregister.packet.Registration;
|
import org.jivesoftware.smackx.iqregister.packet.Registration;
|
||||||
|
|
||||||
public class RegistrationProvider extends IqProvider<Registration> {
|
public class RegistrationProvider extends IQProvider<Registration> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Registration parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
public Registration parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
String instruction = null;
|
String instruction = null;
|
||||||
Map<String, String> fields = new HashMap<>();
|
Map<String, String> fields = new HashMap<>();
|
||||||
List<XmlElement> packetExtensions = new LinkedList<>();
|
List<XmlElement> packetExtensions = new LinkedList<>();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2003-2007 Jive Software. 2020-2022 Florian Schmaus
|
* Copyright 2003-2007 Jive Software. 2020-2021 Florian Schmaus
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -25,7 +25,6 @@ import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import java.util.concurrent.CopyOnWriteArraySet;
|
import java.util.concurrent.CopyOnWriteArraySet;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
@ -60,9 +59,7 @@ import org.jivesoftware.smack.packet.Message;
|
||||||
import org.jivesoftware.smack.packet.MessageBuilder;
|
import org.jivesoftware.smack.packet.MessageBuilder;
|
||||||
import org.jivesoftware.smack.packet.MessageView;
|
import org.jivesoftware.smack.packet.MessageView;
|
||||||
import org.jivesoftware.smack.packet.Presence;
|
import org.jivesoftware.smack.packet.Presence;
|
||||||
import org.jivesoftware.smack.packet.PresenceBuilder;
|
|
||||||
import org.jivesoftware.smack.packet.Stanza;
|
import org.jivesoftware.smack.packet.Stanza;
|
||||||
import org.jivesoftware.smack.util.Consumer;
|
|
||||||
import org.jivesoftware.smack.util.Objects;
|
import org.jivesoftware.smack.util.Objects;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||||
|
@ -127,7 +124,7 @@ public class MultiUserChat {
|
||||||
private final Set<ParticipantStatusListener> participantStatusListeners = new CopyOnWriteArraySet<ParticipantStatusListener>();
|
private final Set<ParticipantStatusListener> participantStatusListeners = new CopyOnWriteArraySet<ParticipantStatusListener>();
|
||||||
private final Set<MessageListener> messageListeners = new CopyOnWriteArraySet<MessageListener>();
|
private final Set<MessageListener> messageListeners = new CopyOnWriteArraySet<MessageListener>();
|
||||||
private final Set<PresenceListener> presenceListeners = new CopyOnWriteArraySet<PresenceListener>();
|
private final Set<PresenceListener> presenceListeners = new CopyOnWriteArraySet<PresenceListener>();
|
||||||
private final Set<Consumer<PresenceBuilder>> presenceInterceptors = new CopyOnWriteArraySet<>();
|
private final Set<PresenceListener> presenceInterceptors = new CopyOnWriteArraySet<PresenceListener>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This filter will match all stanzas send from the groupchat or from one if
|
* This filter will match all stanzas send from the groupchat or from one if
|
||||||
|
@ -141,16 +138,7 @@ public class MultiUserChat {
|
||||||
*/
|
*/
|
||||||
private final StanzaFilter fromRoomGroupchatFilter;
|
private final StanzaFilter fromRoomGroupchatFilter;
|
||||||
|
|
||||||
private final AtomicInteger presenceInterceptorCount = new AtomicInteger();
|
private final StanzaListener presenceInterceptor;
|
||||||
// We want to save the presence interceptor in a variable, using a lambda, (and not use a method reference) to be
|
|
||||||
// able to dynamically add and remove it from the connection.
|
|
||||||
@SuppressWarnings("UnnecessaryLambda")
|
|
||||||
private final Consumer<PresenceBuilder> presenceInterceptor = presenceBuilder -> {
|
|
||||||
for (Consumer<PresenceBuilder> interceptor : presenceInterceptors) {
|
|
||||||
interceptor.accept(presenceBuilder);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private final StanzaListener messageListener;
|
private final StanzaListener messageListener;
|
||||||
private final StanzaListener presenceListener;
|
private final StanzaListener presenceListener;
|
||||||
private final StanzaListener subjectListener;
|
private final StanzaListener subjectListener;
|
||||||
|
@ -328,6 +316,16 @@ public class MultiUserChat {
|
||||||
fireInvitationRejectionListeners(message, rejection);
|
fireInvitationRejectionListeners(message, rejection);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
presenceInterceptor = new StanzaListener() {
|
||||||
|
@Override
|
||||||
|
public void processStanza(Stanza packet) {
|
||||||
|
Presence presence = (Presence) packet;
|
||||||
|
for (PresenceListener interceptor : presenceInterceptors) {
|
||||||
|
interceptor.processPresence(presence);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -381,6 +379,8 @@ public class MultiUserChat {
|
||||||
);
|
);
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
connection.addStanzaListener(declinesListener, new AndFilter(fromRoomFilter, DECLINE_FILTER));
|
connection.addStanzaListener(declinesListener, new AndFilter(fromRoomFilter, DECLINE_FILTER));
|
||||||
|
connection.addStanzaSendingListener(presenceInterceptor, new AndFilter(ToMatchesFilter.create(room),
|
||||||
|
StanzaTypeFilter.PRESENCE));
|
||||||
messageCollector = connection.createStanzaCollector(fromRoomGroupchatFilter);
|
messageCollector = connection.createStanzaCollector(fromRoomGroupchatFilter);
|
||||||
|
|
||||||
// Wait for a presence packet back from the server.
|
// Wait for a presence packet back from the server.
|
||||||
|
@ -1133,13 +1133,8 @@ public class MultiUserChat {
|
||||||
*
|
*
|
||||||
* @param presenceInterceptor the new stanza interceptor that will intercept presence packets.
|
* @param presenceInterceptor the new stanza interceptor that will intercept presence packets.
|
||||||
*/
|
*/
|
||||||
public void addPresenceInterceptor(Consumer<PresenceBuilder> presenceInterceptor) {
|
public void addPresenceInterceptor(PresenceListener presenceInterceptor) {
|
||||||
boolean added = presenceInterceptors.add(presenceInterceptor);
|
presenceInterceptors.add(presenceInterceptor);
|
||||||
if (!added) return;
|
|
||||||
int currentCount = presenceInterceptorCount.incrementAndGet();
|
|
||||||
if (currentCount == 1) {
|
|
||||||
connection.addPresenceInterceptor(this.presenceInterceptor, ToMatchesFilter.create(room).asPredicate(Presence.class));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1149,13 +1144,8 @@ public class MultiUserChat {
|
||||||
*
|
*
|
||||||
* @param presenceInterceptor the stanza interceptor to remove.
|
* @param presenceInterceptor the stanza interceptor to remove.
|
||||||
*/
|
*/
|
||||||
public void removePresenceInterceptor(Consumer<PresenceBuilder> presenceInterceptor) {
|
public void removePresenceInterceptor(PresenceListener presenceInterceptor) {
|
||||||
boolean removed = presenceInterceptors.remove(presenceInterceptor);
|
presenceInterceptors.remove(presenceInterceptor);
|
||||||
if (!removed) return;
|
|
||||||
int currentCount = presenceInterceptorCount.decrementAndGet();
|
|
||||||
if (currentCount == 0) {
|
|
||||||
connection.removePresenceInterceptor(presenceInterceptor);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2221,7 +2211,7 @@ public class MultiUserChat {
|
||||||
connection.removeStanzaListener(presenceListener);
|
connection.removeStanzaListener(presenceListener);
|
||||||
connection.removeStanzaListener(subjectListener);
|
connection.removeStanzaListener(subjectListener);
|
||||||
connection.removeStanzaListener(declinesListener);
|
connection.removeStanzaListener(declinesListener);
|
||||||
connection.removePresenceInterceptor(presenceInterceptor);
|
connection.removeStanzaSendingListener(presenceInterceptor);
|
||||||
if (messageCollector != null) {
|
if (messageCollector != null) {
|
||||||
messageCollector.cancel();
|
messageCollector.cancel();
|
||||||
messageCollector = null;
|
messageCollector = null;
|
||||||
|
|
|
@ -19,9 +19,8 @@ package org.jivesoftware.smackx.muc.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -32,10 +31,10 @@ import org.jivesoftware.smackx.muc.packet.MUCAdmin;
|
||||||
*
|
*
|
||||||
* @author Gaston Dombiak
|
* @author Gaston Dombiak
|
||||||
*/
|
*/
|
||||||
public class MUCAdminProvider extends IqProvider<MUCAdmin> {
|
public class MUCAdminProvider extends IQProvider<MUCAdmin> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MUCAdmin parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public MUCAdmin parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException, IOException {
|
throws XmlPullParserException, IOException {
|
||||||
MUCAdmin mucAdmin = new MUCAdmin();
|
MUCAdmin mucAdmin = new MUCAdmin();
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
|
|
@ -19,10 +19,9 @@ package org.jivesoftware.smackx.muc.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -34,10 +33,10 @@ import org.jivesoftware.smackx.muc.packet.MUCOwner;
|
||||||
*
|
*
|
||||||
* @author Gaston Dombiak
|
* @author Gaston Dombiak
|
||||||
*/
|
*/
|
||||||
public class MUCOwnerProvider extends IqProvider<MUCOwner> {
|
public class MUCOwnerProvider extends IQProvider<MUCOwner> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MUCOwner parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
public MUCOwner parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
MUCOwner mucOwner = new MUCOwner();
|
MUCOwner mucOwner = new MUCOwner();
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
while (!done) {
|
while (!done) {
|
||||||
|
|
|
@ -23,9 +23,8 @@ import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -198,11 +197,11 @@ public class OfflineMessageRequest extends IQ {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Provider extends IqProvider<OfflineMessageRequest> {
|
public static class Provider extends IQProvider<OfflineMessageRequest> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OfflineMessageRequest parse(XmlPullParser parser,
|
public OfflineMessageRequest parse(XmlPullParser parser,
|
||||||
int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException,
|
int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException,
|
||||||
IOException {
|
IOException {
|
||||||
OfflineMessageRequest request = new OfflineMessageRequest();
|
OfflineMessageRequest request = new OfflineMessageRequest();
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
|
|
@ -18,18 +18,17 @@ package org.jivesoftware.smackx.ping.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.ping.packet.Ping;
|
import org.jivesoftware.smackx.ping.packet.Ping;
|
||||||
|
|
||||||
public class PingProvider extends IqProvider<Ping> {
|
public class PingProvider extends IQProvider<Ping> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Ping parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public Ping parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
// No need to use the ping constructor with arguments. IQ will already
|
// No need to use the ping constructor with arguments. IQ will already
|
||||||
// have filled out all relevant fields ('from', 'to', 'id').
|
// have filled out all relevant fields ('from', 'to', 'id').
|
||||||
return new Ping();
|
return new Ping();
|
||||||
|
|
|
@ -20,9 +20,8 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.jivesoftware.smack.datatypes.UInt32;
|
import org.jivesoftware.smack.datatypes.UInt32;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -38,10 +37,10 @@ import org.jivesoftware.smackx.privacy.packet.PrivacyItem;
|
||||||
*
|
*
|
||||||
* @author Francisco Vives
|
* @author Francisco Vives
|
||||||
*/
|
*/
|
||||||
public class PrivacyProvider extends IqProvider<Privacy> {
|
public class PrivacyProvider extends IQProvider<Privacy> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Privacy parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public Privacy parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException, IOException {
|
throws XmlPullParserException, IOException {
|
||||||
Privacy privacy = new Privacy();
|
Privacy privacy = new Privacy();
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
|
|
@ -19,10 +19,9 @@ package org.jivesoftware.smackx.pubsub.provider;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -36,9 +35,9 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
|
||||||
*
|
*
|
||||||
* @author Robin Collier
|
* @author Robin Collier
|
||||||
*/
|
*/
|
||||||
public class PubSubProvider extends IqProvider<PubSub> {
|
public class PubSubProvider extends IQProvider<PubSub> {
|
||||||
@Override
|
@Override
|
||||||
public PubSub parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
public PubSub parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
String namespace = parser.getNamespace();
|
String namespace = parser.getNamespace();
|
||||||
PubSubNamespace pubSubNamespace = PubSubNamespace.valueOfFromXmlns(namespace);
|
PubSubNamespace pubSubNamespace = PubSubNamespace.valueOfFromXmlns(namespace);
|
||||||
PubSub pubsub = new PubSub(pubSubNamespace);
|
PubSub pubsub = new PubSub(pubSubNamespace);
|
||||||
|
|
|
@ -23,11 +23,10 @@ import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||||
import org.jivesoftware.smack.XMPPConnection;
|
import org.jivesoftware.smack.XMPPConnection;
|
||||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.SimpleIQ;
|
import org.jivesoftware.smack.packet.SimpleIQ;
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -125,11 +124,11 @@ public class UserSearch extends SimpleIQ {
|
||||||
/**
|
/**
|
||||||
* Internal Search service Provider.
|
* Internal Search service Provider.
|
||||||
*/
|
*/
|
||||||
public static class Provider extends IqProvider<IQ> {
|
public static class Provider extends IQProvider<IQ> {
|
||||||
|
|
||||||
// FIXME this provider does return two different types of IQs
|
// FIXME this provider does return two different types of IQs
|
||||||
@Override
|
@Override
|
||||||
public IQ parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
public IQ parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
UserSearch search = null;
|
UserSearch search = null;
|
||||||
SimpleUserSearch simpleUserSearch = new SimpleUserSearch();
|
SimpleUserSearch simpleUserSearch = new SimpleUserSearch();
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,8 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -68,10 +67,10 @@ public class SharedGroupsInfo extends IQ {
|
||||||
/**
|
/**
|
||||||
* Internal Search service Provider.
|
* Internal Search service Provider.
|
||||||
*/
|
*/
|
||||||
public static class Provider extends IqProvider<SharedGroupsInfo> {
|
public static class Provider extends IQProvider<SharedGroupsInfo> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedGroupsInfo parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public SharedGroupsInfo parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException, IOException {
|
throws XmlPullParserException, IOException {
|
||||||
SharedGroupsInfo groupsInfo = new SharedGroupsInfo();
|
SharedGroupsInfo groupsInfo = new SharedGroupsInfo();
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,9 @@ import java.util.Date;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -42,11 +41,11 @@ import org.jxmpp.util.XmppDateTime;
|
||||||
* @author Alexander Wenckus
|
* @author Alexander Wenckus
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class StreamInitiationProvider extends IqProvider<StreamInitiation> {
|
public class StreamInitiationProvider extends IQProvider<StreamInitiation> {
|
||||||
private static final Logger LOGGER = Logger.getLogger(StreamInitiationProvider.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(StreamInitiationProvider.class.getName());
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StreamInitiation parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
public StreamInitiation parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
// si
|
// si
|
||||||
String id = parser.getAttributeValue("", "id");
|
String id = parser.getAttributeValue("", "id");
|
||||||
String mimeType = parser.getAttributeValue("", "mime-type");
|
String mimeType = parser.getAttributeValue("", "mime-type");
|
||||||
|
|
|
@ -18,9 +18,8 @@ package org.jivesoftware.smackx.vcardtemp.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.StringUtils;
|
import org.jivesoftware.smack.util.StringUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -34,7 +33,7 @@ import org.jivesoftware.smackx.vcardtemp.packet.VCard;
|
||||||
* @author Derek DeMoro
|
* @author Derek DeMoro
|
||||||
* @author Chris Deering
|
* @author Chris Deering
|
||||||
*/
|
*/
|
||||||
public class VCardProvider extends IqProvider<VCard> {
|
public class VCardProvider extends IQProvider<VCard> {
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final String[] ADR = new String[] {
|
private static final String[] ADR = new String[] {
|
||||||
|
@ -69,7 +68,7 @@ public class VCardProvider extends IqProvider<VCard> {
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VCard parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public VCard parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
VCard vCard = new VCard();
|
VCard vCard = new VCard();
|
||||||
String name = null;
|
String name = null;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2003-2007 Jive Software 2020-2022 Florian Schmaus.
|
* Copyright 2003-2007 Jive Software 2020-2021 Florian Schmaus.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -21,8 +21,6 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.CopyOnWriteArraySet;
|
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import javax.xml.namespace.QName;
|
import javax.xml.namespace.QName;
|
||||||
|
@ -32,8 +30,6 @@ import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
||||||
import org.jivesoftware.smack.roster.packet.RosterPacket;
|
import org.jivesoftware.smack.roster.packet.RosterPacket;
|
||||||
import org.jivesoftware.smack.roster.provider.RosterPacketProvider;
|
import org.jivesoftware.smack.roster.provider.RosterPacketProvider;
|
||||||
import org.jivesoftware.smack.util.EqualsUtil;
|
|
||||||
import org.jivesoftware.smack.util.HashCode;
|
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -115,7 +111,7 @@ public class DataFormProvider extends ExtensionElementProvider<DataForm> {
|
||||||
// See XEP-133 Example 32 for a corner case where the data form contains this extension.
|
// See XEP-133 Example 32 for a corner case where the data form contains this extension.
|
||||||
case RosterPacket.ELEMENT:
|
case RosterPacket.ELEMENT:
|
||||||
if (namespace.equals(RosterPacket.NAMESPACE)) {
|
if (namespace.equals(RosterPacket.NAMESPACE)) {
|
||||||
dataForm.addExtensionElement(RosterPacketProvider.INSTANCE.parse(parser, null));
|
dataForm.addExtensionElement(RosterPacketProvider.INSTANCE.parse(parser));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// See XEP-141 Data Forms Layout
|
// See XEP-141 Data Forms Layout
|
||||||
|
@ -144,37 +140,6 @@ public class DataFormProvider extends ExtensionElementProvider<DataForm> {
|
||||||
return parseField(parser, xmlEnvironment, formType, null);
|
return parseField(parser, xmlEnvironment, formType, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class FieldNameAndFormType {
|
|
||||||
private final String fieldName;
|
|
||||||
private final String formType;
|
|
||||||
|
|
||||||
private FieldNameAndFormType(String fieldName, String formType) {
|
|
||||||
this.fieldName = fieldName;
|
|
||||||
this.formType = formType;
|
|
||||||
}
|
|
||||||
|
|
||||||
private final HashCode.Cache hashCodeCache = new HashCode.Cache();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return hashCodeCache.getHashCode(b ->
|
|
||||||
b.append(fieldName)
|
|
||||||
.append(formType)
|
|
||||||
.build()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object other) {
|
|
||||||
return EqualsUtil.equals(this, other, (e, o) ->
|
|
||||||
e.append(fieldName, o.fieldName)
|
|
||||||
.append(formType, o.formType)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final Set<FieldNameAndFormType> UNKNOWN_FIELDS = new CopyOnWriteArraySet<>();
|
|
||||||
|
|
||||||
private static FormField parseField(XmlPullParser parser, XmlEnvironment xmlEnvironment, String formType, DataForm.ReportedData reportedData)
|
private static FormField parseField(XmlPullParser parser, XmlEnvironment xmlEnvironment, String formType, DataForm.ReportedData reportedData)
|
||||||
throws XmlPullParserException, IOException, SmackParsingException {
|
throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
final int initialDepth = parser.getDepth();
|
final int initialDepth = parser.getDepth();
|
||||||
|
@ -247,12 +212,8 @@ public class DataFormProvider extends ExtensionElementProvider<DataForm> {
|
||||||
// field's type in the registry.
|
// field's type in the registry.
|
||||||
type = FormFieldRegistry.lookup(formType, fieldName);
|
type = FormFieldRegistry.lookup(formType, fieldName);
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
FieldNameAndFormType fieldNameAndFormType = new FieldNameAndFormType(fieldName, formType);
|
LOGGER.warning("The Field '" + fieldName + "' from FORM_TYPE '" + formType
|
||||||
if (!UNKNOWN_FIELDS.contains(fieldNameAndFormType)) {
|
+ "' is not registered. Field type is unknown, assuming text-single.");
|
||||||
LOGGER.warning("The Field '" + fieldName + "' from FORM_TYPE '" + formType
|
|
||||||
+ "' is not registered. Field type is unknown, assuming text-single.");
|
|
||||||
UNKNOWN_FIELDS.add(fieldNameAndFormType);
|
|
||||||
}
|
|
||||||
// As per XEP-0004, text-single is the default form field type, which we use as emergency fallback here.
|
// As per XEP-0004, text-single is the default form field type, which we use as emergency fallback here.
|
||||||
type = FormField.Type.text_single;
|
type = FormField.Type.text_single;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class OpenIQProviderTest extends SmackTestSuite {
|
||||||
|
|
||||||
OpenIQProvider oip = new OpenIQProvider();
|
OpenIQProvider oip = new OpenIQProvider();
|
||||||
XmlPullParser parser = PacketParserUtils.getParserFor(control);
|
XmlPullParser parser = PacketParserUtils.getParserFor(control);
|
||||||
Open open = oip.parse(parser, null);
|
Open open = oip.parse(parser);
|
||||||
|
|
||||||
assertEquals(StanzaType.IQ, open.getStanza());
|
assertEquals(StanzaType.IQ, open.getStanza());
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public class OpenIQProviderTest extends SmackTestSuite {
|
||||||
|
|
||||||
OpenIQProvider oip = new OpenIQProvider();
|
OpenIQProvider oip = new OpenIQProvider();
|
||||||
XmlPullParser parser = PacketParserUtils.getParserFor(control);
|
XmlPullParser parser = PacketParserUtils.getParserFor(control);
|
||||||
Open open = oip.parse(parser, null);
|
Open open = oip.parse(parser);
|
||||||
|
|
||||||
assertEquals(StanzaType.MESSAGE, open.getStanza());
|
assertEquals(StanzaType.MESSAGE, open.getStanza());
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,9 +19,8 @@ package org.jivesoftware.smack.roster.provider;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.roster.packet.RosterPacket;
|
import org.jivesoftware.smack.roster.packet.RosterPacket;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
@ -30,12 +29,12 @@ import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
import org.jxmpp.jid.BareJid;
|
import org.jxmpp.jid.BareJid;
|
||||||
import org.jxmpp.jid.impl.JidCreate;
|
import org.jxmpp.jid.impl.JidCreate;
|
||||||
|
|
||||||
public class RosterPacketProvider extends IqProvider<RosterPacket> {
|
public class RosterPacketProvider extends IQProvider<RosterPacket> {
|
||||||
|
|
||||||
public static final RosterPacketProvider INSTANCE = new RosterPacketProvider();
|
public static final RosterPacketProvider INSTANCE = new RosterPacketProvider();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RosterPacket parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public RosterPacket parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
RosterPacket roster = new RosterPacket();
|
RosterPacket roster = new RosterPacket();
|
||||||
String version = parser.getAttributeValue("", "ver");
|
String version = parser.getAttributeValue("", "ver");
|
||||||
roster.setVersion(version);
|
roster.setVersion(version);
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.jivesoftware.smack.SmackConfiguration;
|
||||||
import org.jivesoftware.smack.filter.PacketFilter;
|
import org.jivesoftware.smack.filter.PacketFilter;
|
||||||
import org.jivesoftware.smack.filter.StanzaTypeFilter;
|
import org.jivesoftware.smack.filter.StanzaTypeFilter;
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.provider.ProviderManager;
|
import org.jivesoftware.smack.provider.ProviderManager;
|
||||||
import org.jivesoftware.smack.test.SmackTestCase;
|
import org.jivesoftware.smack.test.SmackTestCase;
|
||||||
import org.jivesoftware.smackx.jingle.packet.Jingle;
|
import org.jivesoftware.smackx.jingle.packet.Jingle;
|
||||||
|
|
|
@ -30,9 +30,8 @@ import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||||
import org.jivesoftware.smack.XMPPConnection;
|
import org.jivesoftware.smack.XMPPConnection;
|
||||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.provider.ProviderManager;
|
import org.jivesoftware.smack.provider.ProviderManager;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -331,10 +330,10 @@ public class RTPBridge extends IQ {
|
||||||
*
|
*
|
||||||
* @author Thiago Rocha
|
* @author Thiago Rocha
|
||||||
*/
|
*/
|
||||||
public static class Provider extends IqProvider<RTPBridge> {
|
public static class Provider extends IQProvider<RTPBridge> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RTPBridge parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public RTPBridge parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException,
|
throws XmlPullParserException,
|
||||||
IOException {
|
IOException {
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,9 @@ import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||||
import org.jivesoftware.smack.XMPPConnection;
|
import org.jivesoftware.smack.XMPPConnection;
|
||||||
import org.jivesoftware.smack.XMPPException;
|
import org.jivesoftware.smack.XMPPException;
|
||||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.SimpleIQ;
|
import org.jivesoftware.smack.packet.SimpleIQ;
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.provider.ProviderManager;
|
import org.jivesoftware.smack.provider.ProviderManager;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -119,10 +118,10 @@ public class STUN extends SimpleIQ {
|
||||||
*
|
*
|
||||||
* @author Thiago Rocha
|
* @author Thiago Rocha
|
||||||
*/
|
*/
|
||||||
public static class Provider extends IqProvider<STUN> {
|
public static class Provider extends IQProvider<STUN> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public STUN parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public STUN parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException,
|
throws XmlPullParserException,
|
||||||
IOException {
|
IOException {
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,10 @@ package org.jivesoftware.smackx.jingleold.provider;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -42,7 +41,7 @@ import org.jxmpp.jid.Jid;
|
||||||
*
|
*
|
||||||
* @author Alvaro Saurin
|
* @author Alvaro Saurin
|
||||||
*/
|
*/
|
||||||
public class JingleProvider extends IqProvider<Jingle> {
|
public class JingleProvider extends IQProvider<Jingle> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a iq/jingle element.
|
* Parse a iq/jingle element.
|
||||||
|
@ -51,7 +50,7 @@ public class JingleProvider extends IqProvider<Jingle> {
|
||||||
* @throws SmackParsingException if the Smack parser (provider) encountered invalid input.
|
* @throws SmackParsingException if the Smack parser (provider) encountered invalid input.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Jingle parse(XmlPullParser parser, int intialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws IOException, XmlPullParserException, SmackParsingException {
|
public Jingle parse(XmlPullParser parser, int intialDepth, XmlEnvironment xmlEnvironment) throws IOException, XmlPullParserException, SmackParsingException {
|
||||||
|
|
||||||
Jingle jingle = new Jingle();
|
Jingle jingle = new Jingle();
|
||||||
String sid;
|
String sid;
|
||||||
|
|
|
@ -22,10 +22,9 @@ import java.io.IOException;
|
||||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||||
import org.jivesoftware.smack.XMPPConnection;
|
import org.jivesoftware.smack.XMPPConnection;
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.SimpleIQ;
|
import org.jivesoftware.smack.packet.SimpleIQ;
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -62,10 +61,10 @@ public class OfferConfirmation extends SimpleIQ {
|
||||||
con.sendStanza(packet);
|
con.sendStanza(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Provider extends IqProvider<OfferConfirmation> {
|
public static class Provider extends IQProvider<OfferConfirmation> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OfferConfirmation parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public OfferConfirmation parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException, IOException {
|
throws XmlPullParserException, IOException {
|
||||||
final OfferConfirmation confirmation = new OfferConfirmation();
|
final OfferConfirmation confirmation = new OfferConfirmation();
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,10 @@ package org.jivesoftware.smackx.workgroup.ext.forms;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.SimpleIQ;
|
import org.jivesoftware.smack.packet.SimpleIQ;
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -49,10 +48,10 @@ public class WorkgroupForm extends SimpleIQ {
|
||||||
*
|
*
|
||||||
* @author Derek DeMoro
|
* @author Derek DeMoro
|
||||||
*/
|
*/
|
||||||
public static class InternalProvider extends IqProvider<WorkgroupForm> {
|
public static class InternalProvider extends IQProvider<WorkgroupForm> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorkgroupForm parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
public WorkgroupForm parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
WorkgroupForm answer = new WorkgroupForm();
|
WorkgroupForm answer = new WorkgroupForm();
|
||||||
|
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
|
|
@ -24,9 +24,8 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -92,10 +91,10 @@ public class AgentChatHistory extends IQ {
|
||||||
/**
|
/**
|
||||||
* Stanza extension provider for AgentHistory packets.
|
* Stanza extension provider for AgentHistory packets.
|
||||||
*/
|
*/
|
||||||
public static class InternalProvider extends IqProvider<AgentChatHistory> {
|
public static class InternalProvider extends IQProvider<AgentChatHistory> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AgentChatHistory parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public AgentChatHistory parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
if (parser.getEventType() != XmlPullParser.Event.START_ELEMENT) {
|
if (parser.getEventType() != XmlPullParser.Event.START_ELEMENT) {
|
||||||
throw new IllegalStateException("Parser not in proper position, or bad XML.");
|
throw new IllegalStateException("Parser not in proper position, or bad XML.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,8 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -82,10 +81,10 @@ public class ChatMetadata extends IQ {
|
||||||
*
|
*
|
||||||
* @author Derek DeMoro
|
* @author Derek DeMoro
|
||||||
*/
|
*/
|
||||||
public static class Provider extends IqProvider<ChatMetadata> {
|
public static class Provider extends IQProvider<ChatMetadata> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ChatMetadata parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public ChatMetadata parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException, IOException {
|
throws XmlPullParserException, IOException {
|
||||||
final ChatMetadata chatM = new ChatMetadata();
|
final ChatMetadata chatM = new ChatMetadata();
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,8 @@ package org.jivesoftware.smackx.workgroup.ext.macros;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||||
import org.jivesoftware.smack.util.StringUtils;
|
import org.jivesoftware.smack.util.StringUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
@ -97,10 +96,10 @@ public class Macros extends IQ {
|
||||||
*
|
*
|
||||||
* @author Derek DeMoro
|
* @author Derek DeMoro
|
||||||
*/
|
*/
|
||||||
public static class InternalProvider extends IqProvider<Macros> {
|
public static class InternalProvider extends IQProvider<Macros> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Macros parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public Macros parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
Macros macroGroup = new Macros();
|
Macros macroGroup = new Macros();
|
||||||
|
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
|
|
@ -20,9 +20,8 @@ package org.jivesoftware.smackx.workgroup.ext.notes;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -82,10 +81,10 @@ public class ChatNotes extends IQ {
|
||||||
*
|
*
|
||||||
* @author Derek DeMoro
|
* @author Derek DeMoro
|
||||||
*/
|
*/
|
||||||
public static class Provider extends IqProvider<ChatNotes> {
|
public static class Provider extends IQProvider<ChatNotes> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ChatNotes parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public ChatNotes parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
ChatNotes chatNotes = new ChatNotes();
|
ChatNotes chatNotes = new ChatNotes();
|
||||||
|
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
|
|
@ -20,9 +20,8 @@ package org.jivesoftware.smackx.workgroup.packet;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -105,10 +104,10 @@ public class AgentInfo extends IQ {
|
||||||
*
|
*
|
||||||
* @author Gaston Dombiak
|
* @author Gaston Dombiak
|
||||||
*/
|
*/
|
||||||
public static class Provider extends IqProvider<AgentInfo> {
|
public static class Provider extends IQProvider<AgentInfo> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AgentInfo parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public AgentInfo parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
AgentInfo answer = new AgentInfo();
|
AgentInfo answer = new AgentInfo();
|
||||||
|
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
|
|
@ -24,9 +24,8 @@ import java.util.Iterator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -112,10 +111,10 @@ public class AgentStatusRequest extends IQ {
|
||||||
/**
|
/**
|
||||||
* Stanza extension provider for AgentStatusRequest packets.
|
* Stanza extension provider for AgentStatusRequest packets.
|
||||||
*/
|
*/
|
||||||
public static class Provider extends IqProvider<AgentStatusRequest> {
|
public static class Provider extends IQProvider<AgentStatusRequest> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AgentStatusRequest parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public AgentStatusRequest parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
AgentStatusRequest statusRequest = new AgentStatusRequest();
|
AgentStatusRequest statusRequest = new AgentStatusRequest();
|
||||||
|
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
|
|
@ -24,9 +24,8 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -104,10 +103,10 @@ public class AgentWorkgroups extends IQ {
|
||||||
*
|
*
|
||||||
* @author Gaston Dombiak
|
* @author Gaston Dombiak
|
||||||
*/
|
*/
|
||||||
public static class Provider extends IqProvider<AgentWorkgroups> {
|
public static class Provider extends IQProvider<AgentWorkgroups> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AgentWorkgroups parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public AgentWorkgroups parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
final Jid agentJID = ParserUtils.getJidAttribute(parser);
|
final Jid agentJID = ParserUtils.getJidAttribute(parser);
|
||||||
List<String> workgroups = new ArrayList<>();
|
List<String> workgroups = new ArrayList<>();
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,8 @@ package org.jivesoftware.smackx.workgroup.packet;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -76,10 +75,10 @@ public class MonitorPacket extends IQ {
|
||||||
/**
|
/**
|
||||||
* Stanza extension provider for Monitor Packets.
|
* Stanza extension provider for Monitor Packets.
|
||||||
*/
|
*/
|
||||||
public static class InternalProvider extends IqProvider<MonitorPacket> {
|
public static class InternalProvider extends IQProvider<MonitorPacket> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MonitorPacket parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public MonitorPacket parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
MonitorPacket packet = new MonitorPacket();
|
MonitorPacket packet = new MonitorPacket();
|
||||||
|
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
|
|
@ -27,9 +27,8 @@ import java.util.Set;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -133,10 +132,10 @@ public class OccupantsInfo extends IQ {
|
||||||
/**
|
/**
|
||||||
* Stanza extension provider for AgentStatusRequest packets.
|
* Stanza extension provider for AgentStatusRequest packets.
|
||||||
*/
|
*/
|
||||||
public static class Provider extends IqProvider<OccupantsInfo> {
|
public static class Provider extends IQProvider<OccupantsInfo> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OccupantsInfo parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public OccupantsInfo parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException, IOException, ParseException {
|
throws XmlPullParserException, IOException, ParseException {
|
||||||
OccupantsInfo occupantsInfo = new OccupantsInfo(parser.getAttributeValue("", "roomID"));
|
OccupantsInfo occupantsInfo = new OccupantsInfo(parser.getAttributeValue("", "roomID"));
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,9 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
@ -46,14 +45,14 @@ import org.jxmpp.jid.Jid;
|
||||||
*
|
*
|
||||||
* @author loki der quaeler
|
* @author loki der quaeler
|
||||||
*/
|
*/
|
||||||
public class OfferRequestProvider extends IqProvider<IQ> {
|
public class OfferRequestProvider extends IQProvider<IQ> {
|
||||||
// FIXME It seems because OfferRequestPacket is also defined here, we can
|
// FIXME It seems because OfferRequestPacket is also defined here, we can
|
||||||
// not add it as generic to the provider, the provider and the packet should
|
// not add it as generic to the provider, the provider and the packet should
|
||||||
// be split, but since this is legacy code, I don't think that this will
|
// be split, but since this is legacy code, I don't think that this will
|
||||||
// happen anytime soon.
|
// happen anytime soon.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OfferRequestPacket parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
public OfferRequestPacket parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
XmlPullParser.Event eventType = parser.getEventType();
|
XmlPullParser.Event eventType = parser.getEventType();
|
||||||
String sessionID = null;
|
String sessionID = null;
|
||||||
int timeout = -1;
|
int timeout = -1;
|
||||||
|
|
|
@ -20,9 +20,8 @@ package org.jivesoftware.smackx.workgroup.packet;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -34,10 +33,10 @@ import org.jxmpp.jid.Jid;
|
||||||
*
|
*
|
||||||
* @author loki der quaeler
|
* @author loki der quaeler
|
||||||
*/
|
*/
|
||||||
public class OfferRevokeProvider extends IqProvider<IQ> {
|
public class OfferRevokeProvider extends IQProvider<IQ> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OfferRevokePacket parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
public OfferRevokePacket parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
|
||||||
// The parser will be positioned on the opening IQ tag, so get the JID attribute.
|
// The parser will be positioned on the opening IQ tag, so get the JID attribute.
|
||||||
Jid userJID = ParserUtils.getJidAttribute(parser);
|
Jid userJID = ParserUtils.getJidAttribute(parser);
|
||||||
// Default the userID to the JID.
|
// Default the userID to the JID.
|
||||||
|
|
|
@ -21,11 +21,10 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.Stanza;
|
import org.jivesoftware.smack.packet.Stanza;
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -35,10 +34,10 @@ import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
*
|
*
|
||||||
* @author Gaston Dombiak
|
* @author Gaston Dombiak
|
||||||
*/
|
*/
|
||||||
public class TranscriptProvider extends IqProvider<Transcript> {
|
public class TranscriptProvider extends IQProvider<Transcript> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Transcript parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
public Transcript parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
String sessionID = parser.getAttributeValue("", "sessionID");
|
String sessionID = parser.getAttributeValue("", "sessionID");
|
||||||
List<Stanza> packets = new ArrayList<>();
|
List<Stanza> packets = new ArrayList<>();
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,10 @@ package org.jivesoftware.smackx.workgroup.packet;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.SimpleIQ;
|
import org.jivesoftware.smack.packet.SimpleIQ;
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
import org.jivesoftware.smack.parsing.SmackParsingException;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -55,10 +54,10 @@ public class TranscriptSearch extends SimpleIQ {
|
||||||
*
|
*
|
||||||
* @author Gaston Dombiak
|
* @author Gaston Dombiak
|
||||||
*/
|
*/
|
||||||
public static class Provider extends IqProvider<TranscriptSearch> {
|
public static class Provider extends IQProvider<TranscriptSearch> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TranscriptSearch parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
public TranscriptSearch parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
|
||||||
TranscriptSearch answer = new TranscriptSearch();
|
TranscriptSearch answer = new TranscriptSearch();
|
||||||
|
|
||||||
boolean done = false;
|
boolean done = false;
|
||||||
|
|
|
@ -25,9 +25,8 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.IqData;
|
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.IqProvider;
|
import org.jivesoftware.smack.provider.IQProvider;
|
||||||
import org.jivesoftware.smack.util.ParserUtils;
|
import org.jivesoftware.smack.util.ParserUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -39,7 +38,7 @@ import org.jxmpp.jid.Jid;
|
||||||
*
|
*
|
||||||
* @author Gaston Dombiak
|
* @author Gaston Dombiak
|
||||||
*/
|
*/
|
||||||
public class TranscriptsProvider extends IqProvider<Transcripts> {
|
public class TranscriptsProvider extends IQProvider<Transcripts> {
|
||||||
|
|
||||||
@SuppressWarnings("DateFormatConstant")
|
@SuppressWarnings("DateFormatConstant")
|
||||||
private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
|
private static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
|
||||||
|
@ -48,7 +47,7 @@ public class TranscriptsProvider extends IqProvider<Transcripts> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Transcripts parse(XmlPullParser parser, int initialDepth, IqData iqData, XmlEnvironment xmlEnvironment)
|
public Transcripts parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)
|
||||||
throws XmlPullParserException, IOException, TextParseException, ParseException {
|
throws XmlPullParserException, IOException, TextParseException, ParseException {
|
||||||
Jid userID = ParserUtils.getJidAttribute(parser, "userID");
|
Jid userID = ParserUtils.getJidAttribute(parser, "userID");
|
||||||
List<Transcripts.TranscriptSummary> summaries = new ArrayList<>();
|
List<Transcripts.TranscriptSummary> summaries = new ArrayList<>();
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue