From c125a3b055b966828fa4f0af9d47353e9be77b32 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 27 May 2015 19:29:51 +0200 Subject: [PATCH] Bump jxmpp to 0.5.0-alpha4 --- .../smack/AbstractXMPPConnection.java | 8 ++-- .../jivesoftware/smack/XMPPConnection.java | 4 +- .../smack/debugger/AbstractDebugger.java | 4 +- .../smack/debugger/SmackDebugger.java | 4 +- .../smack/filter/IQReplyFilter.java | 4 +- .../org/jivesoftware/smack/packet/Bind.java | 10 ++--- .../smack/provider/BindIQProvider.java | 4 +- .../jivesoftware/smack/util/ParserUtils.java | 6 +-- .../jivesoftware/smack/DummyConnection.java | 4 +- .../smack/filter/FromMatchesFilterTest.java | 12 +++--- .../debugger/slf4j/SLF4JSmackDebugger.java | 4 +- .../smackx/debugger/EnhancedDebugger.java | 4 +- .../smackx/debugger/LiteDebugger.java | 4 +- .../smackx/address/MultipleRecipientInfo.java | 2 +- .../address/MultipleRecipientManager.java | 8 ++-- .../smackx/bookmarks/BookmarkManager.java | 6 +-- .../bookmarks/BookmarkedConference.java | 10 ++--- .../smackx/bookmarks/Bookmarks.java | 4 +- .../filetransfer/FileTransferManager.java | 6 +-- .../muc/DefaultParticipantStatusListener.java | 32 +++++++-------- .../jivesoftware/smackx/muc/HostedRoom.java | 4 +- .../smackx/muc/MultiUserChat.java | 40 +++++++++---------- .../smackx/muc/MultiUserChatManager.java | 34 ++++++++-------- .../org/jivesoftware/smackx/muc/Occupant.java | 4 +- .../smackx/muc/ParticipantStatusListener.java | 32 +++++++-------- .../org/jivesoftware/smackx/muc/RoomInfo.java | 8 ++-- .../smackx/muc/SubjectUpdatedListener.java | 4 +- .../smackx/muc/packet/Destroy.java | 8 ++-- .../smackx/muc/provider/MUCParserUtils.java | 4 +- .../smackx/vcardtemp/VCardManager.java | 4 +- .../smackx/vcardtemp/packet/VCard.java | 6 +-- .../ibb/InBandBytestreamManagerTest.java | 6 +-- .../InBandBytestreamSessionMessageTest.java | 6 +-- .../ibb/InBandBytestreamSessionTest.java | 6 +-- .../ibb/InitiationListenerTest.java | 6 +-- .../socks5/InitiationListenerTest.java | 6 +-- .../socks5/Socks5ByteStreamManagerTest.java | 6 +-- .../socks5/Socks5ByteStreamRequestTest.java | 6 +-- .../socks5/Socks5ClientForInitiatorTest.java | 6 +-- .../jivesoftware/util/ConnectionUtils.java | 4 +- .../java/org/jivesoftware/util/Protocol.java | 2 +- .../org/jivesoftware/smack/chat/Chat.java | 8 ++-- .../jivesoftware/smack/chat/ChatManager.java | 20 +++++----- .../org/jivesoftware/smack/roster/Roster.java | 14 +++---- .../smack/chat/ChatConnectionTest.java | 12 +++--- .../muc/MultiUserChatIntegrationTest.java | 4 +- .../smackx/jingleold/JingleManager.java | 4 +- .../smackx/workgroup/agent/AgentRoster.java | 10 ++--- version.gradle | 2 +- 49 files changed, 208 insertions(+), 208 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java index 448ae49d1..93c78d74a 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java @@ -82,7 +82,7 @@ import org.jivesoftware.smack.util.SmackExecutorThreadFactory; import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.dns.HostAddress; import org.jxmpp.jid.DomainBareJid; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.Jid; import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.util.XmppStringUtils; @@ -158,7 +158,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection { * certificate. *

*/ - protected FullJid user; + protected EntityFullJid user; protected boolean connected = false; @@ -475,7 +475,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection { } @Override - public final FullJid getUser() { + public final EntityFullJid getUser() { return user; } @@ -1586,7 +1586,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection { @Override public final String toString() { - FullJid localEndpoint = getUser(); + EntityFullJid localEndpoint = getUser(); String localEndpointString = (localEndpoint == null ? "not-authenticated" : localEndpoint.toString()); return getClass().getSimpleName() + '[' + localEndpointString + "] (" + getConnectionCounter() + ')'; } diff --git a/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java index 872c81e3b..cb9953608 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java @@ -27,7 +27,7 @@ import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.ExtensionElement; import org.jivesoftware.smack.packet.PlainStreamElement; import org.jxmpp.jid.DomainBareJid; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; /** * The XMPPConnection interface provides an interface for connections to an XMPP server and @@ -115,7 +115,7 @@ public interface XMPPConnection { * * @return the full XMPP address of the user logged in. */ - public FullJid getUser(); + public EntityFullJid getUser(); /** * Returns the stream ID for this connection, which is the value set by the server diff --git a/smack-core/src/main/java/org/jivesoftware/smack/debugger/AbstractDebugger.java b/smack-core/src/main/java/org/jivesoftware/smack/debugger/AbstractDebugger.java index b6d689da5..29c6bafe2 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/debugger/AbstractDebugger.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/debugger/AbstractDebugger.java @@ -24,7 +24,7 @@ import org.jivesoftware.smack.util.ObservableReader; import org.jivesoftware.smack.util.ObservableWriter; import org.jivesoftware.smack.util.ReaderListener; import org.jivesoftware.smack.util.WriterListener; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import java.io.Reader; import java.io.Writer; @@ -142,7 +142,7 @@ public abstract class AbstractDebugger implements SmackDebugger { } @Override - public void userHasLogged(FullJid user) { + public void userHasLogged(EntityFullJid user) { String localpart = user.getLocalpart().toString(); boolean isAnonymous = "".equals(localpart); String title = diff --git a/smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java b/smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java index dbd5b3ee4..043a0f9e6 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java @@ -21,7 +21,7 @@ import java.io.Reader; import java.io.Writer; import org.jivesoftware.smack.StanzaListener; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; /** * Interface that allows for implementing classes to debug XML traffic. That is a GUI window that @@ -41,7 +41,7 @@ public interface SmackDebugger { * * @param user the user@host/resource that has just logged in */ - public abstract void userHasLogged(FullJid user); + public abstract void userHasLogged(EntityFullJid user); /** * Returns the special Reader that wraps the main Reader and logs data to the GUI. diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/IQReplyFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/IQReplyFilter.java index ff4af234a..494bd7def 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/filter/IQReplyFilter.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/filter/IQReplyFilter.java @@ -23,7 +23,7 @@ import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.Stanza; import org.jxmpp.jid.DomainBareJid; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.Jid; /** @@ -55,7 +55,7 @@ public class IQReplyFilter implements StanzaFilter { private final StanzaFilter iqAndIdFilter; private final OrFilter fromFilter; private final Jid to; - private final FullJid local; + private final EntityFullJid local; private final DomainBareJid server; private final String packetId; diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/Bind.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/Bind.java index 0ade03fd1..e3e92f320 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/Bind.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/Bind.java @@ -17,7 +17,7 @@ package org.jivesoftware.smack.packet; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.parts.Resourcepart; /** @@ -37,9 +37,9 @@ public class Bind extends IQ { public static final String NAMESPACE = "urn:ietf:params:xml:ns:xmpp-bind"; private final Resourcepart resource; - private final FullJid jid; + private final EntityFullJid jid; - public Bind(Resourcepart resource, FullJid jid) { + public Bind(Resourcepart resource, EntityFullJid jid) { super(ELEMENT, NAMESPACE); this.resource = resource; this.jid = jid; @@ -49,7 +49,7 @@ public class Bind extends IQ { return resource; } - public FullJid getJid() { + public EntityFullJid getJid() { return jid; } @@ -59,7 +59,7 @@ public class Bind extends IQ { return bind; } - public static Bind newResult(FullJid jid) { + public static Bind newResult(EntityFullJid jid) { return new Bind(null, jid); } diff --git a/smack-core/src/main/java/org/jivesoftware/smack/provider/BindIQProvider.java b/smack-core/src/main/java/org/jivesoftware/smack/provider/BindIQProvider.java index bd383d352..c6bd736d4 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/provider/BindIQProvider.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/provider/BindIQProvider.java @@ -20,7 +20,7 @@ import java.io.IOException; import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.packet.Bind; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.parts.Resourcepart; import org.xmlpull.v1.XmlPullParser; @@ -44,7 +44,7 @@ public class BindIQProvider extends IQProvider { bind = Bind.newSet(Resourcepart.from(resourceString)); break; case "jid": - FullJid fullJid = JidCreate.fullFrom(parser.nextText()); + EntityFullJid fullJid = JidCreate.fullFrom(parser.nextText()); bind = Bind.newResult(fullJid); break; } diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/ParserUtils.java b/smack-core/src/main/java/org/jivesoftware/smack/util/ParserUtils.java index f67b88cdb..094a4101c 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/util/ParserUtils.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/util/ParserUtils.java @@ -23,7 +23,7 @@ import java.text.ParseException; import java.util.Date; import java.util.Locale; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.Jid; import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.parts.Resourcepart; @@ -67,11 +67,11 @@ public class ParserUtils { return JidCreate.from(jidString); } - public static BareJid getBareJidAttribute(XmlPullParser parser) throws XmppStringprepException { + public static EntityBareJid getBareJidAttribute(XmlPullParser parser) throws XmppStringprepException { return getBareJidAttribute(parser, JID); } - public static BareJid getBareJidAttribute(XmlPullParser parser, String name) throws XmppStringprepException { + public static EntityBareJid getBareJidAttribute(XmlPullParser parser, String name) throws XmppStringprepException { final String jidString = parser.getAttributeValue("", name); if (jidString == null) { return null; diff --git a/smack-core/src/test/java/org/jivesoftware/smack/DummyConnection.java b/smack-core/src/test/java/org/jivesoftware/smack/DummyConnection.java index 63532bdc6..ae190711a 100644 --- a/smack-core/src/test/java/org/jivesoftware/smack/DummyConnection.java +++ b/smack-core/src/test/java/org/jivesoftware/smack/DummyConnection.java @@ -28,7 +28,7 @@ import org.jivesoftware.smack.packet.ExtensionElement; import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.PlainStreamElement; import org.jivesoftware.smack.packet.TopLevelStreamElement; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.parts.Resourcepart; @@ -65,7 +65,7 @@ public class DummyConnection extends AbstractXMPPConnection { this(getDummyConfigurationBuilder().build()); } - private FullJid getUserJid() { + private EntityFullJid getUserJid() { try { return JidCreate.fullFrom(config.getUsername() + "@" diff --git a/smack-core/src/test/java/org/jivesoftware/smack/filter/FromMatchesFilterTest.java b/smack-core/src/test/java/org/jivesoftware/smack/filter/FromMatchesFilterTest.java index b7e098696..7171b145f 100644 --- a/smack-core/src/test/java/org/jivesoftware/smack/filter/FromMatchesFilterTest.java +++ b/smack-core/src/test/java/org/jivesoftware/smack/filter/FromMatchesFilterTest.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertFalse; import org.jivesoftware.smack.packet.Stanza; import org.junit.Test; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.Jid; import org.jxmpp.jid.JidTestUtil; @@ -32,8 +32,8 @@ import org.jxmpp.jid.JidTestUtil; */ public class FromMatchesFilterTest { private static final Jid BASE_JID1 = JidTestUtil.BARE_JID_1; - private static final FullJid FULL_JID1_R1 = JidTestUtil.FULL_JID_1_RESOURCE_1; - private static final FullJid FULL_JID1_R2 = JidTestUtil.FULL_JID_1_RESOURCE_2; + private static final EntityFullJid FULL_JID1_R1 = JidTestUtil.FULL_JID_1_RESOURCE_1; + private static final EntityFullJid FULL_JID1_R2 = JidTestUtil.FULL_JID_1_RESOURCE_2; private static final Jid BASE_JID2 = JidTestUtil.BARE_JID_2; private static final Jid FULL_JID2 = JidTestUtil.FULL_JID_2_RESOURCE_1; @@ -43,7 +43,7 @@ public class FromMatchesFilterTest { private static final Jid SERVICE_JID2 = JidTestUtil.PUBSUB_EXAMPLE_ORG; @Test - public void autoCompareMatchingFullJid() + public void autoCompareMatchingEntityFullJid() { FromMatchesFilter filter = FromMatchesFilter.create(FULL_JID1_R1); Stanza packet = new Stanza() { @@ -124,7 +124,7 @@ public class FromMatchesFilterTest { } @Test - public void bareCompareMatchingFullJid() + public void bareCompareMatchingEntityFullJid() { FromMatchesFilter filter = FromMatchesFilter.createBare(FULL_JID1_R1); Stanza packet = new Stanza() { @@ -205,7 +205,7 @@ public class FromMatchesFilterTest { } @Test - public void fullCompareMatchingFullJid() + public void fullCompareMatchingEntityFullJid() { FromMatchesFilter filter = FromMatchesFilter.createFull(FULL_JID1_R1); Stanza packet = new Stanza() { diff --git a/smack-debug-slf4j/src/main/java/org/jivesoftware/smackx/debugger/slf4j/SLF4JSmackDebugger.java b/smack-debug-slf4j/src/main/java/org/jivesoftware/smackx/debugger/slf4j/SLF4JSmackDebugger.java index a7fb0d37b..7834701c9 100644 --- a/smack-debug-slf4j/src/main/java/org/jivesoftware/smackx/debugger/slf4j/SLF4JSmackDebugger.java +++ b/smack-debug-slf4j/src/main/java/org/jivesoftware/smackx/debugger/slf4j/SLF4JSmackDebugger.java @@ -23,7 +23,7 @@ import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.debugger.SmackDebugger; import org.jivesoftware.smack.util.ObservableReader; import org.jivesoftware.smack.util.ObservableWriter; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -93,7 +93,7 @@ public class SLF4JSmackDebugger implements SmackDebugger { } @Override - public void userHasLogged(FullJid user) { + public void userHasLogged(EntityFullJid user) { if (logger.isDebugEnabled()) { logger.debug("({}) User logged in {}", connection.hashCode(), user.toString()); } diff --git a/smack-debug/src/main/java/org/jivesoftware/smackx/debugger/EnhancedDebugger.java b/smack-debug/src/main/java/org/jivesoftware/smackx/debugger/EnhancedDebugger.java index 80f8da3ac..20cc622e6 100644 --- a/smack-debug/src/main/java/org/jivesoftware/smackx/debugger/EnhancedDebugger.java +++ b/smack-debug/src/main/java/org/jivesoftware/smackx/debugger/EnhancedDebugger.java @@ -32,7 +32,7 @@ import org.jivesoftware.smack.util.ObservableWriter; import org.jivesoftware.smack.util.ReaderListener; import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.WriterListener; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.Jid; import javax.swing.AbstractAction; @@ -743,7 +743,7 @@ public class EnhancedDebugger implements SmackDebugger { } @Override - public void userHasLogged(final FullJid user) { + public void userHasLogged(final EntityFullJid user) { final EnhancedDebugger debugger = this; SwingUtilities.invokeLater(new Runnable() { public void run() { diff --git a/smack-debug/src/main/java/org/jivesoftware/smackx/debugger/LiteDebugger.java b/smack-debug/src/main/java/org/jivesoftware/smackx/debugger/LiteDebugger.java index 9404c72a1..0946daa55 100644 --- a/smack-debug/src/main/java/org/jivesoftware/smackx/debugger/LiteDebugger.java +++ b/smack-debug/src/main/java/org/jivesoftware/smackx/debugger/LiteDebugger.java @@ -48,7 +48,7 @@ import org.jivesoftware.smack.util.ObservableReader; import org.jivesoftware.smack.util.ObservableWriter; import org.jivesoftware.smack.util.ReaderListener; import org.jivesoftware.smack.util.WriterListener; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; /** * The LiteDebugger is a very simple debugger that allows to debug sent, received and @@ -325,7 +325,7 @@ public class LiteDebugger implements SmackDebugger { } @Override - public void userHasLogged(FullJid user) { + public void userHasLogged(EntityFullJid user) { String title = "Smack Debug Window -- " + user; diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/address/MultipleRecipientInfo.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/address/MultipleRecipientInfo.java index 10d6523cb..928d2fbc4 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/address/MultipleRecipientInfo.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/address/MultipleRecipientInfo.java @@ -65,7 +65,7 @@ public class MultipleRecipientInfo { * @return the JID of a MUC room to which responses should be sent or null if * no specific address was provided. */ - // TODO should return BareJid + // TODO should return EntityBareJid public Jid getReplyRoom() { List replyRoom = extension.getAddressesOfType(MultipleAddresses.Type.replyroom); return replyRoom.isEmpty() ? null : replyRoom.get(0).getJid(); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/address/MultipleRecipientManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/address/MultipleRecipientManager.java index f5b6c6de2..dd5750b17 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/address/MultipleRecipientManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/address/MultipleRecipientManager.java @@ -28,9 +28,9 @@ import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smackx.address.packet.MultipleAddresses; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.DomainBareJid; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.Jid; import java.util.ArrayList; @@ -178,9 +178,9 @@ public class MultipleRecipientManager { to.add(original.getFrom()); } // Remove the sender from the TO/CC list (try with bare JID too) - FullJid from = connection.getUser(); + EntityFullJid from = connection.getUser(); if (!to.remove(from) && !cc.remove(from)) { - BareJid bareJID = from.asBareJid(); + EntityBareJid bareJID = from.asBareJid(); to.remove(bareJID); cc.remove(bareJID); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkManager.java index 33e9235e1..4a162f49a 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkManager.java @@ -28,7 +28,7 @@ import org.jivesoftware.smack.SmackException.NotConnectedException; import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smackx.iqprivate.PrivateDataManager; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.parts.Resourcepart; @@ -111,7 +111,7 @@ public final class BookmarkManager { * @throws NotConnectedException * @throws InterruptedException */ - public void addBookmarkedConference(String name, BareJid jid, boolean isAutoJoin, + public void addBookmarkedConference(String name, EntityBareJid jid, boolean isAutoJoin, Resourcepart nickname, String password) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { retrieveBookmarks(); @@ -146,7 +146,7 @@ public final class BookmarkManager { * @throws IllegalArgumentException thrown when the conference being removed is a shared * conference */ - public void removeBookmarkedConference(BareJid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { + public void removeBookmarkedConference(EntityBareJid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { retrieveBookmarks(); Iterator it = bookmarks.getBookmarkedConferences().iterator(); while(it.hasNext()) { diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkedConference.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkedConference.java index c6cfd65fd..f08e3c0a2 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkedConference.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkedConference.java @@ -17,7 +17,7 @@ package org.jivesoftware.smackx.bookmarks; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.parts.Resourcepart; /** @@ -29,17 +29,17 @@ public class BookmarkedConference implements SharedBookmark { private String name; private boolean autoJoin; - private final BareJid jid; + private final EntityBareJid jid; private Resourcepart nickname; private String password; private boolean isShared; - protected BookmarkedConference(BareJid jid) { + protected BookmarkedConference(EntityBareJid jid) { this.jid = jid; } - protected BookmarkedConference(String name, BareJid jid, boolean autoJoin, Resourcepart nickname, + protected BookmarkedConference(String name, EntityBareJid jid, boolean autoJoin, Resourcepart nickname, String password) { this.name = name; @@ -81,7 +81,7 @@ public class BookmarkedConference implements SharedBookmark { * * @return the full JID of this conference room. */ - public BareJid getJid() { + public EntityBareJid getJid() { return jid; } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/Bookmarks.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/Bookmarks.java index b9f3ac799..b176e3576 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/Bookmarks.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/Bookmarks.java @@ -20,7 +20,7 @@ import org.jivesoftware.smack.util.ParserUtils; import org.jivesoftware.smack.util.XmlStringBuilder; import org.jivesoftware.smackx.iqprivate.packet.PrivateData; import org.jivesoftware.smackx.iqprivate.provider.PrivateDataProvider; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.parts.Resourcepart; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; @@ -271,7 +271,7 @@ public class Bookmarks implements PrivateData { private static BookmarkedConference getConferenceStorage(XmlPullParser parser) throws XmlPullParserException, IOException { String name = parser.getAttributeValue("", "name"); String autojoin = parser.getAttributeValue("", "autojoin"); - BareJid jid = ParserUtils.getBareJidAttribute(parser); + EntityBareJid jid = ParserUtils.getBareJidAttribute(parser); BookmarkedConference conf = new BookmarkedConference(jid); conf.setName(name); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferManager.java index 7a2ff2481..be895ad42 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferManager.java @@ -24,7 +24,7 @@ import org.jivesoftware.smack.iqrequest.IQRequestHandler.Mode; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.XMPPError; import org.jivesoftware.smackx.si.packet.StreamInitiation; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import java.util.List; import java.util.Map; @@ -33,7 +33,7 @@ import java.util.concurrent.CopyOnWriteArrayList; /** * The file transfer manager class handles the sending and recieving of files. - * To send a file invoke the {@link #createOutgoingFileTransfer(FullJid)} method. + * To send a file invoke the {@link #createOutgoingFileTransfer(EntityFullJid)} method. *

* And to recieve a file add a file transfer listener to the manager. The * listener will notify you when there is a new file transfer request. To create @@ -117,7 +117,7 @@ public final class FileTransferManager extends Manager { * @return The send file object on which the negotiated transfer can be run. * @exception IllegalArgumentException if userID is null or not a full JID */ - public OutgoingFileTransfer createOutgoingFileTransfer(FullJid userID) { + public OutgoingFileTransfer createOutgoingFileTransfer(EntityFullJid userID) { // We need to create outgoing file transfers with a full JID since this method will later // use XEP-0095 to negotiate the stream. This is done with IQ stanzas that need to be addressed to a full JID // in order to reach an client entity. diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultParticipantStatusListener.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultParticipantStatusListener.java index 4578accc7..6cf4de52c 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultParticipantStatusListener.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultParticipantStatusListener.java @@ -17,7 +17,7 @@ package org.jivesoftware.smackx.muc; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.Jid; import org.jxmpp.jid.parts.Resourcepart; @@ -32,49 +32,49 @@ import org.jxmpp.jid.parts.Resourcepart; */ public class DefaultParticipantStatusListener implements ParticipantStatusListener { - public void joined(FullJid participant) { + public void joined(EntityFullJid participant) { } - public void left(FullJid participant) { + public void left(EntityFullJid participant) { } - public void kicked(FullJid participant, Jid actor, String reason) { + public void kicked(EntityFullJid participant, Jid actor, String reason) { } - public void voiceGranted(FullJid participant) { + public void voiceGranted(EntityFullJid participant) { } - public void voiceRevoked(FullJid participant) { + public void voiceRevoked(EntityFullJid participant) { } - public void banned(FullJid participant, Jid actor, String reason) { + public void banned(EntityFullJid participant, Jid actor, String reason) { } - public void membershipGranted(FullJid participant) { + public void membershipGranted(EntityFullJid participant) { } - public void membershipRevoked(FullJid participant) { + public void membershipRevoked(EntityFullJid participant) { } - public void moderatorGranted(FullJid participant) { + public void moderatorGranted(EntityFullJid participant) { } - public void moderatorRevoked(FullJid participant) { + public void moderatorRevoked(EntityFullJid participant) { } - public void ownershipGranted(FullJid participant) { + public void ownershipGranted(EntityFullJid participant) { } - public void ownershipRevoked(FullJid participant) { + public void ownershipRevoked(EntityFullJid participant) { } - public void adminGranted(FullJid participant) { + public void adminGranted(EntityFullJid participant) { } - public void adminRevoked(FullJid participant) { + public void adminRevoked(EntityFullJid participant) { } - public void nicknameChanged(FullJid participant, Resourcepart newNickname) { + public void nicknameChanged(EntityFullJid participant, Resourcepart newNickname) { } } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/HostedRoom.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/HostedRoom.java index 5d4defa1e..601606be0 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/HostedRoom.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/HostedRoom.java @@ -23,9 +23,9 @@ import org.jxmpp.jid.Jid; * Hosted rooms by a chat service may be discovered if they are configured to appear in the room * directory . The information that may be discovered is the XMPP address of the room and the room * name. The address of the room may be used for obtaining more detailed information - * {@link org.jivesoftware.smackx.muc.MultiUserChatManager#getRoomInfo(org.jxmpp.jid.BareJid)} + * {@link org.jivesoftware.smackx.muc.MultiUserChatManager#getRoomInfo(org.jxmpp.jid.EntityBareJid)} * or could be used for joining the room - * {@link org.jivesoftware.smackx.muc.MultiUserChatManager#getMultiUserChat(org.jxmpp.jid.BareJid)} + * {@link org.jivesoftware.smackx.muc.MultiUserChatManager#getMultiUserChat(org.jxmpp.jid.EntityBareJid)} * and {@link org.jivesoftware.smackx.muc.MultiUserChat#join(org.jxmpp.jid.parts.Resourcepart)}. * * @author Gaston Dombiak diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java index 929c55402..88f316069 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java @@ -72,17 +72,17 @@ import org.jivesoftware.smackx.muc.packet.MUCUser.Status; import org.jivesoftware.smackx.xdata.Form; import org.jivesoftware.smackx.xdata.FormField; import org.jivesoftware.smackx.xdata.packet.DataForm; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.DomainBareJid; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.Jid; -import org.jxmpp.jid.JidWithLocalpart; +import org.jxmpp.jid.EntityJid; import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.util.cache.ExpirationCache; /** - * A MultiUserChat room (XEP-45), created with {@link MultiUserChatManager#getMultiUserChat(BareJid)}. + * A MultiUserChat room (XEP-45), created with {@link MultiUserChatManager#getMultiUserChat(EntityBareJid)}. *

* A MultiUserChat is a conversation that takes place among many users in a virtual * room. A room could have many occupants with different affiliation and roles. @@ -105,9 +105,9 @@ public class MultiUserChat { 100, 1000 * 60 * 60 * 24); private final XMPPConnection connection; - private final BareJid room; + private final EntityBareJid room; private final MultiUserChatManager multiUserChatManager; - private final Map occupantsMap = new ConcurrentHashMap<>(); + private final Map occupantsMap = new ConcurrentHashMap<>(); private final Set invitationRejectionListeners = new CopyOnWriteArraySet(); private final Set subjectUpdatedListeners = new CopyOnWriteArraySet(); @@ -140,7 +140,7 @@ public class MultiUserChat { private boolean joined = false; private PacketCollector messageCollector; - MultiUserChat(XMPPConnection connection, BareJid room, MultiUserChatManager multiUserChatManager) { + MultiUserChat(XMPPConnection connection, EntityBareJid room, MultiUserChatManager multiUserChatManager) { this.connection = connection; this.room = room; this.multiUserChatManager = multiUserChatManager; @@ -162,7 +162,7 @@ public class MultiUserChat { subjectListener = new StanzaListener() { public void processPacket(Stanza packet) { Message msg = (Message) packet; - FullJid from = msg.getFrom().asFullJidIfPossible(); + EntityFullJid from = msg.getFrom().asEntityFullJidIfPossible(); if (from == null) { LOGGER.warning("Message subject not changed by a full JID: " + msg.getFrom()); return; @@ -180,7 +180,7 @@ public class MultiUserChat { presenceListener = new StanzaListener() { public void processPacket(Stanza packet) { Presence presence = (Presence) packet; - final FullJid from = presence.getFrom().asFullJidIfPossible(); + final EntityFullJid from = presence.getFrom().asEntityFullJidIfPossible(); if (from == null) { LOGGER.warning("Presence not from a full JID: " + presence.getFrom()); return; @@ -277,7 +277,7 @@ public class MultiUserChat { * * @return the multi user chat room name. */ - public BareJid getRoom() { + public EntityBareJid getRoom() { return room; } @@ -311,7 +311,7 @@ public class MultiUserChat { // We enter a room by sending a presence packet where the "to" // field is in the form "roomName@service/nickname" Presence joinPresence = new Presence(Presence.Type.available); - final FullJid jid = JidCreate.fullFrom(room, nickname); + final EntityFullJid jid = JidCreate.fullFrom(room, nickname); joinPresence.setTo(jid); // Indicate the the client supports MUC @@ -352,7 +352,7 @@ public class MultiUserChat { // This presence must be send from a full JID. We use the resourcepart of this JID as nick, since the room may // performed roomnick rewriting - this.nickname = presence.getFrom().asFullJidIfPossible().getResourcepart(); + this.nickname = presence.getFrom().asEntityFullJidIfPossible().getResourcepart(); joined = true; // Update the list of joined rooms @@ -780,7 +780,7 @@ public class MultiUserChat { * @throws NotConnectedException * @throws InterruptedException */ - public void destroy(String reason, BareJid alternateJID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { + public void destroy(String reason, EntityBareJid alternateJID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MUCOwner iq = new MUCOwner(); iq.setTo(room); iq.setType(IQ.Type.set); @@ -1002,7 +1002,7 @@ public class MultiUserChat { if (!joined) { throw new MucNotJoinedException(this); } - final FullJid jid = JidCreate.fullFrom(room, nickname); + final EntityFullJid jid = JidCreate.fullFrom(room, nickname); // We change the nickname by sending a presence packet where the "to" // field is in the form "roomName@service/nickname" // We don't have to signal the MUC support again @@ -1455,7 +1455,7 @@ public class MultiUserChat { * @throws NotConnectedException * @throws InterruptedException */ - public void revokeAdmin(JidWithLocalpart jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException { + public void revokeAdmin(EntityJid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException { changeAffiliationByAdmin(jid, MUCAffiliation.member); } @@ -1561,7 +1561,7 @@ public class MultiUserChat { * * @return a List of the occupants in the group chat. */ - public List getOccupants() { + public List getOccupants() { return new ArrayList<>(occupantsMap.keySet()); } @@ -1779,7 +1779,7 @@ public class MultiUserChat { * created chat. * @return new Chat for sending private messages to a given room occupant. */ - public Chat createPrivateChat(FullJid occupant, ChatMessageListener listener) { + public Chat createPrivateChat(EntityFullJid occupant, ChatMessageListener listener) { return ChatManager.getInstanceFor(connection).createChat(occupant, listener); } @@ -2020,7 +2020,7 @@ public class MultiUserChat { MUCRole oldRole, MUCRole newRole, boolean isUserModification, - FullJid from) { + EntityFullJid from) { // Voice was granted to a visitor if (("visitor".equals(oldRole) || "none".equals(oldRole)) && "participant".equals(newRole)) { @@ -2146,7 +2146,7 @@ public class MultiUserChat { MUCAffiliation oldAffiliation, MUCAffiliation newAffiliation, boolean isUserModification, - FullJid from) { + EntityFullJid from) { // First check for revoked affiliation and then for granted affiliations. The idea is to // first fire the "revoke" events and then fire the "grant" events. @@ -2243,7 +2243,7 @@ public class MultiUserChat { Set statusCodes, boolean isUserModification, MUCUser mucUser, - FullJid from) { + EntityFullJid from) { // Check if an occupant was kicked from the room if (statusCodes.contains(Status.KICKED_307)) { // Check if this occupant was kicked diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java index 60dba6c21..0cdbc03b0 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java @@ -50,10 +50,10 @@ import org.jivesoftware.smackx.disco.packet.DiscoverInfo; import org.jivesoftware.smackx.disco.packet.DiscoverItems; import org.jivesoftware.smackx.muc.packet.MUCInitialPresence; import org.jivesoftware.smackx.muc.packet.MUCUser; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.Jid; -import org.jxmpp.jid.JidWithLocalpart; +import org.jxmpp.jid.EntityJid; public final class MultiUserChatManager extends Manager { private final static String DISCO_NODE = MUCInitialPresence.NAMESPACE + "#rooms"; @@ -78,9 +78,9 @@ public final class MultiUserChatManager extends Manager { XMPPConnection connection = weakRefConnection.get(); if (connection == null) return Collections.emptyList(); - Set joinedRooms = MultiUserChatManager.getInstanceFor(connection).getJoinedRooms(); + Set joinedRooms = MultiUserChatManager.getInstanceFor(connection).getJoinedRooms(); List answer = new ArrayList(); - for (BareJid room : joinedRooms) { + for (EntityBareJid room : joinedRooms) { answer.add(new DiscoverItems.Item(room)); } return answer; @@ -111,14 +111,14 @@ public final class MultiUserChatManager extends Manager { new NotFilter(MessageTypeFilter.ERROR)); private final Set invitationsListeners = new CopyOnWriteArraySet(); - private final Set joinedRooms = new HashSet<>(); + private final Set joinedRooms = new HashSet<>(); /** * A Map of MUC JIDs to {@link MultiUserChat} instances. We use weak references for the values in order to allow * those instances to get garbage collected. Note that MultiUserChat instances can not get garbage collected while * the user is joined, because then the MUC will have PacketListeners added to the XMPPConnection. */ - private final Map> multiUserChats = new HashMap<>(); + private final Map> multiUserChats = new HashMap<>(); private MultiUserChatManager(XMPPConnection connection) { super(connection); @@ -131,7 +131,7 @@ public final class MultiUserChatManager extends Manager { final MUCUser mucUser = MUCUser.from(message); // Check if the MUCUser extension includes an invitation if (mucUser.getInvite() != null) { - BareJid mucJid = message.getFrom().asBareJidIfPossible(); + EntityBareJid mucJid = message.getFrom().asEntityBareJidIfPossible(); if (mucJid == null) { LOGGER.warning("Invite to non bare JID: '" + message.toXML() + "'"); return; @@ -160,7 +160,7 @@ public final class MultiUserChatManager extends Manager { * @param jid the name of the room in the form "roomName@service", where "service" is the hostname at which the * multi-user chat service is running. Make sure to provide a valid JID. */ - public synchronized MultiUserChat getMultiUserChat(BareJid jid) { + public synchronized MultiUserChat getMultiUserChat(EntityBareJid jid) { WeakReference weakRefMultiUserChat = multiUserChats.get(jid); if (weakRefMultiUserChat == null) { return createNewMucAndAddToMap(jid); @@ -172,7 +172,7 @@ public final class MultiUserChatManager extends Manager { return multiUserChat; } - private MultiUserChat createNewMucAndAddToMap(BareJid jid) { + private MultiUserChat createNewMucAndAddToMap(EntityBareJid jid) { MultiUserChat multiUserChat = new MultiUserChat(connection(), jid, this); multiUserChats.put(jid, new WeakReference(multiUserChat)); return multiUserChat; @@ -198,7 +198,7 @@ public final class MultiUserChatManager extends Manager { * * @return a List of the rooms where the user has joined using a given connection. */ - public Set getJoinedRooms() { + public Set getJoinedRooms() { return Collections.unmodifiableSet(joinedRooms); } @@ -213,15 +213,15 @@ public final class MultiUserChatManager extends Manager { * @throws NotConnectedException * @throws InterruptedException */ - public List getJoinedRooms(JidWithLocalpart user) throws NoResponseException, XMPPErrorException, + public List getJoinedRooms(EntityJid user) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { // Send the disco packet to the user DiscoverItems result = ServiceDiscoveryManager.getInstanceFor(connection()).discoverItems(user, DISCO_NODE); List items = result.getItems(); - List answer = new ArrayList<>(items.size()); + List answer = new ArrayList<>(items.size()); // Collect the entityID for each returned item for (DiscoverItems.Item item : items) { - BareJid muc = item.getEntityID().asBareJidIfPossible(); + EntityBareJid muc = item.getEntityID().asEntityBareJidIfPossible(); if (muc == null) { LOGGER.warning("Not a bare JID: " + item.getEntityID()); continue; @@ -242,7 +242,7 @@ public final class MultiUserChatManager extends Manager { * @throws NotConnectedException * @throws InterruptedException */ - public RoomInfo getRoomInfo(BareJid room) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { + public RoomInfo getRoomInfo(EntityBareJid room) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection()).discoverInfo(room); return new RoomInfo(info); } @@ -313,7 +313,7 @@ public final class MultiUserChatManager extends Manager { * @throws NotConnectedException * @throws InterruptedException */ - public void decline(BareJid room, String inviter, String reason) throws NotConnectedException, InterruptedException { + public void decline(EntityBareJid room, String inviter, String reason) throws NotConnectedException, InterruptedException { Message message = new Message(room); // Create the MUCUser packet that will include the rejection @@ -346,11 +346,11 @@ public final class MultiUserChatManager extends Manager { invitationsListeners.remove(listener); } - void addJoinedRoom(BareJid room) { + void addJoinedRoom(EntityBareJid room) { joinedRooms.add(room); } - void removeJoinedRoom(BareJid room) { + void removeJoinedRoom(EntityBareJid room) { joinedRooms.remove(room); } } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Occupant.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Occupant.java index 0e6f93301..b7bde0c58 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Occupant.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Occupant.java @@ -22,7 +22,7 @@ import java.util.logging.Logger; import org.jivesoftware.smackx.muc.packet.MUCItem; import org.jivesoftware.smackx.muc.packet.MUCUser; import org.jivesoftware.smack.packet.Presence; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.Jid; import org.jxmpp.jid.parts.Resourcepart; @@ -58,7 +58,7 @@ public class Occupant { this.affiliation = item.getAffiliation(); this.role = item.getRole(); // Get the nickname from the FROM attribute of the presence - FullJid from = presence.getFrom().asFullJidIfPossible(); + EntityFullJid from = presence.getFrom().asEntityFullJidIfPossible(); if (from == null) { LOGGER.warning("Occupant presence without resource: " + presence.getFrom()); this.nick = null; diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/ParticipantStatusListener.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/ParticipantStatusListener.java index 2464540d8..0fd810793 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/ParticipantStatusListener.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/ParticipantStatusListener.java @@ -17,7 +17,7 @@ package org.jivesoftware.smackx.muc; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.Jid; import org.jxmpp.jid.parts.Resourcepart; @@ -37,7 +37,7 @@ public interface ParticipantStatusListener { * @param participant the participant that has just joined the room * (e.g. room@conference.jabber.org/nick). */ - public abstract void joined(FullJid participant); + public abstract void joined(EntityFullJid participant); /** * Called when a room occupant has left the room on its own. This means that the occupant was @@ -46,7 +46,7 @@ public interface ParticipantStatusListener { * @param participant the participant that has left the room on its own. * (e.g. room@conference.jabber.org/nick). */ - public abstract void left(FullJid participant); + public abstract void left(EntityFullJid participant); /** * Called when a room participant has been kicked from the room. This means that the kicked @@ -57,7 +57,7 @@ public interface ParticipantStatusListener { * @param actor the moderator that kicked the occupant from the room (e.g. user@host.org). * @param reason the reason provided by the actor to kick the occupant from the room. */ - public abstract void kicked(FullJid participant, Jid actor, String reason); + public abstract void kicked(EntityFullJid participant, Jid actor, String reason); /** * Called when a moderator grants voice to a visitor. This means that the visitor @@ -66,7 +66,7 @@ public interface ParticipantStatusListener { * @param participant the participant that was granted voice in the room * (e.g. room@conference.jabber.org/nick). */ - public abstract void voiceGranted(FullJid participant); + public abstract void voiceGranted(EntityFullJid participant); /** * Called when a moderator revokes voice from a participant. This means that the participant @@ -76,7 +76,7 @@ public interface ParticipantStatusListener { * @param participant the participant that was revoked voice from the room * (e.g. room@conference.jabber.org/nick). */ - public abstract void voiceRevoked(FullJid participant); + public abstract void voiceRevoked(EntityFullJid participant); /** * Called when an administrator or owner banned a participant from the room. This means that @@ -87,7 +87,7 @@ public interface ParticipantStatusListener { * @param actor the administrator that banned the occupant (e.g. user@host.org). * @param reason the reason provided by the administrator to ban the occupant. */ - public abstract void banned(FullJid participant, Jid actor, String reason); + public abstract void banned(EntityFullJid participant, Jid actor, String reason); /** * Called when an administrator grants a user membership to the room. This means that the user @@ -96,7 +96,7 @@ public interface ParticipantStatusListener { * @param participant the participant that was granted membership in the room * (e.g. room@conference.jabber.org/nick). */ - public abstract void membershipGranted(FullJid participant); + public abstract void membershipGranted(EntityFullJid participant); /** * Called when an administrator revokes a user membership to the room. This means that the @@ -105,7 +105,7 @@ public interface ParticipantStatusListener { * @param participant the participant that was revoked membership from the room * (e.g. room@conference.jabber.org/nick). */ - public abstract void membershipRevoked(FullJid participant); + public abstract void membershipRevoked(EntityFullJid participant); /** * Called when an administrator grants moderator privileges to a user. This means that the user @@ -115,7 +115,7 @@ public interface ParticipantStatusListener { * @param participant the participant that was granted moderator privileges in the room * (e.g. room@conference.jabber.org/nick). */ - public abstract void moderatorGranted(FullJid participant); + public abstract void moderatorGranted(EntityFullJid participant); /** * Called when an administrator revokes moderator privileges from a user. This means that the @@ -125,7 +125,7 @@ public interface ParticipantStatusListener { * @param participant the participant that was revoked moderator privileges in the room * (e.g. room@conference.jabber.org/nick). */ - public abstract void moderatorRevoked(FullJid participant); + public abstract void moderatorRevoked(EntityFullJid participant); /** * Called when an owner grants a user ownership on the room. This means that the user @@ -135,7 +135,7 @@ public interface ParticipantStatusListener { * @param participant the participant that was granted ownership on the room * (e.g. room@conference.jabber.org/nick). */ - public abstract void ownershipGranted(FullJid participant); + public abstract void ownershipGranted(EntityFullJid participant); /** * Called when an owner revokes a user ownership on the room. This means that the user @@ -145,7 +145,7 @@ public interface ParticipantStatusListener { * @param participant the participant that was revoked ownership on the room * (e.g. room@conference.jabber.org/nick). */ - public abstract void ownershipRevoked(FullJid participant); + public abstract void ownershipRevoked(EntityFullJid participant); /** * Called when an owner grants administrator privileges to a user. This means that the user @@ -155,7 +155,7 @@ public interface ParticipantStatusListener { * @param participant the participant that was granted administrator privileges * (e.g. room@conference.jabber.org/nick). */ - public abstract void adminGranted(FullJid participant); + public abstract void adminGranted(EntityFullJid participant); /** * Called when an owner revokes administrator privileges from a user. This means that the user @@ -165,7 +165,7 @@ public interface ParticipantStatusListener { * @param participant the participant that was revoked administrator privileges * (e.g. room@conference.jabber.org/nick). */ - public abstract void adminRevoked(FullJid participant); + public abstract void adminRevoked(EntityFullJid participant); /** * Called when a participant changed his/her nickname in the room. The new participant's @@ -175,6 +175,6 @@ public interface ParticipantStatusListener { * (e.g. room@conference.jabber.org/nick). * @param newNickname the new nickname that the participant decided to use. */ - public abstract void nicknameChanged(FullJid participant, Resourcepart newNickname); + public abstract void nicknameChanged(EntityFullJid participant, Resourcepart newNickname); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/RoomInfo.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/RoomInfo.java index 7c927e44f..ed13e5c5d 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/RoomInfo.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/RoomInfo.java @@ -26,7 +26,7 @@ import java.util.logging.Logger; import org.jivesoftware.smackx.disco.packet.DiscoverInfo; import org.jivesoftware.smackx.xdata.Form; import org.jivesoftware.smackx.xdata.FormField; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.Jid; /** @@ -43,7 +43,7 @@ public class RoomInfo { /** * JID of the room. The localpart of the JID is commonly used as the ID of the room or name. */ - private final BareJid room; + private final EntityBareJid room; /** * Description of the room. */ @@ -132,7 +132,7 @@ public class RoomInfo { RoomInfo(DiscoverInfo info) { final Jid from = info.getFrom(); if (from != null) { - this.room = info.getFrom().asBareJidIfPossible(); + this.room = info.getFrom().asEntityBareJidIfPossible(); } else { this.room = null; } @@ -240,7 +240,7 @@ public class RoomInfo { * * @return the JID of the room whose information was discovered. */ - public BareJid getRoom() { + public EntityBareJid getRoom() { return room; } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/SubjectUpdatedListener.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/SubjectUpdatedListener.java index 8c55a5695..ee5f0e337 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/SubjectUpdatedListener.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/SubjectUpdatedListener.java @@ -17,7 +17,7 @@ package org.jivesoftware.smackx.muc; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; /** * A listener that is fired anytime a MUC room changes its subject. @@ -32,6 +32,6 @@ public interface SubjectUpdatedListener { * @param subject the new room's subject. * @param from the user that changed the room's subject (e.g. room@conference.jabber.org/nick). */ - public abstract void subjectUpdated(String subject, FullJid from); + public abstract void subjectUpdated(String subject, EntityFullJid from); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/packet/Destroy.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/packet/Destroy.java index dfa54bd2d..594fa4d5a 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/packet/Destroy.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/packet/Destroy.java @@ -20,7 +20,7 @@ import java.io.Serializable; import org.jivesoftware.smack.packet.NamedElement; import org.jivesoftware.smack.util.XmlStringBuilder; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; /** * Represents a request to the server to destroy a room. The sender of the request should be the @@ -38,13 +38,13 @@ public class Destroy implements NamedElement, Serializable { public static final String ELEMENT = "destroy"; private final String reason; - private final BareJid jid; + private final EntityBareJid jid; public Destroy(Destroy other) { this(other.jid, other.reason); } - public Destroy(BareJid alternativeJid, String reason) { + public Destroy(EntityBareJid alternativeJid, String reason) { this.jid = alternativeJid; this.reason = reason; } @@ -54,7 +54,7 @@ public class Destroy implements NamedElement, Serializable { * * @return the JID of an alternate location. */ - public BareJid getJid() { + public EntityBareJid getJid() { return jid; } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/provider/MUCParserUtils.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/provider/MUCParserUtils.java index 0e3bbb7b8..25c0be677 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/provider/MUCParserUtils.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/provider/MUCParserUtils.java @@ -23,7 +23,7 @@ import org.jivesoftware.smackx.muc.MUCAffiliation; import org.jivesoftware.smackx.muc.MUCRole; import org.jivesoftware.smackx.muc.packet.Destroy; import org.jivesoftware.smackx.muc.packet.MUCItem; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.Jid; import org.jxmpp.jid.parts.Resourcepart; import org.xmlpull.v1.XmlPullParser; @@ -64,7 +64,7 @@ public class MUCParserUtils { public static Destroy parseDestroy(XmlPullParser parser) throws XmlPullParserException, IOException { final int initialDepth = parser.getDepth(); - final BareJid jid = ParserUtils.getBareJidAttribute(parser); + final EntityBareJid jid = ParserUtils.getBareJidAttribute(parser); String reason = null; outerloop: while (true) { int eventType = parser.next(); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/VCardManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/VCardManager.java index 60a8dacaf..76acf2c48 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/VCardManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/VCardManager.java @@ -30,7 +30,7 @@ import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.id.StanzaIdUtil; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.jivesoftware.smackx.vcardtemp.packet.VCard; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.Jid; public final class VCardManager extends Manager { @@ -125,7 +125,7 @@ public final class VCardManager extends Manager { * @throws NotConnectedException * @throws InterruptedException */ - public VCard loadVCard(BareJid bareJid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { + public VCard loadVCard(EntityBareJid bareJid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { VCard vcardRequest = new VCard(); vcardRequest.setTo(bareJid); VCard result = connection().createPacketCollectorAndSend(vcardRequest).nextResultOrThrow(); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java index a7cc9cbf3..747c8adb8 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java @@ -40,7 +40,7 @@ import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.stringencoder.Base64; import org.jivesoftware.smackx.vcardtemp.VCardManager; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; /** * A VCard class for use with the @@ -552,10 +552,10 @@ public class VCard extends IQ { * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException - * @deprecated use {@link VCardManager#loadVCard(BareJid)} instead. + * @deprecated use {@link VCardManager#loadVCard(EntityBareJid)} instead. */ @Deprecated - public void load(XMPPConnection connection, BareJid user) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { + public void load(XMPPConnection connection, EntityBareJid user) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { VCard result = VCardManager.getInstanceFor(connection).loadVCard(user); copyFieldsFrom(result); } diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManagerTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManagerTest.java index 637e9e191..7f072191b 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManagerTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManagerTest.java @@ -37,7 +37,7 @@ import org.jivesoftware.util.Verification; import org.junit.Before; import org.junit.Test; import org.jxmpp.jid.DomainBareJid; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.JidTestUtil; /** @@ -48,8 +48,8 @@ import org.jxmpp.jid.JidTestUtil; public class InBandBytestreamManagerTest extends InitExtensions { // settings - static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; - static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; + static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; + static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; String sessionID = "session_id"; diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionMessageTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionMessageTest.java index 4ed6c5715..5b23aeb5c 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionMessageTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionMessageTest.java @@ -42,7 +42,7 @@ import org.jivesoftware.util.Verification; import org.junit.Before; import org.junit.Test; import org.jxmpp.jid.DomainBareJid; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.JidTestUtil; import org.powermock.reflect.Whitebox; @@ -56,8 +56,8 @@ import org.powermock.reflect.Whitebox; public class InBandBytestreamSessionMessageTest extends InitExtensions { // settings - static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; - static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; + static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; + static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; String sessionID = "session_id"; diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionTest.java index 0a8eae3ba..5ddc9d896 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSessionTest.java @@ -42,7 +42,7 @@ import org.jivesoftware.util.Verification; import org.junit.Before; import org.junit.Test; import org.jxmpp.jid.DomainBareJid; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.JidTestUtil; import org.powermock.reflect.Whitebox; @@ -57,8 +57,8 @@ import org.powermock.reflect.Whitebox; public class InBandBytestreamSessionTest extends InitExtensions { // settings - static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; - static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; + static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; + static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; String sessionID = "session_id"; diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InitiationListenerTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InitiationListenerTest.java index 00d49361d..b59a4c336 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InitiationListenerTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/ibb/InitiationListenerTest.java @@ -29,7 +29,7 @@ import org.jivesoftware.smackx.bytestreams.BytestreamRequest; import org.jivesoftware.smackx.bytestreams.ibb.packet.Open; import org.junit.Before; import org.junit.Test; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.impl.JidCreate; import org.mockito.ArgumentCaptor; @@ -42,8 +42,8 @@ import org.powermock.reflect.Whitebox; */ public class InitiationListenerTest extends InitExtensions { - static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; - static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; + static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; + static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; String sessionID = "session_id"; XMPPConnection connection; diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/InitiationListenerTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/InitiationListenerTest.java index 36321e879..317d23eb6 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/InitiationListenerTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/InitiationListenerTest.java @@ -30,7 +30,7 @@ import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.junit.Before; import org.junit.Test; import org.jxmpp.jid.DomainBareJid; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.impl.JidCreate; import org.mockito.ArgumentCaptor; @@ -43,8 +43,8 @@ import org.powermock.reflect.Whitebox; */ public class InitiationListenerTest { - static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; - static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; + static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; + static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG; String proxyAddress = "127.0.0.1"; diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java index faae60a20..d60d0f585 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java @@ -51,7 +51,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.jxmpp.jid.DomainBareJid; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.stringprep.XmppStringprepException; @@ -64,8 +64,8 @@ import org.jxmpp.stringprep.XmppStringprepException; public class Socks5ByteStreamManagerTest { // settings - static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; - static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; + static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; + static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG; String proxyAddress = "127.0.0.1"; diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamRequestTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamRequestTest.java index 16dcb57fd..0c7850d27 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamRequestTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamRequestTest.java @@ -41,7 +41,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.jxmpp.jid.DomainBareJid; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.impl.JidCreate; @@ -53,8 +53,8 @@ import org.jxmpp.jid.impl.JidCreate; public class Socks5ByteStreamRequestTest { // settings - static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; - static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; + static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; + static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG; String proxyAddress = "127.0.0.1"; diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java index 79ec5976b..216f30f4f 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java @@ -43,7 +43,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.jxmpp.jid.DomainBareJid; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.JidTestUtil; /** @@ -54,8 +54,8 @@ import org.jxmpp.jid.JidTestUtil; public class Socks5ClientForInitiatorTest { // settings - static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; - static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; + static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; + static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG; String proxyAddress = "127.0.0.1"; diff --git a/smack-extensions/src/test/java/org/jivesoftware/util/ConnectionUtils.java b/smack-extensions/src/test/java/org/jivesoftware/util/ConnectionUtils.java index ef5b94362..1f120e03d 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/util/ConnectionUtils.java +++ b/smack-extensions/src/test/java/org/jivesoftware/util/ConnectionUtils.java @@ -33,7 +33,7 @@ import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.XMPPError; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.jxmpp.jid.DomainBareJid; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -69,7 +69,7 @@ public class ConnectionUtils { * @throws InterruptedException */ public static XMPPConnection createMockedConnection(final Protocol protocol, - FullJid initiatorJID, DomainBareJid xmppServer) throws SmackException, XMPPErrorException, InterruptedException { + EntityFullJid initiatorJID, DomainBareJid xmppServer) throws SmackException, XMPPErrorException, InterruptedException { // mock XMPP connection XMPPConnection connection = mock(XMPPConnection.class); diff --git a/smack-extensions/src/test/java/org/jivesoftware/util/Protocol.java b/smack-extensions/src/test/java/org/jivesoftware/util/Protocol.java index 0724e223e..e9cff8009 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/util/Protocol.java +++ b/smack-extensions/src/test/java/org/jivesoftware/util/Protocol.java @@ -36,7 +36,7 @@ import org.jivesoftware.smack.packet.Stanza; /** * This class can be used in conjunction with a mocked XMPP connection ( - * {@link ConnectionUtils#createMockedConnection(Protocol, org.jxmpp.jid.FullJid, org.jxmpp.jid.DomainBareJid)}) to + * {@link ConnectionUtils#createMockedConnection(Protocol, org.jxmpp.jid.EntityFullJid, org.jxmpp.jid.DomainBareJid)}) to * verify an XMPP protocol. This can be accomplished in the following was: *

    *
  • add responses to packets sent over the mocked XMPP connection by the diff --git a/smack-im/src/main/java/org/jivesoftware/smack/chat/Chat.java b/smack-im/src/main/java/org/jivesoftware/smack/chat/Chat.java index 498debbb0..88d8cc402 100644 --- a/smack-im/src/main/java/org/jivesoftware/smack/chat/Chat.java +++ b/smack-im/src/main/java/org/jivesoftware/smack/chat/Chat.java @@ -21,7 +21,7 @@ import org.jivesoftware.smack.PacketCollector; import org.jivesoftware.smack.SmackException.NotConnectedException; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.util.StringUtils; -import org.jxmpp.jid.JidWithLocalpart; +import org.jxmpp.jid.EntityJid; import java.util.Set; import java.util.Collections; @@ -41,7 +41,7 @@ public class Chat { private ChatManager chatManager; private String threadID; - private JidWithLocalpart participant; + private EntityJid participant; private final Set listeners = new CopyOnWriteArraySet(); /** @@ -51,7 +51,7 @@ public class Chat { * @param participant the user to chat with. * @param threadID the thread ID to use. */ - Chat(ChatManager chatManager, JidWithLocalpart participant, String threadID) { + Chat(ChatManager chatManager, EntityJid participant, String threadID) { if (StringUtils.isEmpty(threadID)) { throw new IllegalArgumentException("Thread ID must not be null"); } @@ -76,7 +76,7 @@ public class Chat { * * @return the name of the user the chat is occuring with. */ - public JidWithLocalpart getParticipant() { + public EntityJid getParticipant() { return participant; } diff --git a/smack-im/src/main/java/org/jivesoftware/smack/chat/ChatManager.java b/smack-im/src/main/java/org/jivesoftware/smack/chat/ChatManager.java index 5d4345a44..0591b5971 100644 --- a/smack-im/src/main/java/org/jivesoftware/smack/chat/ChatManager.java +++ b/smack-im/src/main/java/org/jivesoftware/smack/chat/ChatManager.java @@ -42,9 +42,9 @@ import org.jivesoftware.smack.filter.ThreadFilter; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Message.Type; import org.jivesoftware.smack.packet.Stanza; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.Jid; -import org.jxmpp.jid.JidWithLocalpart; +import org.jxmpp.jid.EntityJid; /** * The chat manager keeps track of references to all current chats. It will not hold any references @@ -135,7 +135,7 @@ public final class ChatManager extends Manager{ /** * Maps base jids to chats */ - private Map baseJidChats = new ConcurrentHashMap<>(); + private Map baseJidChats = new ConcurrentHashMap<>(); private Set chatManagerListeners = new CopyOnWriteArraySet(); @@ -217,7 +217,7 @@ public final class ChatManager extends Manager{ * @param userJID the user this chat is with. * @return the created chat. */ - public Chat createChat(JidWithLocalpart userJID) { + public Chat createChat(EntityJid userJID) { return createChat(userJID, null); } @@ -228,7 +228,7 @@ public final class ChatManager extends Manager{ * @param listener the optional listener which will listen for new messages from this chat. * @return the created chat. */ - public Chat createChat(JidWithLocalpart userJID, ChatMessageListener listener) { + public Chat createChat(EntityJid userJID, ChatMessageListener listener) { return createChat(userJID, null, listener); } @@ -240,7 +240,7 @@ public final class ChatManager extends Manager{ * @param listener the optional listener to add to the chat * @return the created chat. */ - public Chat createChat(JidWithLocalpart userJID, String thread, ChatMessageListener listener) { + public Chat createChat(EntityJid userJID, String thread, ChatMessageListener listener) { if (thread == null) { thread = nextID(); } @@ -253,7 +253,7 @@ public final class ChatManager extends Manager{ return chat; } - private Chat createChat(JidWithLocalpart userJID, String threadID, boolean createdLocally) { + private Chat createChat(EntityJid userJID, String threadID, boolean createdLocally) { Chat chat = new Chat(this, userJID, threadID); threadChats.put(threadID, chat); jidChats.put(userJID, chat); @@ -268,7 +268,7 @@ public final class ChatManager extends Manager{ void closeChat(Chat chat) { threadChats.remove(chat.getThreadID()); - JidWithLocalpart userJID = chat.getParticipant(); + EntityJid userJID = chat.getParticipant(); jidChats.remove(userJID); baseJidChats.remove(userJID.withoutResource()); } @@ -288,7 +288,7 @@ public final class ChatManager extends Manager{ return null; } - JidWithLocalpart userJID = from.asJidWithLocalpartIfPossible(); + EntityJid userJID = from.asEntityJidIfPossible(); if (userJID == null) { LOGGER.warning("Message from JID without localpart: '" +message.toXML() + "'"); return null; @@ -322,7 +322,7 @@ public final class ChatManager extends Manager{ Chat match = jidChats.get(userJID); if (match == null && (matchMode == MatchMode.BARE_JID)) { - match = baseJidChats.get(userJID.asBareJidIfPossible()); + match = baseJidChats.get(userJID.asEntityBareJidIfPossible()); } return match; } diff --git a/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java b/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java index 53bbaa313..4a1fad0fd 100644 --- a/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java +++ b/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java @@ -63,9 +63,9 @@ import org.jivesoftware.smack.roster.packet.RosterPacket.Item; import org.jivesoftware.smack.roster.packet.SubscriptionPreApproval; import org.jivesoftware.smack.roster.rosterstore.RosterStore; import org.jivesoftware.smack.util.Objects; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.Jid; -import org.jxmpp.jid.JidWithResource; +import org.jxmpp.jid.FullJid; import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.parts.Resourcepart; @@ -847,7 +847,7 @@ public final class Roster extends Manager { * @return the user's current presence, or unavailable presence if the user is offline * or if no presence information is available. */ - public Presence getPresenceResource(JidWithResource userWithResource) { + public Presence getPresenceResource(FullJid userWithResource) { Jid key = getMapKey(userWithResource); Resourcepart resource = userWithResource.getResourcepart(); Map userPresences = presenceMap.get(key); @@ -1038,7 +1038,7 @@ public final class Roster extends Manager { if (entries.containsKey(user)) { return user; } - BareJid bareJid = user.asBareJidIfPossible(); + EntityBareJid bareJid = user.asEntityBareJidIfPossible(); if (bareJid != null) { return bareJid; } @@ -1059,7 +1059,7 @@ public final class Roster extends Manager { if (resources != null) { for (Resourcepart resource : resources.keySet()) { packetUnavailable = new Presence(Presence.Type.unavailable); - BareJid bareUserJid = user.asBareJidIfPossible(); + EntityBareJid bareUserJid = user.asEntityBareJidIfPossible(); if (bareUserJid == null) { LOGGER.warning("Can not transform user JID to bare JID: '" + user + "'"); continue; @@ -1346,7 +1346,7 @@ public final class Roster extends Manager { // No need to act on error presences send without from, i.e. // directly send from the users XMPP service, or where the from // address is not a bare JID - if (from == null || !from.isBareJid()) { + if (from == null || !from.isEntityBareJid()) { break; } userPresences = getUserPresences(key); @@ -1470,7 +1470,7 @@ public final class Roster extends Manager { // Roster push (RFC 6121, 2.1.6) // A roster push with a non-empty from not matching our address MUST be ignored - BareJid jid = connection.getUser().asBareJid(); + EntityBareJid jid = connection.getUser().asBareJid(); Jid from = rosterPacket.getFrom(); if (from != null && !from.equals(jid)) { LOGGER.warning("Ignoring roster push with a non matching 'from' ourJid='" + jid + "' from='" + from diff --git a/smack-im/src/test/java/org/jivesoftware/smack/chat/ChatConnectionTest.java b/smack-im/src/test/java/org/jivesoftware/smack/chat/ChatConnectionTest.java index e23df76b8..26ee8c2b6 100644 --- a/smack-im/src/test/java/org/jivesoftware/smack/chat/ChatConnectionTest.java +++ b/smack-im/src/test/java/org/jivesoftware/smack/chat/ChatConnectionTest.java @@ -82,7 +82,7 @@ public class ChatConnectionTest { } @Test - public void validateDefaultSetMatchModeBareJid() { + public void validateDefaultSetMatchModeEntityBareJid() { ChatManager.setDefaultMatchMode(MatchMode.BARE_JID); assertEquals(MatchMode.BARE_JID, ChatManager.getInstanceFor(new DummyConnection()).getMatchMode()); } @@ -220,7 +220,7 @@ public class ChatConnectionTest { * id and the user is a full jid. */ @Test - public void chatFoundWhenNoThreadFullJid() { + public void chatFoundWhenNoThreadEntityFullJid() { Chat outgoing = cm.createChat(JidTestUtil.DUMMY_AT_EXAMPLE_ORG, null); Stanza incomingChat = createChatPacket(null, true); @@ -252,7 +252,7 @@ public class ChatConnectionTest { * and the user is a full jid. */ @Test - public void chatFoundWithSameThreadFullJid() { + public void chatFoundWithSameThreadEntityFullJid() { Chat outgoing = cm.createChat(JidTestUtil.DUMMY_AT_EXAMPLE_ORG, null); Stanza incomingChat = createChatPacket(outgoing.getThreadID(), true); @@ -300,7 +300,7 @@ public class ChatConnectionTest { * different id and the same base jid. */ @Test - public void chatNotFoundWithDiffThreadFullJid() { + public void chatNotFoundWithDiffThreadEntityFullJid() { Chat outgoing = cm.createChat(JidTestUtil.DUMMY_AT_EXAMPLE_ORG, null); Stanza incomingChat = createChatPacket(outgoing.getThreadID() + "ff", true); @@ -322,11 +322,11 @@ public class ChatConnectionTest { assertNull(listener.getNewChat()); } - private static Message createChatPacket(final String threadId, final boolean isFullJid) { + private static Message createChatPacket(final String threadId, final boolean isEntityFullJid) { Message chatMsg = new Message(JidTestUtil.BARE_JID_1, Message.Type.chat); chatMsg.setBody("the body message - " + System.currentTimeMillis()); Jid jid; - if (isFullJid) { + if (isEntityFullJid) { jid = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; } else { jid = JidTestUtil.DUMMY_AT_EXAMPLE_ORG; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java index 0cd4c1c18..02f437351 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java @@ -31,7 +31,7 @@ import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smackx.muc.MultiUserChat.MucCreateConfigFormHandle; -import org.jxmpp.jid.BareJid; +import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.parts.Localpart; @@ -63,7 +63,7 @@ public class MultiUserChatIntegrationTest extends AbstractSmackIntegrationTest { @SmackIntegrationTest public void mucTest() throws TimeoutException, Exception { - BareJid mucAddress = JidCreate.bareFrom(Localpart.from("smack-inttest-" + randomString), mucService.getDomain()); + EntityBareJid mucAddress = JidCreate.bareFrom(Localpart.from("smack-inttest-" + randomString), mucService.getDomain()); MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress); MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress); diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleManager.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleManager.java index a132eaa8b..683aa1a9e 100644 --- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleManager.java +++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleManager.java @@ -47,7 +47,7 @@ import org.jivesoftware.smackx.jingleold.nat.TransportCandidate; import org.jivesoftware.smackx.jingleold.nat.TransportResolver; import org.jivesoftware.smackx.jingleold.packet.Jingle; import org.jivesoftware.smackx.jingleold.provider.JingleProvider; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.Jid; /** @@ -520,7 +520,7 @@ public class JingleManager implements JingleSessionListener { * user. * @return The session on which the negotiation can be run. */ - public JingleSession createOutgoingJingleSession(FullJid responder) throws XMPPException { + public JingleSession createOutgoingJingleSession(EntityFullJid responder) throws XMPPException { JingleSession session = new JingleSession(connection, (JingleSessionRequest) null, connection.getUser(), responder, jingleMediaManagers); triggerSessionCreated(session); diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java index d326e94bd..34a89a589 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java @@ -26,7 +26,7 @@ import org.jivesoftware.smack.filter.StanzaFilter; import org.jivesoftware.smack.filter.StanzaTypeFilter; import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.Presence; -import org.jxmpp.jid.FullJid; +import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.Jid; import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.util.XmppStringUtils; @@ -252,7 +252,7 @@ public class AgentRoster { private Jid getPresenceMapKey(Jid user) { Jid key = user; if (!contains(user)) { - key = user.asBareJidIfPossible(); + key = user.asEntityBareJidIfPossible(); } return key; } @@ -287,7 +287,7 @@ public class AgentRoster { private class PresencePacketListener implements StanzaListener { public void processPacket(Stanza packet) { Presence presence = (Presence)packet; - FullJid from = presence.getFrom().asFullJidIfPossible(); + EntityFullJid from = presence.getFrom().asEntityFullJidIfPossible(); if (from == null) { // TODO Check if we need to ignore these presences or this is a server bug? LOGGER.warning("Presence with non full JID from: " + presence.toXML()); @@ -326,7 +326,7 @@ public class AgentRoster { synchronized (entries) { for (Iterator i = entries.iterator(); i.hasNext();) { String entry = i.next(); - if (entry.equals(key.asBareJidIfPossible())) { + if (entry.equals(key.asEntityBareJidIfPossible())) { fireEvent(EVENT_PRESENCE_CHANGED, packet); } } @@ -347,7 +347,7 @@ public class AgentRoster { synchronized (entries) { for (Iterator i = entries.iterator(); i.hasNext();) { String entry = i.next(); - if (entry.equals(key.asBareJidIfPossible())) { + if (entry.equals(key.asEntityBareJidIfPossible())) { fireEvent(EVENT_PRESENCE_CHANGED, packet); } } diff --git a/version.gradle b/version.gradle index ba09d576f..8dcaa0258 100644 --- a/version.gradle +++ b/version.gradle @@ -2,7 +2,7 @@ allprojects { ext { shortVersion = '4.2.0-alpha2' isSnapshot = true - jxmppVersion = '0.5.0-alpha3' + jxmppVersion = '0.5.0-alpha4' smackMinAndroidSdk = 8 } }