mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-01 16:32:08 +01:00
Compare commits
No commits in common. "adfca965b5c9e8e75f7481fb7bd9aa9420650dc1" and "10aee6c787c0665df3726e1433d82f60d9f4dc2c" have entirely different histories.
adfca965b5
...
10aee6c787
25 changed files with 700 additions and 410 deletions
|
@ -1,7 +1,7 @@
|
||||||
Smack
|
Smack
|
||||||
=====
|
=====
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/igniterealtime/Smack.svg?branch=master)](https://travis-ci.org/igniterealtime/Smack) [![Coverage Status](https://coveralls.io/repos/igniterealtime/Smack/badge.svg)](https://coveralls.io/r/igniterealtime/Smack) [![Project Stats](https://www.openhub.net/p/smack/widgets/project_thin_badge.gif)](https://www.openhub.net/p/smack) [![Link to XMPP chat smack@conference.igniterealtime.org](https://inverse.chat/badge.svg?room=smack@conference.igniterealtime.org)](https://inverse.chat/#converse/room?jid=smack@conference.igniterealtime.org)
|
[![Build Status](https://travis-ci.org/igniterealtime/Smack.svg?branch=master)](https://travis-ci.org/igniterealtime/Smack) [![Coverage Status](https://coveralls.io/repos/igniterealtime/Smack/badge.svg)](https://coveralls.io/r/igniterealtime/Smack) [![Project Stats](https://www.openhub.net/p/smack/widgets/project_thin_badge.gif)](https://www.openhub.net/p/smack) [![Visit our IRC channel](https://kiwiirc.com/buttons/irc.freenode.net/smack.png)](https://kiwiirc.com/client/irc.freenode.net/smack)
|
||||||
|
|
||||||
About
|
About
|
||||||
-----
|
-----
|
||||||
|
|
|
@ -59,6 +59,7 @@ allprojects {
|
||||||
':smack-android',
|
':smack-android',
|
||||||
':smack-android-extensions',
|
':smack-android-extensions',
|
||||||
':smack-bosh',
|
':smack-bosh',
|
||||||
|
':smack-compression-jzlib',
|
||||||
':smack-debug',
|
':smack-debug',
|
||||||
':smack-debug-slf4j',
|
':smack-debug-slf4j',
|
||||||
':smack-java7',
|
':smack-java7',
|
||||||
|
|
|
@ -16,6 +16,7 @@ include 'smack-core',
|
||||||
'smack-resolver-javax',
|
'smack-resolver-javax',
|
||||||
'smack-sasl-javax',
|
'smack-sasl-javax',
|
||||||
'smack-sasl-provided',
|
'smack-sasl-provided',
|
||||||
|
'smack-compression-jzlib',
|
||||||
'smack-legacy',
|
'smack-legacy',
|
||||||
'smack-jingle-old',
|
'smack-jingle-old',
|
||||||
'smack-bosh',
|
'smack-bosh',
|
||||||
|
|
8
smack-compression-jzlib/build.gradle
Normal file
8
smack-compression-jzlib/build.gradle
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
description = """\
|
||||||
|
Compression with jzlib
|
||||||
|
Allow to compress the XMPP stream with help of jzlib."""
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile project(':smack-core')
|
||||||
|
compile 'com.jcraft:jzlib:[1.1,1.2)'
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Copyright 2013-2014 Florian Schmaus
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.jivesoftware.smack.compression.jzlib;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
|
import org.jivesoftware.smack.SmackConfiguration;
|
||||||
|
import org.jivesoftware.smack.compression.XMPPInputOutputStream;
|
||||||
|
|
||||||
|
import com.jcraft.jzlib.DeflaterOutputStream;
|
||||||
|
import com.jcraft.jzlib.InflaterInputStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class provides XMPP "zlib" compression with the help of JZLib.
|
||||||
|
*
|
||||||
|
* @author Florian Schmaus
|
||||||
|
* @see <a href="http://www.jcraft.com/jzlib/">JZLib</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class JzlibInputOutputStream extends XMPPInputOutputStream {
|
||||||
|
|
||||||
|
static {
|
||||||
|
SmackConfiguration.addCompressionHandler(new JzlibInputOutputStream());
|
||||||
|
}
|
||||||
|
|
||||||
|
public JzlibInputOutputStream() {
|
||||||
|
super("zlib");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSupported() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InputStream getInputStream(InputStream inputStream) throws IOException {
|
||||||
|
final InflaterInputStream is = new InflaterInputStream(inputStream);
|
||||||
|
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OutputStream getOutputStream(OutputStream outputStream) throws IOException {
|
||||||
|
final DeflaterOutputStream os = new DeflaterOutputStream(outputStream);
|
||||||
|
if (flushMethod == FlushMethod.SYNC_FLUSH) {
|
||||||
|
os.setSyncFlush(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Copyright 2015 Florian Schmaus
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Support for XMPP stream compression (XEP-138) via JZlib.
|
||||||
|
*/
|
||||||
|
package org.jivesoftware.smack.compression.jzlib;
|
|
@ -0,0 +1 @@
|
||||||
|
../../../../../../../../smack-core/src/main/java/org/jivesoftware/smack/compression/package-info.java
|
|
@ -25,7 +25,6 @@ import org.jivesoftware.smack.filter.ThreadFilter;
|
||||||
*
|
*
|
||||||
* @author Gaston Dombiak
|
* @author Gaston Dombiak
|
||||||
*/
|
*/
|
||||||
// sinttest candidate
|
|
||||||
public class FloodTest extends SmackTestCase {
|
public class FloodTest extends SmackTestCase {
|
||||||
|
|
||||||
public FloodTest(String arg0) {
|
public FloodTest(String arg0) {
|
||||||
|
|
|
@ -30,7 +30,6 @@ import org.jivesoftware.smackx.packet.Version;
|
||||||
*
|
*
|
||||||
* @author Gaston Dombiak
|
* @author Gaston Dombiak
|
||||||
*/
|
*/
|
||||||
// sinttest candidate
|
|
||||||
public class IQTest extends SmackTestCase {
|
public class IQTest extends SmackTestCase {
|
||||||
|
|
||||||
public IQTest(String arg0) {
|
public IQTest(String arg0) {
|
||||||
|
|
|
@ -27,7 +27,6 @@ import org.jivesoftware.smack.test.SmackTestCase;
|
||||||
*
|
*
|
||||||
* @author Gaston Dombiak
|
* @author Gaston Dombiak
|
||||||
*/
|
*/
|
||||||
// sinttest candidate
|
|
||||||
public class MessageTest extends SmackTestCase {
|
public class MessageTest extends SmackTestCase {
|
||||||
|
|
||||||
public MessageTest(String arg0) {
|
public MessageTest(String arg0) {
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Copyright 2005 Jive Software.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jivesoftware.smack.util;
|
||||||
|
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A test case for the Cache class.
|
||||||
|
*/
|
||||||
|
public class CacheTest extends TestCase {
|
||||||
|
|
||||||
|
public void testMaxSize() {
|
||||||
|
Cache<Integer, String> cache = new Cache<Integer, String>(100, -1);
|
||||||
|
for (int i=0; i < 1000; i++) {
|
||||||
|
cache.put(i, "value");
|
||||||
|
assertTrue("Cache size must never be larger than 100.", cache.size() <= 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testLRU() {
|
||||||
|
Cache<Integer, String> cache = new Cache<Integer, String>(100, -1);
|
||||||
|
for (int i=0; i < 1000; i++) {
|
||||||
|
cache.put(i, "value");
|
||||||
|
assertTrue("LRU algorithm for cache key of '0' failed.",
|
||||||
|
cache.get(new Integer(0)) != null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package org.jivesoftware.smack.util;
|
||||||
|
|
||||||
|
import org.jivesoftware.smack.XMPPConnection;
|
||||||
|
import org.jivesoftware.smack.Roster;
|
||||||
|
import org.jivesoftware.smack.XMPPException;
|
||||||
|
|
||||||
|
public class ConnectionUtils {
|
||||||
|
|
||||||
|
private ConnectionUtils() {}
|
||||||
|
|
||||||
|
public static void becomeFriends(XMPPConnection con0, XMPPConnection con1) throws XMPPException {
|
||||||
|
Roster r0 = con0.getRoster();
|
||||||
|
Roster r1 = con1.getRoster();
|
||||||
|
r0.setSubscriptionMode(Roster.SubscriptionMode.accept_all);
|
||||||
|
r1.setSubscriptionMode(Roster.SubscriptionMode.accept_all);
|
||||||
|
r0.createEntry(con1.getUser(), "u2", null);
|
||||||
|
r1.createEntry(con0.getUser(), "u1", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void letsAllBeFriends(XMPPConnection[] connections) throws XMPPException {
|
||||||
|
for (XMPPConnection c1 : connections) {
|
||||||
|
for (XMPPConnection c2 : connections) {
|
||||||
|
if (c1 == c2)
|
||||||
|
continue;
|
||||||
|
becomeFriends(c1, c2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,7 +16,6 @@ import org.jivesoftware.smack.util.dns.JavaxResolver;
|
||||||
import org.jivesoftware.smack.util.dns.SRVRecord;
|
import org.jivesoftware.smack.util.dns.SRVRecord;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
// minidns candidate?
|
|
||||||
public class DNSUtilTest {
|
public class DNSUtilTest {
|
||||||
private static final String igniterealtimeDomain = "igniterealtime.org";
|
private static final String igniterealtimeDomain = "igniterealtime.org";
|
||||||
private static final String igniterealtimeXMPPServer = "xmpp." + igniterealtimeDomain;
|
private static final String igniterealtimeXMPPServer = "xmpp." + igniterealtimeDomain;
|
||||||
|
|
|
@ -0,0 +1,203 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Copyright 2006 Jive Software.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.jivesoftware.smack.util;
|
||||||
|
|
||||||
|
import java.io.StringReader;
|
||||||
|
|
||||||
|
import org.jivesoftware.smack.packet.XMPPError;
|
||||||
|
import org.jivesoftware.smack.test.SmackTestCase;
|
||||||
|
import org.jivesoftware.smack.xml.XmlPullParserFactory;
|
||||||
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
public class XMPPErrorTest extends SmackTestCase {
|
||||||
|
|
||||||
|
public XMPPErrorTest(String arg0) {
|
||||||
|
super(arg0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the creation of a new xmppError locally.
|
||||||
|
*/
|
||||||
|
public void testLocalErrorCreation() {
|
||||||
|
XMPPError error = new XMPPError(XMPPError.Condition.item_not_found);
|
||||||
|
error.toXML();
|
||||||
|
|
||||||
|
assertEquals(error.getCondition(), "item-not-found");
|
||||||
|
assertEquals(error.getCode(), 404);
|
||||||
|
assertEquals(error.getType(), XMPPError.Type.CANCEL);
|
||||||
|
assertNull(error.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the creation of a new xmppError locally.
|
||||||
|
*/
|
||||||
|
public void testLocalErrorWithCommentCreation() {
|
||||||
|
String message = "Error Message";
|
||||||
|
XMPPError error = new XMPPError(XMPPError.Condition.item_not_found, message);
|
||||||
|
error.toXML();
|
||||||
|
|
||||||
|
assertEquals(error.getCondition(), "item-not-found");
|
||||||
|
assertEquals(error.getCode(), 404);
|
||||||
|
assertEquals(error.getType(), XMPPError.Type.CANCEL);
|
||||||
|
assertEquals(error.getMessage(), message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the creation of a new xmppError locally where there is not a default defined.
|
||||||
|
*/
|
||||||
|
public void testUserDefinedErrorWithCommentCreation() {
|
||||||
|
String message = "Error Message";
|
||||||
|
XMPPError error = new XMPPError(new XMPPError.Condition("my_own_error"), message);
|
||||||
|
error.toXML();
|
||||||
|
|
||||||
|
assertEquals(error.getCondition(), "my_own_error");
|
||||||
|
assertEquals(error.getCode(), 0);
|
||||||
|
assertNull(error.getType());
|
||||||
|
assertEquals(error.getMessage(), message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the parser with an xml with the 404 error.
|
||||||
|
*/
|
||||||
|
public void test404() {
|
||||||
|
// Make the XML to test
|
||||||
|
String xml = "<error code='404' type='cancel'>" +
|
||||||
|
"<item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>" +
|
||||||
|
"</error></iq>";
|
||||||
|
try {
|
||||||
|
// Create the xml parser
|
||||||
|
XmlPullParser parser = getParserFromXML(xml);
|
||||||
|
// Create a packet from the xml
|
||||||
|
XMPPError packet = parseError(parser);
|
||||||
|
|
||||||
|
assertNotNull(packet);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the parser with an xml with the 404 error.
|
||||||
|
*/
|
||||||
|
public void testCancel() {
|
||||||
|
// Make the XML to test
|
||||||
|
String xml = "<error type='cancel'>" +
|
||||||
|
"<conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>" +
|
||||||
|
"</error>";
|
||||||
|
try {
|
||||||
|
// Create the xml parser
|
||||||
|
XmlPullParser parser = getParserFromXML(xml);
|
||||||
|
// Create a packet from the xml
|
||||||
|
XMPPError error = parseError(parser);
|
||||||
|
|
||||||
|
assertNotNull(error);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testMessageAndApplicationDefinedError() {
|
||||||
|
String xml = "<error type='modify' code='404'>" +
|
||||||
|
"<undefined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>" +
|
||||||
|
"<text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>" +
|
||||||
|
"Some special application diagnostic information..." +
|
||||||
|
"</text>" +
|
||||||
|
"<special-application-condition xmlns='application-ns'/>" +
|
||||||
|
"</error>";
|
||||||
|
try {
|
||||||
|
// Create the xml parser
|
||||||
|
XmlPullParser parser = getParserFromXML(xml);
|
||||||
|
// Create a packet from the xml
|
||||||
|
XMPPError error = parseError(parser);
|
||||||
|
|
||||||
|
String sendingXML = error.toXML();
|
||||||
|
|
||||||
|
assertNotNull(error);
|
||||||
|
assertNotNull(sendingXML);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Check the parser with an xml with the 404 error.
|
||||||
|
*/
|
||||||
|
public void testCancelWithMessage() {
|
||||||
|
// Make the XML to test
|
||||||
|
String xml = "<error type='cancel'>" +
|
||||||
|
"<conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>" +
|
||||||
|
"<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang='langcode'>" +
|
||||||
|
"Some special application diagnostic information!" +
|
||||||
|
"</text>" +
|
||||||
|
"</error>";
|
||||||
|
try {
|
||||||
|
// Create the xml parser
|
||||||
|
XmlPullParser parser = getParserFromXML(xml);
|
||||||
|
// Create a packet from the xml
|
||||||
|
XMPPError error = parseError(parser);
|
||||||
|
|
||||||
|
assertNotNull(error);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the parser with an xml with the 404 error.
|
||||||
|
*/
|
||||||
|
public void testCancelWithMessageAndApplicationError() {
|
||||||
|
// Make the XML to test
|
||||||
|
String xml = "<error type='cancel' code='10'>" +
|
||||||
|
"<conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>" +
|
||||||
|
"<text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>" +
|
||||||
|
"Some special application diagnostic information!" +
|
||||||
|
"</text>" +
|
||||||
|
"<application-defined-error xmlns='application-ns'/>" +
|
||||||
|
"</error>";
|
||||||
|
try {
|
||||||
|
// Create the xml parser
|
||||||
|
XmlPullParser parser = getParserFromXML(xml);
|
||||||
|
// Create a packet from the xml
|
||||||
|
XMPPError error = parseError(parser);
|
||||||
|
|
||||||
|
assertNotNull(error);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private XMPPError parseError(XmlPullParser parser) throws Exception {
|
||||||
|
parser.next();
|
||||||
|
return PacketParserUtils.parseError(parser);
|
||||||
|
}
|
||||||
|
|
||||||
|
private XmlPullParser getParserFromXML(String xml) throws XmlPullParserException {
|
||||||
|
XmlPullParser parser = XmlPullParserFactory.newInstance().newPullParser();
|
||||||
|
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
|
||||||
|
parser.setInput(new StringReader(xml));
|
||||||
|
return parser;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int getMaxConnections() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -107,7 +107,7 @@ public final class SmackInitialization {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the Java7 compression handler first, since it's preferred
|
// Add the Java7 compression handler first, since it's preferred
|
||||||
SmackConfiguration.addCompressionHandler(new Java7ZlibInputOutputStream());
|
SmackConfiguration.compressionHandlers.add(new Java7ZlibInputOutputStream());
|
||||||
|
|
||||||
XmppCompressionManager.registerXmppCompressionFactory(ZlibXmppCompressionFactory.INSTANCE);
|
XmppCompressionManager.registerXmppCompressionFactory(ZlibXmppCompressionFactory.INSTANCE);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2013-2020 Florian Schmaus
|
* Copyright 2013-2018 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.
|
||||||
|
@ -19,6 +19,8 @@ package org.jivesoftware.smack.compression;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.util.zip.Deflater;
|
import java.util.zip.Deflater;
|
||||||
import java.util.zip.DeflaterOutputStream;
|
import java.util.zip.DeflaterOutputStream;
|
||||||
import java.util.zip.Inflater;
|
import java.util.zip.Inflater;
|
||||||
|
@ -39,15 +41,31 @@ import java.util.zip.InflaterInputStream;
|
||||||
* @author Florian Schmaus
|
* @author Florian Schmaus
|
||||||
*/
|
*/
|
||||||
public class Java7ZlibInputOutputStream extends XMPPInputOutputStream {
|
public class Java7ZlibInputOutputStream extends XMPPInputOutputStream {
|
||||||
|
private static final Method method;
|
||||||
|
private static final boolean supported;
|
||||||
private static final int compressionLevel = Deflater.DEFAULT_COMPRESSION;
|
private static final int compressionLevel = Deflater.DEFAULT_COMPRESSION;
|
||||||
|
|
||||||
|
private static final int SYNC_FLUSH_INT = 2;
|
||||||
|
private static final int FULL_FLUSH_INT = 3;
|
||||||
|
|
||||||
|
static {
|
||||||
|
Method m = null;
|
||||||
|
try {
|
||||||
|
m = Deflater.class.getMethod("deflate", byte[].class, int.class, int.class, int.class);
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
}
|
||||||
|
method = m;
|
||||||
|
supported = method != null;
|
||||||
|
}
|
||||||
|
|
||||||
public Java7ZlibInputOutputStream() {
|
public Java7ZlibInputOutputStream() {
|
||||||
super("zlib");
|
super("zlib");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSupported() {
|
public boolean isSupported() {
|
||||||
return true;
|
return supported;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -83,23 +101,29 @@ public class Java7ZlibInputOutputStream extends XMPPInputOutputStream {
|
||||||
@Override
|
@Override
|
||||||
public OutputStream getOutputStream(OutputStream outputStream) {
|
public OutputStream getOutputStream(OutputStream outputStream) {
|
||||||
final int flushMethodInt;
|
final int flushMethodInt;
|
||||||
switch (flushMethod) {
|
if (flushMethod == FlushMethod.SYNC_FLUSH) {
|
||||||
case SYNC_FLUSH:
|
flushMethodInt = SYNC_FLUSH_INT;
|
||||||
flushMethodInt = Deflater.SYNC_FLUSH;
|
} else {
|
||||||
break;
|
flushMethodInt = FULL_FLUSH_INT;
|
||||||
case FULL_FLUSH:
|
|
||||||
flushMethodInt = Deflater.FULL_FLUSH;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new AssertionError();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new DeflaterOutputStream(outputStream, new Deflater(compressionLevel)) {
|
return new DeflaterOutputStream(outputStream, new Deflater(compressionLevel)) {
|
||||||
@Override
|
@Override
|
||||||
public void flush() throws IOException {
|
public void flush() throws IOException {
|
||||||
int count;
|
if (!supported) {
|
||||||
while ((count = def.deflate(buf, 0, buf.length, flushMethodInt)) > 0) {
|
super.flush();
|
||||||
out.write(buf, 0, count);
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
int count;
|
||||||
|
while ((count = (Integer) method.invoke(def, buf, 0, buf.length, flushMethodInt)) != 0) {
|
||||||
|
out.write(buf, 0, count);
|
||||||
|
}
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
throw new IOException("Can't flush");
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new IOException("Can't flush");
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
|
throw new IOException("Can't flush");
|
||||||
}
|
}
|
||||||
super.flush();
|
super.flush();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright © 2017-2020 Florian Schmaus, 2016-2017 Fernando Ramirez
|
* Copyright © 2017-2019 Florian Schmaus, 2016-2017 Fernando Ramirez
|
||||||
*
|
*
|
||||||
* 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.
|
||||||
|
@ -28,14 +28,12 @@ import java.util.WeakHashMap;
|
||||||
|
|
||||||
import org.jivesoftware.smack.ConnectionCreationListener;
|
import org.jivesoftware.smack.ConnectionCreationListener;
|
||||||
import org.jivesoftware.smack.Manager;
|
import org.jivesoftware.smack.Manager;
|
||||||
import org.jivesoftware.smack.SmackException;
|
|
||||||
import org.jivesoftware.smack.SmackException.NoResponseException;
|
import org.jivesoftware.smack.SmackException.NoResponseException;
|
||||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||||
import org.jivesoftware.smack.SmackException.NotLoggedInException;
|
import org.jivesoftware.smack.SmackException.NotLoggedInException;
|
||||||
import org.jivesoftware.smack.StanzaCollector;
|
import org.jivesoftware.smack.StanzaCollector;
|
||||||
import org.jivesoftware.smack.XMPPConnection;
|
import org.jivesoftware.smack.XMPPConnection;
|
||||||
import org.jivesoftware.smack.XMPPConnectionRegistry;
|
import org.jivesoftware.smack.XMPPConnectionRegistry;
|
||||||
import org.jivesoftware.smack.XMPPException;
|
|
||||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
||||||
import org.jivesoftware.smack.filter.IQReplyFilter;
|
import org.jivesoftware.smack.filter.IQReplyFilter;
|
||||||
import org.jivesoftware.smack.packet.IQ;
|
import org.jivesoftware.smack.packet.IQ;
|
||||||
|
@ -43,11 +41,10 @@ import org.jivesoftware.smack.packet.Message;
|
||||||
import org.jivesoftware.smack.packet.Stanza;
|
import org.jivesoftware.smack.packet.Stanza;
|
||||||
import org.jivesoftware.smack.util.Objects;
|
import org.jivesoftware.smack.util.Objects;
|
||||||
import org.jivesoftware.smack.util.StringUtils;
|
import org.jivesoftware.smack.util.StringUtils;
|
||||||
import org.jivesoftware.smackx.commands.AdHocCommandManager;
|
|
||||||
import org.jivesoftware.smackx.commands.RemoteCommand;
|
|
||||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||||
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
|
|
||||||
import org.jivesoftware.smackx.forward.packet.Forwarded;
|
import org.jivesoftware.smackx.forward.packet.Forwarded;
|
||||||
|
import org.jivesoftware.smackx.mam.MamManager.MamQueryArgs;
|
||||||
import org.jivesoftware.smackx.mam.element.MamElements;
|
import org.jivesoftware.smackx.mam.element.MamElements;
|
||||||
import org.jivesoftware.smackx.mam.element.MamElements.MamResultExtension;
|
import org.jivesoftware.smackx.mam.element.MamElements.MamResultExtension;
|
||||||
import org.jivesoftware.smackx.mam.element.MamFinIQ;
|
import org.jivesoftware.smackx.mam.element.MamFinIQ;
|
||||||
|
@ -175,8 +172,6 @@ public final class MamManager extends Manager {
|
||||||
|
|
||||||
private static final Map<XMPPConnection, Map<Jid, MamManager>> INSTANCES = new WeakHashMap<>();
|
private static final Map<XMPPConnection, Map<Jid, MamManager>> INSTANCES = new WeakHashMap<>();
|
||||||
|
|
||||||
private static final String ADVANCED_CONFIG_NODE = "urn:xmpp:mam#configure";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a MamManager for the MAM archive of the local entity (the "user") of the given connection.
|
* Get a MamManager for the MAM archive of the local entity (the "user") of the given connection.
|
||||||
*
|
*
|
||||||
|
@ -221,13 +216,10 @@ public final class MamManager extends Manager {
|
||||||
|
|
||||||
private final ServiceDiscoveryManager serviceDiscoveryManager;
|
private final ServiceDiscoveryManager serviceDiscoveryManager;
|
||||||
|
|
||||||
private final AdHocCommandManager adHocCommandManager;
|
|
||||||
|
|
||||||
private MamManager(XMPPConnection connection, Jid archiveAddress) {
|
private MamManager(XMPPConnection connection, Jid archiveAddress) {
|
||||||
super(connection);
|
super(connection);
|
||||||
this.archiveAddress = archiveAddress;
|
this.archiveAddress = archiveAddress;
|
||||||
serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(connection);
|
serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(connection);
|
||||||
adHocCommandManager = AdHocCommandManager.getAddHocCommandsManager(connection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -561,6 +553,30 @@ public final class MamManager extends Manager {
|
||||||
return new MamQueryPage(cancelledResultCollector, mamFinIQ);
|
return new MamQueryPage(cancelledResultCollector, mamFinIQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MAM query result class.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@SuppressWarnings("UnusedVariable")
|
||||||
|
public static final class MamQueryResult {
|
||||||
|
public final List<Forwarded> forwardedMessages;
|
||||||
|
public final MamFinIQ mamFin;
|
||||||
|
private final String node;
|
||||||
|
private final DataForm form;
|
||||||
|
|
||||||
|
private MamQueryResult(MamQuery mamQuery) {
|
||||||
|
this(mamQuery.mamQueryPage.forwardedMessages, mamQuery.mamQueryPage.mamFin, mamQuery.node, mamQuery.form);
|
||||||
|
}
|
||||||
|
|
||||||
|
private MamQueryResult(List<Forwarded> forwardedMessages, MamFinIQ mamFin, String node, DataForm form) {
|
||||||
|
this.forwardedMessages = forwardedMessages;
|
||||||
|
this.mamFin = mamFin;
|
||||||
|
this.node = node;
|
||||||
|
this.form = form;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public final class MamQuery {
|
public final class MamQuery {
|
||||||
private final String node;
|
private final String node;
|
||||||
private final DataForm form;
|
private final DataForm form;
|
||||||
|
@ -698,25 +714,6 @@ public final class MamManager extends Manager {
|
||||||
return serviceDiscoveryManager.supportsFeature(archiveAddress, MamElements.NAMESPACE);
|
return serviceDiscoveryManager.supportsFeature(archiveAddress, MamElements.NAMESPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAdvancedConfigurationSupported() throws InterruptedException, XMPPException, SmackException {
|
|
||||||
DiscoverItems discoverItems = adHocCommandManager.discoverCommands(archiveAddress);
|
|
||||||
for (DiscoverItems.Item item : discoverItems.getItems()) {
|
|
||||||
if (item.getNode().equals(ADVANCED_CONFIG_NODE)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RemoteCommand getAdvancedConfigurationCommand() throws InterruptedException, XMPPException, SmackException {
|
|
||||||
DiscoverItems discoverItems = adHocCommandManager.discoverCommands(archiveAddress);
|
|
||||||
for (DiscoverItems.Item item : discoverItems.getItems()) {
|
|
||||||
if (item.getNode().equals(ADVANCED_CONFIG_NODE))
|
|
||||||
return adHocCommandManager.getRemoteCommand(archiveAddress, item.getNode());
|
|
||||||
}
|
|
||||||
throw new SmackException.FeatureNotSupportedException(ADVANCED_CONFIG_NODE, archiveAddress);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static DataForm getNewMamForm() {
|
private static DataForm getNewMamForm() {
|
||||||
FormField field = FormField.hiddenFormType(MamElements.NAMESPACE);
|
FormField field = FormField.hiddenFormType(MamElements.NAMESPACE);
|
||||||
DataForm form = new DataForm(DataForm.Type.submit);
|
DataForm form = new DataForm(DataForm.Type.submit);
|
||||||
|
@ -769,7 +766,35 @@ public final class MamManager extends Manager {
|
||||||
/**
|
/**
|
||||||
* Update the preferences in the server.
|
* Update the preferences in the server.
|
||||||
*
|
*
|
||||||
* @param mamPrefs the MAM preferences to set the archive to
|
* @param alwaysJids TODO javadoc me please
|
||||||
|
* is the list of JIDs that should always have messages to/from
|
||||||
|
* archived in the user's store
|
||||||
|
* @param neverJids TODO javadoc me please
|
||||||
|
* is the list of JIDs that should never have messages to/from
|
||||||
|
* archived in the user's store
|
||||||
|
* @param defaultBehavior TODO javadoc me please
|
||||||
|
* can be "roster", "always", "never" (see XEP-0313)
|
||||||
|
* @return the MAM preferences result
|
||||||
|
* @throws NoResponseException if there was no response from the remote entity.
|
||||||
|
* @throws XMPPErrorException if there was an XMPP error returned.
|
||||||
|
* @throws NotConnectedException if the XMPP connection is not connected.
|
||||||
|
* @throws InterruptedException if the calling thread was interrupted.
|
||||||
|
* @throws NotLoggedInException if the XMPP connection is not authenticated.
|
||||||
|
* @deprecated use {@link #updateArchivingPreferences(MamPrefs)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public MamPrefsResult updateArchivingPreferences(List<Jid> alwaysJids, List<Jid> neverJids, DefaultBehavior defaultBehavior)
|
||||||
|
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException,
|
||||||
|
NotLoggedInException {
|
||||||
|
Objects.requireNonNull(defaultBehavior, "Default behavior must be set");
|
||||||
|
MamPrefsIQ mamPrefIQ = new MamPrefsIQ(alwaysJids, neverJids, defaultBehavior);
|
||||||
|
return queryMamPrefs(mamPrefIQ);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the preferences in the server.
|
||||||
|
*
|
||||||
|
* @param mamPrefs TODO javadoc me please
|
||||||
* @return the currently active preferences after the operation.
|
* @return the currently active preferences after the operation.
|
||||||
* @throws NoResponseException if there was no response from the remote entity.
|
* @throws NoResponseException if there was no response from the remote entity.
|
||||||
* @throws XMPPErrorException if there was an XMPP error returned.
|
* @throws XMPPErrorException if there was an XMPP error returned.
|
||||||
|
|
|
@ -19,7 +19,6 @@ package org.jivesoftware.smackx.attention.packet;
|
||||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||||
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
||||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
|
||||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,8 +69,11 @@ public class AttentionExtension implements ExtensionElement {
|
||||||
* @see org.jivesoftware.smack.packet.PacketExtension#toXML()
|
* @see org.jivesoftware.smack.packet.PacketExtension#toXML()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||||
return new XmlStringBuilder(this).closeEmptyElement();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append('<').append(getElementName()).append(" xmlns=\"").append(
|
||||||
|
getNamespace()).append("\"/>");
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -161,16 +161,11 @@ public final class UserTuneElement implements ExtensionElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class defines a Builder class for {@link UserTuneElement}. <br>
|
* This class defines a Builder class for {@link UserTuneElement}. <br>
|
||||||
* {@link UserTuneElement} instance can be obtained using the {@link #build()} method as follows. <br><br>
|
* {@link UserTuneElement} instance can be obtained using the {@link #build()} method as follows. <br>
|
||||||
* <pre>
|
* UserTuneElement.Builder builder = new UserTuneElement.Builder();
|
||||||
* {@code
|
* builder.setSource("Yessongs"); builder.setTitle("Heart of the Sunrise");
|
||||||
* UserTuneElement.Builder builder = UserTuneElement.getBuilder();
|
* UserTuneElement userTuneElement = builder.build(); <br>
|
||||||
* builder.setSource("Yessongs");
|
* Values such as title, source, artist, length, source, track and uri can be set using their respective setters through {@link Builder}
|
||||||
* builder.setTitle("Heart of the Sunrise");
|
|
||||||
* UserTuneElement userTuneElement = builder.build();
|
|
||||||
* }
|
|
||||||
* </pre>
|
|
||||||
* Values such as title, source, artist, length, source, track and uri can be set using their respective setters through {@link Builder}.
|
|
||||||
*/
|
*/
|
||||||
public static final class Builder {
|
public static final class Builder {
|
||||||
private String artist;
|
private String artist;
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Copyright 2020 Paul Schaub
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package org.jivesoftware.smackx.attention;
|
|
||||||
|
|
||||||
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar;
|
|
||||||
|
|
||||||
import org.jivesoftware.smackx.attention.packet.AttentionExtension;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
public class AttentionElementTest {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Serialized Attention element.
|
|
||||||
* @see <a href="https://xmpp.org/extensions/xep-0224.html#example-2">XEP-0224: Attention - Example 2</a>
|
|
||||||
*/
|
|
||||||
private static final String XML = "<attention xmlns='urn:xmpp:attention:0'/>";
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void serializationTest() {
|
|
||||||
AttentionExtension extension = new AttentionExtension();
|
|
||||||
assertXmlSimilar(XML, extension.toXML());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,83 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Copyright 2020 Paul Schaub
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package org.jivesoftware.smackx.nick;
|
|
||||||
|
|
||||||
import static org.jivesoftware.smack.test.util.XmlUnitUtils.assertXmlSimilar;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertThrows;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import org.jivesoftware.smack.parsing.SmackParsingException;
|
|
||||||
import org.jivesoftware.smack.test.util.SmackTestUtil;
|
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
|
||||||
import org.jivesoftware.smackx.nick.packet.Nick;
|
|
||||||
import org.jivesoftware.smackx.nick.provider.NickProvider;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.jupiter.params.ParameterizedTest;
|
|
||||||
import org.junit.jupiter.params.provider.EnumSource;
|
|
||||||
|
|
||||||
public class NickTest {
|
|
||||||
/**
|
|
||||||
* see <a href="https://xmpp.org/extensions/xep-0172.html#example-3">XEP-0172: User Nickname - Example 3</a>
|
|
||||||
*/
|
|
||||||
private static final String XML = "<nick xmlns='http://jabber.org/protocol/nick'>Ishmael</nick>";
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void disallowEmptyNickTest() {
|
|
||||||
assertThrows("Empty String as argument MUST cause IllegalArgumentException.",
|
|
||||||
IllegalArgumentException.class, () -> new Nick(""));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void disallowNullNickTest() {
|
|
||||||
assertThrows("Null argument MUST cause IllegalArgumentException.",
|
|
||||||
IllegalArgumentException.class, () -> new Nick(null));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void serializationTest() {
|
|
||||||
Nick nick = new Nick("Ishmael");
|
|
||||||
|
|
||||||
assertXmlSimilar(XML, nick.toXML());
|
|
||||||
}
|
|
||||||
|
|
||||||
@ParameterizedTest
|
|
||||||
@EnumSource(SmackTestUtil.XmlPullParserKind.class)
|
|
||||||
public void deserializationTest(SmackTestUtil.XmlPullParserKind parserKind)
|
|
||||||
throws XmlPullParserException, IOException, SmackParsingException {
|
|
||||||
Nick nick = SmackTestUtil.parse(XML, NickProvider.class, parserKind);
|
|
||||||
|
|
||||||
assertNotNull(nick);
|
|
||||||
assertEquals("Ishmael", nick.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void nicksAreEscapedTest() {
|
|
||||||
String name = "</nick>\"'&";
|
|
||||||
|
|
||||||
Nick nick = new Nick(name);
|
|
||||||
|
|
||||||
assertXmlSimilar("<nick xmlns='http://jabber.org/protocol/nick'>" +
|
|
||||||
"</nick>"'&" +
|
|
||||||
"</nick>", nick.toXML());
|
|
||||||
assertEquals(name, nick.getName());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
../../../../../../../../smack-core/src/main/java/org/jivesoftware/smack/c2s/package-info.java
|
|
|
@ -14,25 +14,23 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smack.c2s;
|
package org.jivesoftware.smack.tcp;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.security.KeyManagementException;
|
import java.security.KeyManagementException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.SmackException;
|
import org.jivesoftware.smack.SmackException;
|
||||||
import org.jivesoftware.smack.SmackException.NoResponseException;
|
|
||||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
|
||||||
import org.jivesoftware.smack.XMPPException;
|
import org.jivesoftware.smack.XMPPException;
|
||||||
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
import org.jivesoftware.smack.c2s.ModularXmppClientToServerConnection;
|
||||||
|
|
||||||
import org.igniterealtime.smack.inttest.AbstractSmackSpecificLowLevelIntegrationTest;
|
import org.igniterealtime.smack.inttest.AbstractSmackSpecificLowLevelIntegrationTest;
|
||||||
import org.igniterealtime.smack.inttest.SmackIntegrationTest;
|
import org.igniterealtime.smack.inttest.SmackIntegrationTest;
|
||||||
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
|
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
|
||||||
|
|
||||||
public class ModularXmppClientToServerConnectionLowLevelIntegrationTest extends AbstractSmackSpecificLowLevelIntegrationTest<ModularXmppClientToServerConnection> {
|
public class XmppNioTcpConnectionLowLevelIntegrationTest extends AbstractSmackSpecificLowLevelIntegrationTest<ModularXmppClientToServerConnection> {
|
||||||
|
|
||||||
public ModularXmppClientToServerConnectionLowLevelIntegrationTest(SmackIntegrationTestEnvironment environment) {
|
public XmppNioTcpConnectionLowLevelIntegrationTest(SmackIntegrationTestEnvironment environment) {
|
||||||
super(environment, ModularXmppClientToServerConnection.class);
|
super(environment, ModularXmppClientToServerConnection.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,11 +44,4 @@ public class ModularXmppClientToServerConnectionLowLevelIntegrationTest extends
|
||||||
connection.disconnect();
|
connection.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SmackIntegrationTest
|
|
||||||
public void testDisconnectNeverConnected()
|
|
||||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
|
||||||
ModularXmppClientToServerConnection connection = getSpecificUnconnectedConnection();
|
|
||||||
|
|
||||||
connection.disconnect();
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -16,214 +16,4 @@
|
||||||
<className>org.jivesoftware.smackx.xroster.provider.RosterExchangeProvider</className>
|
<className>org.jivesoftware.smackx.xroster.provider.RosterExchangeProvider</className>
|
||||||
</extensionProvider>
|
</extensionProvider>
|
||||||
|
|
||||||
<!-- XEP-0142: Workgroup Queues -->
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>offer</elementName>
|
|
||||||
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.OfferRequestProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>offer-revoke</elementName>
|
|
||||||
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.OfferRevokeProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>agent-status-request</elementName>
|
|
||||||
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.AgentStatusRequest$Provider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>transcripts</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.TranscriptsProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>transcript</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.TranscriptProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>workgroups</elementName>
|
|
||||||
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.AgentWorkgroups$Provider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>agent-info</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.AgentInfo$Provider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>transcript-search</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.TranscriptSearch$Provider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>occupants-info</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.OccupantsInfo$Provider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>chat-settings</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.settings.ChatSettings$InternalProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>chat-notes</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.ext.notes.ChatNotes$Provider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>chat-sessions</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.ext.history.AgentChatHistory$InternalProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>offline-settings</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.settings.OfflineSettings$InternalProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>sound-settings</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.settings.SoundSettings$InternalProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>workgroup-properties</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.settings.WorkgroupProperties$InternalProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>search-settings</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.settings.SearchSettings$InternalProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>workgroup-form</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.ext.forms.WorkgroupForm$InternalProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>macros</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.ext.macros.Macros$InternalProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>chat-metadata</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.ext.history.ChatMetadata$Provider</className>
|
|
||||||
</iqProvider>
|
|
||||||
<!--
|
|
||||||
|
|
||||||
org.jivesoftware.smackx.workgroup.site is missing ...
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>site-user</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.site.SiteUser$Provider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>site-invite</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.site.SiteInvitation$Provider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>site-user-history</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.site.SiteUserHistory$Provider</className>
|
|
||||||
</iqProvider>
|
|
||||||
-->
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>generic-metadata</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.settings.GenericSettings$InternalProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<iqProvider>
|
|
||||||
<elementName>monitor</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.MonitorPacket$InternalProvider</className>
|
|
||||||
</iqProvider>
|
|
||||||
|
|
||||||
<!-- Packet Extension Providers -->
|
|
||||||
<extensionProvider>
|
|
||||||
<elementName>queue-status</elementName>
|
|
||||||
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.QueueUpdate$Provider</className>
|
|
||||||
</extensionProvider>
|
|
||||||
|
|
||||||
<extensionProvider>
|
|
||||||
<elementName>workgroup</elementName>
|
|
||||||
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.WorkgroupInformation$Provider</className>
|
|
||||||
</extensionProvider>
|
|
||||||
|
|
||||||
<extensionProvider>
|
|
||||||
<elementName>metadata</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.MetaDataProvider</className>
|
|
||||||
</extensionProvider>
|
|
||||||
|
|
||||||
<extensionProvider>
|
|
||||||
<elementName>session</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.SessionID$Provider</className>
|
|
||||||
</extensionProvider>
|
|
||||||
|
|
||||||
<extensionProvider>
|
|
||||||
<elementName>user</elementName>
|
|
||||||
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.UserID$Provider</className>
|
|
||||||
</extensionProvider>
|
|
||||||
|
|
||||||
<extensionProvider>
|
|
||||||
<elementName>agent-status</elementName>
|
|
||||||
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.AgentStatus$Provider</className>
|
|
||||||
</extensionProvider>
|
|
||||||
|
|
||||||
<extensionProvider>
|
|
||||||
<elementName>notify-queue-details</elementName>
|
|
||||||
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.QueueDetails$Provider</className>
|
|
||||||
</extensionProvider>
|
|
||||||
|
|
||||||
<extensionProvider>
|
|
||||||
<elementName>notify-queue</elementName>
|
|
||||||
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.QueueOverview$Provider</className>
|
|
||||||
</extensionProvider>
|
|
||||||
|
|
||||||
<extensionProvider>
|
|
||||||
<elementName>invite</elementName>
|
|
||||||
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.RoomInvitation$Provider</className>
|
|
||||||
</extensionProvider>
|
|
||||||
|
|
||||||
<extensionProvider>
|
|
||||||
<elementName>transfer</elementName>
|
|
||||||
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
|
||||||
<className>org.jivesoftware.smackx.workgroup.packet.RoomTransfer$Provider</className>
|
|
||||||
</extensionProvider>
|
|
||||||
|
|
||||||
</smackProviders>
|
</smackProviders>
|
||||||
|
|
|
@ -0,0 +1,215 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- Providers for workgroup extensions -->
|
||||||
|
<smackProviders>
|
||||||
|
|
||||||
|
<!-- XEP-0142: Workgroup Queues -->
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>offer</elementName>
|
||||||
|
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.OfferRequestProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>offer-revoke</elementName>
|
||||||
|
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.OfferRevokeProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>agent-status-request</elementName>
|
||||||
|
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.AgentStatusRequest$Provider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>transcripts</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.TranscriptsProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>transcript</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.TranscriptProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>workgroups</elementName>
|
||||||
|
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.AgentWorkgroups$Provider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>agent-info</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.AgentInfo$Provider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>transcript-search</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.TranscriptSearch$Provider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>occupants-info</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.OccupantsInfo$Provider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>chat-settings</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.settings.ChatSettings$InternalProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>chat-notes</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.ext.notes.ChatNotes$Provider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>chat-sessions</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.ext.history.AgentChatHistory$InternalProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>offline-settings</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.settings.OfflineSettings$InternalProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>sound-settings</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.settings.SoundSettings$InternalProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>workgroup-properties</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.settings.WorkgroupProperties$InternalProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>search-settings</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.settings.SearchSettings$InternalProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>workgroup-form</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.ext.forms.WorkgroupForm$InternalProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>macros</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.ext.macros.Macros$InternalProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>chat-metadata</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.ext.history.ChatMetadata$Provider</className>
|
||||||
|
</iqProvider>
|
||||||
|
<!--
|
||||||
|
|
||||||
|
org.jivesoftware.smackx.workgroup.site is missing ...
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>site-user</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.site.SiteUser$Provider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>site-invite</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.site.SiteInvitation$Provider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>site-user-history</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.site.SiteUserHistory$Provider</className>
|
||||||
|
</iqProvider>
|
||||||
|
-->
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>generic-metadata</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.settings.GenericSettings$InternalProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<iqProvider>
|
||||||
|
<elementName>monitor</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.MonitorPacket$InternalProvider</className>
|
||||||
|
</iqProvider>
|
||||||
|
|
||||||
|
<!-- Packet Extension Providers -->
|
||||||
|
<extensionProvider>
|
||||||
|
<elementName>queue-status</elementName>
|
||||||
|
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.QueueUpdate$Provider</className>
|
||||||
|
</extensionProvider>
|
||||||
|
|
||||||
|
<extensionProvider>
|
||||||
|
<elementName>workgroup</elementName>
|
||||||
|
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.WorkgroupInformation$Provider</className>
|
||||||
|
</extensionProvider>
|
||||||
|
|
||||||
|
<extensionProvider>
|
||||||
|
<elementName>metadata</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.MetaDataProvider</className>
|
||||||
|
</extensionProvider>
|
||||||
|
|
||||||
|
<extensionProvider>
|
||||||
|
<elementName>session</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.SessionID$Provider</className>
|
||||||
|
</extensionProvider>
|
||||||
|
|
||||||
|
<extensionProvider>
|
||||||
|
<elementName>user</elementName>
|
||||||
|
<namespace>http://jivesoftware.com/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.UserID$Provider</className>
|
||||||
|
</extensionProvider>
|
||||||
|
|
||||||
|
<extensionProvider>
|
||||||
|
<elementName>agent-status</elementName>
|
||||||
|
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.AgentStatus$Provider</className>
|
||||||
|
</extensionProvider>
|
||||||
|
|
||||||
|
<extensionProvider>
|
||||||
|
<elementName>notify-queue-details</elementName>
|
||||||
|
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.QueueDetails$Provider</className>
|
||||||
|
</extensionProvider>
|
||||||
|
|
||||||
|
<extensionProvider>
|
||||||
|
<elementName>notify-queue</elementName>
|
||||||
|
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.QueueOverview$Provider</className>
|
||||||
|
</extensionProvider>
|
||||||
|
|
||||||
|
<extensionProvider>
|
||||||
|
<elementName>invite</elementName>
|
||||||
|
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.RoomInvitation$Provider</className>
|
||||||
|
</extensionProvider>
|
||||||
|
|
||||||
|
<extensionProvider>
|
||||||
|
<elementName>transfer</elementName>
|
||||||
|
<namespace>http://jabber.org/protocol/workgroup</namespace>
|
||||||
|
<className>org.jivesoftware.smackx.workgroup.packet.RoomTransfer$Provider</className>
|
||||||
|
</extensionProvider>
|
||||||
|
|
||||||
|
</smackProviders>
|
Loading…
Reference in a new issue