1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 15:52:06 +01:00

Bump jxmpp to 0.5.0-alpha4

This commit is contained in:
Florian Schmaus 2015-05-27 19:29:51 +02:00
parent 8840236b72
commit c125a3b055
49 changed files with 208 additions and 208 deletions

View file

@ -82,7 +82,7 @@ import org.jivesoftware.smack.util.SmackExecutorThreadFactory;
import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.dns.HostAddress; import org.jivesoftware.smack.util.dns.HostAddress;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.jid.parts.Resourcepart;
import org.jxmpp.util.XmppStringUtils; import org.jxmpp.util.XmppStringUtils;
@ -158,7 +158,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* certificate. * certificate.
* </p> * </p>
*/ */
protected FullJid user; protected EntityFullJid user;
protected boolean connected = false; protected boolean connected = false;
@ -475,7 +475,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
} }
@Override @Override
public final FullJid getUser() { public final EntityFullJid getUser() {
return user; return user;
} }
@ -1586,7 +1586,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
@Override @Override
public final String toString() { public final String toString() {
FullJid localEndpoint = getUser(); EntityFullJid localEndpoint = getUser();
String localEndpointString = (localEndpoint == null ? "not-authenticated" : localEndpoint.toString()); String localEndpointString = (localEndpoint == null ? "not-authenticated" : localEndpoint.toString());
return getClass().getSimpleName() + '[' + localEndpointString + "] (" + getConnectionCounter() + ')'; return getClass().getSimpleName() + '[' + localEndpointString + "] (" + getConnectionCounter() + ')';
} }

View file

@ -27,7 +27,7 @@ import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.packet.ExtensionElement; import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.PlainStreamElement; import org.jivesoftware.smack.packet.PlainStreamElement;
import org.jxmpp.jid.DomainBareJid; 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 * 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. * @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 * Returns the stream ID for this connection, which is the value set by the server

View file

@ -24,7 +24,7 @@ import org.jivesoftware.smack.util.ObservableReader;
import org.jivesoftware.smack.util.ObservableWriter; import org.jivesoftware.smack.util.ObservableWriter;
import org.jivesoftware.smack.util.ReaderListener; import org.jivesoftware.smack.util.ReaderListener;
import org.jivesoftware.smack.util.WriterListener; import org.jivesoftware.smack.util.WriterListener;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import java.io.Reader; import java.io.Reader;
import java.io.Writer; import java.io.Writer;
@ -142,7 +142,7 @@ public abstract class AbstractDebugger implements SmackDebugger {
} }
@Override @Override
public void userHasLogged(FullJid user) { public void userHasLogged(EntityFullJid user) {
String localpart = user.getLocalpart().toString(); String localpart = user.getLocalpart().toString();
boolean isAnonymous = "".equals(localpart); boolean isAnonymous = "".equals(localpart);
String title = String title =

View file

@ -21,7 +21,7 @@ import java.io.Reader;
import java.io.Writer; import java.io.Writer;
import org.jivesoftware.smack.StanzaListener; 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 * 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 * @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. * Returns the special Reader that wraps the main Reader and logs data to the GUI.

View file

@ -23,7 +23,7 @@ import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.Stanza;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
/** /**
@ -55,7 +55,7 @@ public class IQReplyFilter implements StanzaFilter {
private final StanzaFilter iqAndIdFilter; private final StanzaFilter iqAndIdFilter;
private final OrFilter fromFilter; private final OrFilter fromFilter;
private final Jid to; private final Jid to;
private final FullJid local; private final EntityFullJid local;
private final DomainBareJid server; private final DomainBareJid server;
private final String packetId; private final String packetId;

View file

@ -17,7 +17,7 @@
package org.jivesoftware.smack.packet; package org.jivesoftware.smack.packet;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.parts.Resourcepart; 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"; public static final String NAMESPACE = "urn:ietf:params:xml:ns:xmpp-bind";
private final Resourcepart resource; 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); super(ELEMENT, NAMESPACE);
this.resource = resource; this.resource = resource;
this.jid = jid; this.jid = jid;
@ -49,7 +49,7 @@ public class Bind extends IQ {
return resource; return resource;
} }
public FullJid getJid() { public EntityFullJid getJid() {
return jid; return jid;
} }
@ -59,7 +59,7 @@ public class Bind extends IQ {
return bind; return bind;
} }
public static Bind newResult(FullJid jid) { public static Bind newResult(EntityFullJid jid) {
return new Bind(null, jid); return new Bind(null, jid);
} }

View file

@ -20,7 +20,7 @@ import java.io.IOException;
import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.packet.Bind; 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.impl.JidCreate;
import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.jid.parts.Resourcepart;
import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParser;
@ -44,7 +44,7 @@ public class BindIQProvider extends IQProvider<Bind> {
bind = Bind.newSet(Resourcepart.from(resourceString)); bind = Bind.newSet(Resourcepart.from(resourceString));
break; break;
case "jid": case "jid":
FullJid fullJid = JidCreate.fullFrom(parser.nextText()); EntityFullJid fullJid = JidCreate.fullFrom(parser.nextText());
bind = Bind.newResult(fullJid); bind = Bind.newResult(fullJid);
break; break;
} }

View file

@ -23,7 +23,7 @@ import java.text.ParseException;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
import org.jxmpp.jid.BareJid; import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.jid.parts.Resourcepart;
@ -67,11 +67,11 @@ public class ParserUtils {
return JidCreate.from(jidString); return JidCreate.from(jidString);
} }
public static BareJid getBareJidAttribute(XmlPullParser parser) throws XmppStringprepException { public static EntityBareJid getBareJidAttribute(XmlPullParser parser) throws XmppStringprepException {
return getBareJidAttribute(parser, JID); 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); final String jidString = parser.getAttributeValue("", name);
if (jidString == null) { if (jidString == null) {
return null; return null;

View file

@ -28,7 +28,7 @@ import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.packet.PlainStreamElement; import org.jivesoftware.smack.packet.PlainStreamElement;
import org.jivesoftware.smack.packet.TopLevelStreamElement; 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.JidTestUtil;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.jid.parts.Resourcepart;
@ -65,7 +65,7 @@ public class DummyConnection extends AbstractXMPPConnection {
this(getDummyConfigurationBuilder().build()); this(getDummyConfigurationBuilder().build());
} }
private FullJid getUserJid() { private EntityFullJid getUserJid() {
try { try {
return JidCreate.fullFrom(config.getUsername() return JidCreate.fullFrom(config.getUsername()
+ "@" + "@"

View file

@ -21,7 +21,7 @@ import static org.junit.Assert.assertFalse;
import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.Stanza;
import org.junit.Test; import org.junit.Test;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
@ -32,8 +32,8 @@ import org.jxmpp.jid.JidTestUtil;
*/ */
public class FromMatchesFilterTest { public class FromMatchesFilterTest {
private static final Jid BASE_JID1 = JidTestUtil.BARE_JID_1; 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 EntityFullJid 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_R2 = JidTestUtil.FULL_JID_1_RESOURCE_2;
private static final Jid BASE_JID2 = JidTestUtil.BARE_JID_2; private static final Jid BASE_JID2 = JidTestUtil.BARE_JID_2;
private static final Jid FULL_JID2 = JidTestUtil.FULL_JID_2_RESOURCE_1; 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; private static final Jid SERVICE_JID2 = JidTestUtil.PUBSUB_EXAMPLE_ORG;
@Test @Test
public void autoCompareMatchingFullJid() public void autoCompareMatchingEntityFullJid()
{ {
FromMatchesFilter filter = FromMatchesFilter.create(FULL_JID1_R1); FromMatchesFilter filter = FromMatchesFilter.create(FULL_JID1_R1);
Stanza packet = new Stanza() { Stanza packet = new Stanza() {
@ -124,7 +124,7 @@ public class FromMatchesFilterTest {
} }
@Test @Test
public void bareCompareMatchingFullJid() public void bareCompareMatchingEntityFullJid()
{ {
FromMatchesFilter filter = FromMatchesFilter.createBare(FULL_JID1_R1); FromMatchesFilter filter = FromMatchesFilter.createBare(FULL_JID1_R1);
Stanza packet = new Stanza() { Stanza packet = new Stanza() {
@ -205,7 +205,7 @@ public class FromMatchesFilterTest {
} }
@Test @Test
public void fullCompareMatchingFullJid() public void fullCompareMatchingEntityFullJid()
{ {
FromMatchesFilter filter = FromMatchesFilter.createFull(FULL_JID1_R1); FromMatchesFilter filter = FromMatchesFilter.createFull(FULL_JID1_R1);
Stanza packet = new Stanza() { Stanza packet = new Stanza() {

View file

@ -23,7 +23,7 @@ import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.debugger.SmackDebugger; import org.jivesoftware.smack.debugger.SmackDebugger;
import org.jivesoftware.smack.util.ObservableReader; import org.jivesoftware.smack.util.ObservableReader;
import org.jivesoftware.smack.util.ObservableWriter; import org.jivesoftware.smack.util.ObservableWriter;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -93,7 +93,7 @@ public class SLF4JSmackDebugger implements SmackDebugger {
} }
@Override @Override
public void userHasLogged(FullJid user) { public void userHasLogged(EntityFullJid user) {
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("({}) User logged in {}", connection.hashCode(), user.toString()); logger.debug("({}) User logged in {}", connection.hashCode(), user.toString());
} }

View file

@ -32,7 +32,7 @@ import org.jivesoftware.smack.util.ObservableWriter;
import org.jivesoftware.smack.util.ReaderListener; import org.jivesoftware.smack.util.ReaderListener;
import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.WriterListener; import org.jivesoftware.smack.util.WriterListener;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
@ -743,7 +743,7 @@ public class EnhancedDebugger implements SmackDebugger {
} }
@Override @Override
public void userHasLogged(final FullJid user) { public void userHasLogged(final EntityFullJid user) {
final EnhancedDebugger debugger = this; final EnhancedDebugger debugger = this;
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
public void run() { public void run() {

View file

@ -48,7 +48,7 @@ import org.jivesoftware.smack.util.ObservableReader;
import org.jivesoftware.smack.util.ObservableWriter; import org.jivesoftware.smack.util.ObservableWriter;
import org.jivesoftware.smack.util.ReaderListener; import org.jivesoftware.smack.util.ReaderListener;
import org.jivesoftware.smack.util.WriterListener; 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 * The LiteDebugger is a very simple debugger that allows to debug sent, received and
@ -325,7 +325,7 @@ public class LiteDebugger implements SmackDebugger {
} }
@Override @Override
public void userHasLogged(FullJid user) { public void userHasLogged(EntityFullJid user) {
String title = String title =
"Smack Debug Window -- " "Smack Debug Window -- "
+ user; + user;

View file

@ -65,7 +65,7 @@ public class MultipleRecipientInfo {
* @return the JID of a MUC room to which responses should be sent or <tt>null</tt> if * @return the JID of a MUC room to which responses should be sent or <tt>null</tt> if
* no specific address was provided. * no specific address was provided.
*/ */
// TODO should return BareJid // TODO should return EntityBareJid
public Jid getReplyRoom() { public Jid getReplyRoom() {
List<MultipleAddresses.Address> replyRoom = extension.getAddressesOfType(MultipleAddresses.Type.replyroom); List<MultipleAddresses.Address> replyRoom = extension.getAddressesOfType(MultipleAddresses.Type.replyroom);
return replyRoom.isEmpty() ? null : replyRoom.get(0).getJid(); return replyRoom.isEmpty() ? null : replyRoom.get(0).getJid();

View file

@ -28,9 +28,9 @@ import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.address.packet.MultipleAddresses; import org.jivesoftware.smackx.address.packet.MultipleAddresses;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; 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.DomainBareJid;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
import java.util.ArrayList; import java.util.ArrayList;
@ -178,9 +178,9 @@ public class MultipleRecipientManager {
to.add(original.getFrom()); to.add(original.getFrom());
} }
// Remove the sender from the TO/CC list (try with bare JID too) // 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)) { if (!to.remove(from) && !cc.remove(from)) {
BareJid bareJID = from.asBareJid(); EntityBareJid bareJID = from.asBareJid();
to.remove(bareJID); to.remove(bareJID);
cc.remove(bareJID); cc.remove(bareJID);
} }

View file

@ -28,7 +28,7 @@ import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import org.jivesoftware.smackx.iqprivate.PrivateDataManager; import org.jivesoftware.smackx.iqprivate.PrivateDataManager;
import org.jxmpp.jid.BareJid; import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.jid.parts.Resourcepart;
@ -111,7 +111,7 @@ public final class BookmarkManager {
* @throws NotConnectedException * @throws NotConnectedException
* @throws InterruptedException * @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 Resourcepart nickname, String password) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException
{ {
retrieveBookmarks(); retrieveBookmarks();
@ -146,7 +146,7 @@ public final class BookmarkManager {
* @throws IllegalArgumentException thrown when the conference being removed is a shared * @throws IllegalArgumentException thrown when the conference being removed is a shared
* conference * conference
*/ */
public void removeBookmarkedConference(BareJid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { public void removeBookmarkedConference(EntityBareJid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
retrieveBookmarks(); retrieveBookmarks();
Iterator<BookmarkedConference> it = bookmarks.getBookmarkedConferences().iterator(); Iterator<BookmarkedConference> it = bookmarks.getBookmarkedConferences().iterator();
while(it.hasNext()) { while(it.hasNext()) {

View file

@ -17,7 +17,7 @@
package org.jivesoftware.smackx.bookmarks; package org.jivesoftware.smackx.bookmarks;
import org.jxmpp.jid.BareJid; import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.jid.parts.Resourcepart;
/** /**
@ -29,17 +29,17 @@ public class BookmarkedConference implements SharedBookmark {
private String name; private String name;
private boolean autoJoin; private boolean autoJoin;
private final BareJid jid; private final EntityBareJid jid;
private Resourcepart nickname; private Resourcepart nickname;
private String password; private String password;
private boolean isShared; private boolean isShared;
protected BookmarkedConference(BareJid jid) { protected BookmarkedConference(EntityBareJid jid) {
this.jid = 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) String password)
{ {
this.name = name; this.name = name;
@ -81,7 +81,7 @@ public class BookmarkedConference implements SharedBookmark {
* *
* @return the full JID of this conference room. * @return the full JID of this conference room.
*/ */
public BareJid getJid() { public EntityBareJid getJid() {
return jid; return jid;
} }

View file

@ -20,7 +20,7 @@ import org.jivesoftware.smack.util.ParserUtils;
import org.jivesoftware.smack.util.XmlStringBuilder; import org.jivesoftware.smack.util.XmlStringBuilder;
import org.jivesoftware.smackx.iqprivate.packet.PrivateData; import org.jivesoftware.smackx.iqprivate.packet.PrivateData;
import org.jivesoftware.smackx.iqprivate.provider.PrivateDataProvider; 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.jxmpp.jid.parts.Resourcepart;
import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserException;
@ -271,7 +271,7 @@ public class Bookmarks implements PrivateData {
private static BookmarkedConference getConferenceStorage(XmlPullParser parser) throws XmlPullParserException, IOException { private static BookmarkedConference getConferenceStorage(XmlPullParser parser) throws XmlPullParserException, IOException {
String name = parser.getAttributeValue("", "name"); String name = parser.getAttributeValue("", "name");
String autojoin = parser.getAttributeValue("", "autojoin"); String autojoin = parser.getAttributeValue("", "autojoin");
BareJid jid = ParserUtils.getBareJidAttribute(parser); EntityBareJid jid = ParserUtils.getBareJidAttribute(parser);
BookmarkedConference conf = new BookmarkedConference(jid); BookmarkedConference conf = new BookmarkedConference(jid);
conf.setName(name); conf.setName(name);

View file

@ -24,7 +24,7 @@ import org.jivesoftware.smack.iqrequest.IQRequestHandler.Mode;
import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.XMPPError; import org.jivesoftware.smack.packet.XMPPError;
import org.jivesoftware.smackx.si.packet.StreamInitiation; import org.jivesoftware.smackx.si.packet.StreamInitiation;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import java.util.List; import java.util.List;
import java.util.Map; 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. * 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.
* <p> * <p>
* And to recieve a file add a file transfer listener to the manager. The * 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 * 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. * @return The send file object on which the negotiated transfer can be run.
* @exception IllegalArgumentException if userID is null or not a full JID * @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 // 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 // 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. // in order to reach an client entity.

View file

@ -17,7 +17,7 @@
package org.jivesoftware.smackx.muc; package org.jivesoftware.smackx.muc;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.jid.parts.Resourcepart;
@ -32,49 +32,49 @@ import org.jxmpp.jid.parts.Resourcepart;
*/ */
public class DefaultParticipantStatusListener implements ParticipantStatusListener { 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) {
} }
} }

View file

@ -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 * 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 * 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 * 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 * 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)}. * and {@link org.jivesoftware.smackx.muc.MultiUserChat#join(org.jxmpp.jid.parts.Resourcepart)}.
* *
* @author Gaston Dombiak * @author Gaston Dombiak

View file

@ -72,17 +72,17 @@ import org.jivesoftware.smackx.muc.packet.MUCUser.Status;
import org.jivesoftware.smackx.xdata.Form; import org.jivesoftware.smackx.xdata.Form;
import org.jivesoftware.smackx.xdata.FormField; import org.jivesoftware.smackx.xdata.FormField;
import org.jivesoftware.smackx.xdata.packet.DataForm; 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.DomainBareJid;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid; 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.impl.JidCreate;
import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.jid.parts.Resourcepart;
import org.jxmpp.util.cache.ExpirationCache; 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)}.
* <p> * <p>
* A MultiUserChat is a conversation that takes place among many users in a virtual * 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. * room. A room could have many occupants with different affiliation and roles.
@ -105,9 +105,9 @@ public class MultiUserChat {
100, 1000 * 60 * 60 * 24); 100, 1000 * 60 * 60 * 24);
private final XMPPConnection connection; private final XMPPConnection connection;
private final BareJid room; private final EntityBareJid room;
private final MultiUserChatManager multiUserChatManager; private final MultiUserChatManager multiUserChatManager;
private final Map<FullJid, Presence> occupantsMap = new ConcurrentHashMap<>(); private final Map<EntityFullJid, Presence> occupantsMap = new ConcurrentHashMap<>();
private final Set<InvitationRejectionListener> invitationRejectionListeners = new CopyOnWriteArraySet<InvitationRejectionListener>(); private final Set<InvitationRejectionListener> invitationRejectionListeners = new CopyOnWriteArraySet<InvitationRejectionListener>();
private final Set<SubjectUpdatedListener> subjectUpdatedListeners = new CopyOnWriteArraySet<SubjectUpdatedListener>(); private final Set<SubjectUpdatedListener> subjectUpdatedListeners = new CopyOnWriteArraySet<SubjectUpdatedListener>();
@ -140,7 +140,7 @@ public class MultiUserChat {
private boolean joined = false; private boolean joined = false;
private PacketCollector messageCollector; private PacketCollector messageCollector;
MultiUserChat(XMPPConnection connection, BareJid room, MultiUserChatManager multiUserChatManager) { MultiUserChat(XMPPConnection connection, EntityBareJid room, MultiUserChatManager multiUserChatManager) {
this.connection = connection; this.connection = connection;
this.room = room; this.room = room;
this.multiUserChatManager = multiUserChatManager; this.multiUserChatManager = multiUserChatManager;
@ -162,7 +162,7 @@ public class MultiUserChat {
subjectListener = new StanzaListener() { subjectListener = new StanzaListener() {
public void processPacket(Stanza packet) { public void processPacket(Stanza packet) {
Message msg = (Message) packet; Message msg = (Message) packet;
FullJid from = msg.getFrom().asFullJidIfPossible(); EntityFullJid from = msg.getFrom().asEntityFullJidIfPossible();
if (from == null) { if (from == null) {
LOGGER.warning("Message subject not changed by a full JID: " + msg.getFrom()); LOGGER.warning("Message subject not changed by a full JID: " + msg.getFrom());
return; return;
@ -180,7 +180,7 @@ public class MultiUserChat {
presenceListener = new StanzaListener() { presenceListener = new StanzaListener() {
public void processPacket(Stanza packet) { public void processPacket(Stanza packet) {
Presence presence = (Presence) packet; Presence presence = (Presence) packet;
final FullJid from = presence.getFrom().asFullJidIfPossible(); final EntityFullJid from = presence.getFrom().asEntityFullJidIfPossible();
if (from == null) { if (from == null) {
LOGGER.warning("Presence not from a full JID: " + presence.getFrom()); LOGGER.warning("Presence not from a full JID: " + presence.getFrom());
return; return;
@ -277,7 +277,7 @@ public class MultiUserChat {
* *
* @return the multi user chat room name. * @return the multi user chat room name.
*/ */
public BareJid getRoom() { public EntityBareJid getRoom() {
return room; return room;
} }
@ -311,7 +311,7 @@ public class MultiUserChat {
// We enter a room by sending a presence packet where the "to" // We enter a room by sending a presence packet where the "to"
// field is in the form "roomName@service/nickname" // field is in the form "roomName@service/nickname"
Presence joinPresence = new Presence(Presence.Type.available); Presence joinPresence = new Presence(Presence.Type.available);
final FullJid jid = JidCreate.fullFrom(room, nickname); final EntityFullJid jid = JidCreate.fullFrom(room, nickname);
joinPresence.setTo(jid); joinPresence.setTo(jid);
// Indicate the the client supports MUC // 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 // 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 // performed roomnick rewriting
this.nickname = presence.getFrom().asFullJidIfPossible().getResourcepart(); this.nickname = presence.getFrom().asEntityFullJidIfPossible().getResourcepart();
joined = true; joined = true;
// Update the list of joined rooms // Update the list of joined rooms
@ -780,7 +780,7 @@ public class MultiUserChat {
* @throws NotConnectedException * @throws NotConnectedException
* @throws InterruptedException * @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(); MUCOwner iq = new MUCOwner();
iq.setTo(room); iq.setTo(room);
iq.setType(IQ.Type.set); iq.setType(IQ.Type.set);
@ -1002,7 +1002,7 @@ public class MultiUserChat {
if (!joined) { if (!joined) {
throw new MucNotJoinedException(this); 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" // We change the nickname by sending a presence packet where the "to"
// field is in the form "roomName@service/nickname" // field is in the form "roomName@service/nickname"
// We don't have to signal the MUC support again // We don't have to signal the MUC support again
@ -1455,7 +1455,7 @@ public class MultiUserChat {
* @throws NotConnectedException * @throws NotConnectedException
* @throws InterruptedException * @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); changeAffiliationByAdmin(jid, MUCAffiliation.member);
} }
@ -1561,7 +1561,7 @@ public class MultiUserChat {
* *
* @return a List of the occupants in the group chat. * @return a List of the occupants in the group chat.
*/ */
public List<FullJid> getOccupants() { public List<EntityFullJid> getOccupants() {
return new ArrayList<>(occupantsMap.keySet()); return new ArrayList<>(occupantsMap.keySet());
} }
@ -1779,7 +1779,7 @@ public class MultiUserChat {
* created chat. * created chat.
* @return new Chat for sending private messages to a given room occupant. * @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); return ChatManager.getInstanceFor(connection).createChat(occupant, listener);
} }
@ -2020,7 +2020,7 @@ public class MultiUserChat {
MUCRole oldRole, MUCRole oldRole,
MUCRole newRole, MUCRole newRole,
boolean isUserModification, boolean isUserModification,
FullJid from) { EntityFullJid from) {
// Voice was granted to a visitor // Voice was granted to a visitor
if (("visitor".equals(oldRole) || "none".equals(oldRole)) if (("visitor".equals(oldRole) || "none".equals(oldRole))
&& "participant".equals(newRole)) { && "participant".equals(newRole)) {
@ -2146,7 +2146,7 @@ public class MultiUserChat {
MUCAffiliation oldAffiliation, MUCAffiliation oldAffiliation,
MUCAffiliation newAffiliation, MUCAffiliation newAffiliation,
boolean isUserModification, boolean isUserModification,
FullJid from) { EntityFullJid from) {
// First check for revoked affiliation and then for granted affiliations. The idea is to // 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. // first fire the "revoke" events and then fire the "grant" events.
@ -2243,7 +2243,7 @@ public class MultiUserChat {
Set<Status> statusCodes, Set<Status> statusCodes,
boolean isUserModification, boolean isUserModification,
MUCUser mucUser, MUCUser mucUser,
FullJid from) { EntityFullJid from) {
// Check if an occupant was kicked from the room // Check if an occupant was kicked from the room
if (statusCodes.contains(Status.KICKED_307)) { if (statusCodes.contains(Status.KICKED_307)) {
// Check if this occupant was kicked // Check if this occupant was kicked

View file

@ -50,10 +50,10 @@ import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
import org.jivesoftware.smackx.disco.packet.DiscoverItems; import org.jivesoftware.smackx.disco.packet.DiscoverItems;
import org.jivesoftware.smackx.muc.packet.MUCInitialPresence; import org.jivesoftware.smackx.muc.packet.MUCInitialPresence;
import org.jivesoftware.smackx.muc.packet.MUCUser; 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.DomainBareJid;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
import org.jxmpp.jid.JidWithLocalpart; import org.jxmpp.jid.EntityJid;
public final class MultiUserChatManager extends Manager { public final class MultiUserChatManager extends Manager {
private final static String DISCO_NODE = MUCInitialPresence.NAMESPACE + "#rooms"; private final static String DISCO_NODE = MUCInitialPresence.NAMESPACE + "#rooms";
@ -78,9 +78,9 @@ public final class MultiUserChatManager extends Manager {
XMPPConnection connection = weakRefConnection.get(); XMPPConnection connection = weakRefConnection.get();
if (connection == null) if (connection == null)
return Collections.emptyList(); return Collections.emptyList();
Set<BareJid> joinedRooms = MultiUserChatManager.getInstanceFor(connection).getJoinedRooms(); Set<EntityBareJid> joinedRooms = MultiUserChatManager.getInstanceFor(connection).getJoinedRooms();
List<DiscoverItems.Item> answer = new ArrayList<DiscoverItems.Item>(); List<DiscoverItems.Item> answer = new ArrayList<DiscoverItems.Item>();
for (BareJid room : joinedRooms) { for (EntityBareJid room : joinedRooms) {
answer.add(new DiscoverItems.Item(room)); answer.add(new DiscoverItems.Item(room));
} }
return answer; return answer;
@ -111,14 +111,14 @@ public final class MultiUserChatManager extends Manager {
new NotFilter(MessageTypeFilter.ERROR)); new NotFilter(MessageTypeFilter.ERROR));
private final Set<InvitationListener> invitationsListeners = new CopyOnWriteArraySet<InvitationListener>(); private final Set<InvitationListener> invitationsListeners = new CopyOnWriteArraySet<InvitationListener>();
private final Set<BareJid> joinedRooms = new HashSet<>(); private final Set<EntityBareJid> joinedRooms = new HashSet<>();
/** /**
* A Map of MUC JIDs to {@link MultiUserChat} instances. We use weak references for the values in order to allow * 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 * 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. * the user is joined, because then the MUC will have PacketListeners added to the XMPPConnection.
*/ */
private final Map<BareJid, WeakReference<MultiUserChat>> multiUserChats = new HashMap<>(); private final Map<EntityBareJid, WeakReference<MultiUserChat>> multiUserChats = new HashMap<>();
private MultiUserChatManager(XMPPConnection connection) { private MultiUserChatManager(XMPPConnection connection) {
super(connection); super(connection);
@ -131,7 +131,7 @@ public final class MultiUserChatManager extends Manager {
final MUCUser mucUser = MUCUser.from(message); final MUCUser mucUser = MUCUser.from(message);
// Check if the MUCUser extension includes an invitation // Check if the MUCUser extension includes an invitation
if (mucUser.getInvite() != null) { if (mucUser.getInvite() != null) {
BareJid mucJid = message.getFrom().asBareJidIfPossible(); EntityBareJid mucJid = message.getFrom().asEntityBareJidIfPossible();
if (mucJid == null) { if (mucJid == null) {
LOGGER.warning("Invite to non bare JID: '" + message.toXML() + "'"); LOGGER.warning("Invite to non bare JID: '" + message.toXML() + "'");
return; 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 * @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. * 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<MultiUserChat> weakRefMultiUserChat = multiUserChats.get(jid); WeakReference<MultiUserChat> weakRefMultiUserChat = multiUserChats.get(jid);
if (weakRefMultiUserChat == null) { if (weakRefMultiUserChat == null) {
return createNewMucAndAddToMap(jid); return createNewMucAndAddToMap(jid);
@ -172,7 +172,7 @@ public final class MultiUserChatManager extends Manager {
return multiUserChat; return multiUserChat;
} }
private MultiUserChat createNewMucAndAddToMap(BareJid jid) { private MultiUserChat createNewMucAndAddToMap(EntityBareJid jid) {
MultiUserChat multiUserChat = new MultiUserChat(connection(), jid, this); MultiUserChat multiUserChat = new MultiUserChat(connection(), jid, this);
multiUserChats.put(jid, new WeakReference<MultiUserChat>(multiUserChat)); multiUserChats.put(jid, new WeakReference<MultiUserChat>(multiUserChat));
return 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. * @return a List of the rooms where the user has joined using a given connection.
*/ */
public Set<BareJid> getJoinedRooms() { public Set<EntityBareJid> getJoinedRooms() {
return Collections.unmodifiableSet(joinedRooms); return Collections.unmodifiableSet(joinedRooms);
} }
@ -213,15 +213,15 @@ public final class MultiUserChatManager extends Manager {
* @throws NotConnectedException * @throws NotConnectedException
* @throws InterruptedException * @throws InterruptedException
*/ */
public List<BareJid> getJoinedRooms(JidWithLocalpart user) throws NoResponseException, XMPPErrorException, public List<EntityBareJid> getJoinedRooms(EntityJid user) throws NoResponseException, XMPPErrorException,
NotConnectedException, InterruptedException { NotConnectedException, InterruptedException {
// Send the disco packet to the user // Send the disco packet to the user
DiscoverItems result = ServiceDiscoveryManager.getInstanceFor(connection()).discoverItems(user, DISCO_NODE); DiscoverItems result = ServiceDiscoveryManager.getInstanceFor(connection()).discoverItems(user, DISCO_NODE);
List<DiscoverItems.Item> items = result.getItems(); List<DiscoverItems.Item> items = result.getItems();
List<BareJid> answer = new ArrayList<>(items.size()); List<EntityBareJid> answer = new ArrayList<>(items.size());
// Collect the entityID for each returned item // Collect the entityID for each returned item
for (DiscoverItems.Item item : items) { for (DiscoverItems.Item item : items) {
BareJid muc = item.getEntityID().asBareJidIfPossible(); EntityBareJid muc = item.getEntityID().asEntityBareJidIfPossible();
if (muc == null) { if (muc == null) {
LOGGER.warning("Not a bare JID: " + item.getEntityID()); LOGGER.warning("Not a bare JID: " + item.getEntityID());
continue; continue;
@ -242,7 +242,7 @@ public final class MultiUserChatManager extends Manager {
* @throws NotConnectedException * @throws NotConnectedException
* @throws InterruptedException * @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); DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection()).discoverInfo(room);
return new RoomInfo(info); return new RoomInfo(info);
} }
@ -313,7 +313,7 @@ public final class MultiUserChatManager extends Manager {
* @throws NotConnectedException * @throws NotConnectedException
* @throws InterruptedException * @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); Message message = new Message(room);
// Create the MUCUser packet that will include the rejection // Create the MUCUser packet that will include the rejection
@ -346,11 +346,11 @@ public final class MultiUserChatManager extends Manager {
invitationsListeners.remove(listener); invitationsListeners.remove(listener);
} }
void addJoinedRoom(BareJid room) { void addJoinedRoom(EntityBareJid room) {
joinedRooms.add(room); joinedRooms.add(room);
} }
void removeJoinedRoom(BareJid room) { void removeJoinedRoom(EntityBareJid room) {
joinedRooms.remove(room); joinedRooms.remove(room);
} }
} }

View file

@ -22,7 +22,7 @@ import java.util.logging.Logger;
import org.jivesoftware.smackx.muc.packet.MUCItem; import org.jivesoftware.smackx.muc.packet.MUCItem;
import org.jivesoftware.smackx.muc.packet.MUCUser; import org.jivesoftware.smackx.muc.packet.MUCUser;
import org.jivesoftware.smack.packet.Presence; 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.Jid;
import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.jid.parts.Resourcepart;
@ -58,7 +58,7 @@ public class Occupant {
this.affiliation = item.getAffiliation(); this.affiliation = item.getAffiliation();
this.role = item.getRole(); this.role = item.getRole();
// Get the nickname from the FROM attribute of the presence // Get the nickname from the FROM attribute of the presence
FullJid from = presence.getFrom().asFullJidIfPossible(); EntityFullJid from = presence.getFrom().asEntityFullJidIfPossible();
if (from == null) { if (from == null) {
LOGGER.warning("Occupant presence without resource: " + presence.getFrom()); LOGGER.warning("Occupant presence without resource: " + presence.getFrom());
this.nick = null; this.nick = null;

View file

@ -17,7 +17,7 @@
package org.jivesoftware.smackx.muc; package org.jivesoftware.smackx.muc;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.jid.parts.Resourcepart;
@ -37,7 +37,7 @@ public interface ParticipantStatusListener {
* @param participant the participant that has just joined the room * @param participant the participant that has just joined the room
* (e.g. room@conference.jabber.org/nick). * (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 * 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. * @param participant the participant that has left the room on its own.
* (e.g. room@conference.jabber.org/nick). * (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 * 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 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. * @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 * 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 * @param participant the participant that was granted voice in the room
* (e.g. room@conference.jabber.org/nick). * (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 * 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 * @param participant the participant that was revoked voice from the room
* (e.g. room@conference.jabber.org/nick). * (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 * 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 actor the administrator that banned the occupant (e.g. user@host.org).
* @param reason the reason provided by the administrator to ban the occupant. * @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 * 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 * @param participant the participant that was granted membership in the room
* (e.g. room@conference.jabber.org/nick). * (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 * 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 * @param participant the participant that was revoked membership from the room
* (e.g. room@conference.jabber.org/nick). * (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 * 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 * @param participant the participant that was granted moderator privileges in the room
* (e.g. room@conference.jabber.org/nick). * (e.g. room@conference.jabber.org/nick).
*/ */
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 * 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 * @param participant the participant that was revoked moderator privileges in the room
* (e.g. room@conference.jabber.org/nick). * (e.g. room@conference.jabber.org/nick).
*/ */
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 * 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 * @param participant the participant that was granted ownership on the room
* (e.g. room@conference.jabber.org/nick). * (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 * 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 * @param participant the participant that was revoked ownership on the room
* (e.g. room@conference.jabber.org/nick). * (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 * 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 * @param participant the participant that was granted administrator privileges
* (e.g. room@conference.jabber.org/nick). * (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 * 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 * @param participant the participant that was revoked administrator privileges
* (e.g. room@conference.jabber.org/nick). * (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 * 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). * (e.g. room@conference.jabber.org/nick).
* @param newNickname the new nickname that the participant decided to use. * @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);
} }

View file

@ -26,7 +26,7 @@ import java.util.logging.Logger;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo; import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
import org.jivesoftware.smackx.xdata.Form; import org.jivesoftware.smackx.xdata.Form;
import org.jivesoftware.smackx.xdata.FormField; import org.jivesoftware.smackx.xdata.FormField;
import org.jxmpp.jid.BareJid; import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.Jid; 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. * 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. * Description of the room.
*/ */
@ -132,7 +132,7 @@ public class RoomInfo {
RoomInfo(DiscoverInfo info) { RoomInfo(DiscoverInfo info) {
final Jid from = info.getFrom(); final Jid from = info.getFrom();
if (from != null) { if (from != null) {
this.room = info.getFrom().asBareJidIfPossible(); this.room = info.getFrom().asEntityBareJidIfPossible();
} else { } else {
this.room = null; this.room = null;
} }
@ -240,7 +240,7 @@ public class RoomInfo {
* *
* @return the JID of the room whose information was discovered. * @return the JID of the room whose information was discovered.
*/ */
public BareJid getRoom() { public EntityBareJid getRoom() {
return room; return room;
} }

View file

@ -17,7 +17,7 @@
package org.jivesoftware.smackx.muc; 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. * 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 subject the new room's subject.
* @param from the user that changed the room's subject (e.g. room@conference.jabber.org/nick). * @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);
} }

View file

@ -20,7 +20,7 @@ import java.io.Serializable;
import org.jivesoftware.smack.packet.NamedElement; import org.jivesoftware.smack.packet.NamedElement;
import org.jivesoftware.smack.util.XmlStringBuilder; 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 * 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"; public static final String ELEMENT = "destroy";
private final String reason; private final String reason;
private final BareJid jid; private final EntityBareJid jid;
public Destroy(Destroy other) { public Destroy(Destroy other) {
this(other.jid, other.reason); this(other.jid, other.reason);
} }
public Destroy(BareJid alternativeJid, String reason) { public Destroy(EntityBareJid alternativeJid, String reason) {
this.jid = alternativeJid; this.jid = alternativeJid;
this.reason = reason; this.reason = reason;
} }
@ -54,7 +54,7 @@ public class Destroy implements NamedElement, Serializable {
* *
* @return the JID of an alternate location. * @return the JID of an alternate location.
*/ */
public BareJid getJid() { public EntityBareJid getJid() {
return jid; return jid;
} }

View file

@ -23,7 +23,7 @@ import org.jivesoftware.smackx.muc.MUCAffiliation;
import org.jivesoftware.smackx.muc.MUCRole; import org.jivesoftware.smackx.muc.MUCRole;
import org.jivesoftware.smackx.muc.packet.Destroy; import org.jivesoftware.smackx.muc.packet.Destroy;
import org.jivesoftware.smackx.muc.packet.MUCItem; 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.Jid;
import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.jid.parts.Resourcepart;
import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParser;
@ -64,7 +64,7 @@ public class MUCParserUtils {
public static Destroy parseDestroy(XmlPullParser parser) throws XmlPullParserException, IOException { public static Destroy parseDestroy(XmlPullParser parser) throws XmlPullParserException, IOException {
final int initialDepth = parser.getDepth(); final int initialDepth = parser.getDepth();
final BareJid jid = ParserUtils.getBareJidAttribute(parser); final EntityBareJid jid = ParserUtils.getBareJidAttribute(parser);
String reason = null; String reason = null;
outerloop: while (true) { outerloop: while (true) {
int eventType = parser.next(); int eventType = parser.next();

View file

@ -30,7 +30,7 @@ import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.id.StanzaIdUtil; import org.jivesoftware.smack.packet.id.StanzaIdUtil;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jivesoftware.smackx.vcardtemp.packet.VCard; import org.jivesoftware.smackx.vcardtemp.packet.VCard;
import org.jxmpp.jid.BareJid; import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
public final class VCardManager extends Manager { public final class VCardManager extends Manager {
@ -125,7 +125,7 @@ public final class VCardManager extends Manager {
* @throws NotConnectedException * @throws NotConnectedException
* @throws InterruptedException * @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(); VCard vcardRequest = new VCard();
vcardRequest.setTo(bareJid); vcardRequest.setTo(bareJid);
VCard result = connection().createPacketCollectorAndSend(vcardRequest).nextResultOrThrow(); VCard result = connection().createPacketCollectorAndSend(vcardRequest).nextResultOrThrow();

View file

@ -40,7 +40,7 @@ import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.stringencoder.Base64; import org.jivesoftware.smack.util.stringencoder.Base64;
import org.jivesoftware.smackx.vcardtemp.VCardManager; import org.jivesoftware.smackx.vcardtemp.VCardManager;
import org.jxmpp.jid.BareJid; import org.jxmpp.jid.EntityBareJid;
/** /**
* A VCard class for use with the * 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 NoResponseException if there was no response from the server.
* @throws NotConnectedException * @throws NotConnectedException
* @throws InterruptedException * @throws InterruptedException
* @deprecated use {@link VCardManager#loadVCard(BareJid)} instead. * @deprecated use {@link VCardManager#loadVCard(EntityBareJid)} instead.
*/ */
@Deprecated @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); VCard result = VCardManager.getInstanceFor(connection).loadVCard(user);
copyFieldsFrom(result); copyFieldsFrom(result);
} }

View file

@ -37,7 +37,7 @@ import org.jivesoftware.util.Verification;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
/** /**
@ -48,8 +48,8 @@ import org.jxmpp.jid.JidTestUtil;
public class InBandBytestreamManagerTest extends InitExtensions { public class InBandBytestreamManagerTest extends InitExtensions {
// settings // settings
static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE;
static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1;
static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1;
String sessionID = "session_id"; String sessionID = "session_id";

View file

@ -42,7 +42,7 @@ import org.jivesoftware.util.Verification;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.powermock.reflect.Whitebox; import org.powermock.reflect.Whitebox;
@ -56,8 +56,8 @@ import org.powermock.reflect.Whitebox;
public class InBandBytestreamSessionMessageTest extends InitExtensions { public class InBandBytestreamSessionMessageTest extends InitExtensions {
// settings // settings
static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE;
static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1;
static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1;
String sessionID = "session_id"; String sessionID = "session_id";

View file

@ -42,7 +42,7 @@ import org.jivesoftware.util.Verification;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.powermock.reflect.Whitebox; import org.powermock.reflect.Whitebox;
@ -57,8 +57,8 @@ import org.powermock.reflect.Whitebox;
public class InBandBytestreamSessionTest extends InitExtensions { public class InBandBytestreamSessionTest extends InitExtensions {
// settings // settings
static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE;
static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1;
static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1;
String sessionID = "session_id"; String sessionID = "session_id";

View file

@ -29,7 +29,7 @@ import org.jivesoftware.smackx.bytestreams.BytestreamRequest;
import org.jivesoftware.smackx.bytestreams.ibb.packet.Open; import org.jivesoftware.smackx.bytestreams.ibb.packet.Open;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
@ -42,8 +42,8 @@ import org.powermock.reflect.Whitebox;
*/ */
public class InitiationListenerTest extends InitExtensions { public class InitiationListenerTest extends InitExtensions {
static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE;
static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1;
String sessionID = "session_id"; String sessionID = "session_id";
XMPPConnection connection; XMPPConnection connection;

View file

@ -30,7 +30,7 @@ import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
@ -43,8 +43,8 @@ import org.powermock.reflect.Whitebox;
*/ */
public class InitiationListenerTest { public class InitiationListenerTest {
static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE;
static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1;
static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1;
static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG; static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG;
String proxyAddress = "127.0.0.1"; String proxyAddress = "127.0.0.1";

View file

@ -51,7 +51,7 @@ import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.stringprep.XmppStringprepException; import org.jxmpp.stringprep.XmppStringprepException;
@ -64,8 +64,8 @@ import org.jxmpp.stringprep.XmppStringprepException;
public class Socks5ByteStreamManagerTest { public class Socks5ByteStreamManagerTest {
// settings // settings
static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE;
static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1;
static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1;
static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG; static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG;
String proxyAddress = "127.0.0.1"; String proxyAddress = "127.0.0.1";

View file

@ -41,7 +41,7 @@ import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
@ -53,8 +53,8 @@ import org.jxmpp.jid.impl.JidCreate;
public class Socks5ByteStreamRequestTest { public class Socks5ByteStreamRequestTest {
// settings // settings
static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE;
static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1;
static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1;
static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG; static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG;
String proxyAddress = "127.0.0.1"; String proxyAddress = "127.0.0.1";

View file

@ -43,7 +43,7 @@ import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.JidTestUtil; import org.jxmpp.jid.JidTestUtil;
/** /**
@ -54,8 +54,8 @@ import org.jxmpp.jid.JidTestUtil;
public class Socks5ClientForInitiatorTest { public class Socks5ClientForInitiatorTest {
// settings // settings
static final FullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; static final EntityFullJid initiatorJID = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE;
static final FullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1; static final EntityFullJid targetJID = JidTestUtil.FULL_JID_1_RESOURCE_1;
static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1; static final DomainBareJid xmppServer = JidTestUtil.DOMAIN_BARE_JID_1;
static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG; static final DomainBareJid proxyJID = JidTestUtil.MUC_EXAMPLE_ORG;
String proxyAddress = "127.0.0.1"; String proxyAddress = "127.0.0.1";

View file

@ -33,7 +33,7 @@ import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.packet.XMPPError; import org.jivesoftware.smack.packet.XMPPError;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.mockito.invocation.InvocationOnMock; import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer; import org.mockito.stubbing.Answer;
@ -69,7 +69,7 @@ public class ConnectionUtils {
* @throws InterruptedException * @throws InterruptedException
*/ */
public static XMPPConnection createMockedConnection(final Protocol protocol, 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 // mock XMPP connection
XMPPConnection connection = mock(XMPPConnection.class); XMPPConnection connection = mock(XMPPConnection.class);

View file

@ -36,7 +36,7 @@ import org.jivesoftware.smack.packet.Stanza;
/** /**
* This class can be used in conjunction with a mocked XMPP connection ( * 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: * verify an XMPP protocol. This can be accomplished in the following was:
* <ul> * <ul>
* <li>add responses to packets sent over the mocked XMPP connection by the * <li>add responses to packets sent over the mocked XMPP connection by the

View file

@ -21,7 +21,7 @@ import org.jivesoftware.smack.PacketCollector;
import org.jivesoftware.smack.SmackException.NotConnectedException; import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.StringUtils;
import org.jxmpp.jid.JidWithLocalpart; import org.jxmpp.jid.EntityJid;
import java.util.Set; import java.util.Set;
import java.util.Collections; import java.util.Collections;
@ -41,7 +41,7 @@ public class Chat {
private ChatManager chatManager; private ChatManager chatManager;
private String threadID; private String threadID;
private JidWithLocalpart participant; private EntityJid participant;
private final Set<ChatMessageListener> listeners = new CopyOnWriteArraySet<ChatMessageListener>(); private final Set<ChatMessageListener> listeners = new CopyOnWriteArraySet<ChatMessageListener>();
/** /**
@ -51,7 +51,7 @@ public class Chat {
* @param participant the user to chat with. * @param participant the user to chat with.
* @param threadID the thread ID to use. * @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)) { if (StringUtils.isEmpty(threadID)) {
throw new IllegalArgumentException("Thread ID must not be null"); 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. * @return the name of the user the chat is occuring with.
*/ */
public JidWithLocalpart getParticipant() { public EntityJid getParticipant() {
return participant; return participant;
} }

View file

@ -42,9 +42,9 @@ import org.jivesoftware.smack.filter.ThreadFilter;
import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Message.Type; import org.jivesoftware.smack.packet.Message.Type;
import org.jivesoftware.smack.packet.Stanza; 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.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 * 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 * Maps base jids to chats
*/ */
private Map<BareJid, Chat> baseJidChats = new ConcurrentHashMap<>(); private Map<EntityBareJid, Chat> baseJidChats = new ConcurrentHashMap<>();
private Set<ChatManagerListener> chatManagerListeners private Set<ChatManagerListener> chatManagerListeners
= new CopyOnWriteArraySet<ChatManagerListener>(); = new CopyOnWriteArraySet<ChatManagerListener>();
@ -217,7 +217,7 @@ public final class ChatManager extends Manager{
* @param userJID the user this chat is with. * @param userJID the user this chat is with.
* @return the created chat. * @return the created chat.
*/ */
public Chat createChat(JidWithLocalpart userJID) { public Chat createChat(EntityJid userJID) {
return createChat(userJID, null); 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. * @param listener the optional listener which will listen for new messages from this chat.
* @return the created chat. * @return the created chat.
*/ */
public Chat createChat(JidWithLocalpart userJID, ChatMessageListener listener) { public Chat createChat(EntityJid userJID, ChatMessageListener listener) {
return createChat(userJID, null, 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 * @param listener the optional listener to add to the chat
* @return the created 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) { if (thread == null) {
thread = nextID(); thread = nextID();
} }
@ -253,7 +253,7 @@ public final class ChatManager extends Manager{
return chat; 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); Chat chat = new Chat(this, userJID, threadID);
threadChats.put(threadID, chat); threadChats.put(threadID, chat);
jidChats.put(userJID, chat); jidChats.put(userJID, chat);
@ -268,7 +268,7 @@ public final class ChatManager extends Manager{
void closeChat(Chat chat) { void closeChat(Chat chat) {
threadChats.remove(chat.getThreadID()); threadChats.remove(chat.getThreadID());
JidWithLocalpart userJID = chat.getParticipant(); EntityJid userJID = chat.getParticipant();
jidChats.remove(userJID); jidChats.remove(userJID);
baseJidChats.remove(userJID.withoutResource()); baseJidChats.remove(userJID.withoutResource());
} }
@ -288,7 +288,7 @@ public final class ChatManager extends Manager{
return null; return null;
} }
JidWithLocalpart userJID = from.asJidWithLocalpartIfPossible(); EntityJid userJID = from.asEntityJidIfPossible();
if (userJID == null) { if (userJID == null) {
LOGGER.warning("Message from JID without localpart: '" +message.toXML() + "'"); LOGGER.warning("Message from JID without localpart: '" +message.toXML() + "'");
return null; return null;
@ -322,7 +322,7 @@ public final class ChatManager extends Manager{
Chat match = jidChats.get(userJID); Chat match = jidChats.get(userJID);
if (match == null && (matchMode == MatchMode.BARE_JID)) { if (match == null && (matchMode == MatchMode.BARE_JID)) {
match = baseJidChats.get(userJID.asBareJidIfPossible()); match = baseJidChats.get(userJID.asEntityBareJidIfPossible());
} }
return match; return match;
} }

View file

@ -63,9 +63,9 @@ import org.jivesoftware.smack.roster.packet.RosterPacket.Item;
import org.jivesoftware.smack.roster.packet.SubscriptionPreApproval; import org.jivesoftware.smack.roster.packet.SubscriptionPreApproval;
import org.jivesoftware.smack.roster.rosterstore.RosterStore; import org.jivesoftware.smack.roster.rosterstore.RosterStore;
import org.jivesoftware.smack.util.Objects; 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.Jid;
import org.jxmpp.jid.JidWithResource; import org.jxmpp.jid.FullJid;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.jid.parts.Resourcepart; 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 * @return the user's current presence, or unavailable presence if the user is offline
* or if no presence information is available. * or if no presence information is available.
*/ */
public Presence getPresenceResource(JidWithResource userWithResource) { public Presence getPresenceResource(FullJid userWithResource) {
Jid key = getMapKey(userWithResource); Jid key = getMapKey(userWithResource);
Resourcepart resource = userWithResource.getResourcepart(); Resourcepart resource = userWithResource.getResourcepart();
Map<Resourcepart, Presence> userPresences = presenceMap.get(key); Map<Resourcepart, Presence> userPresences = presenceMap.get(key);
@ -1038,7 +1038,7 @@ public final class Roster extends Manager {
if (entries.containsKey(user)) { if (entries.containsKey(user)) {
return user; return user;
} }
BareJid bareJid = user.asBareJidIfPossible(); EntityBareJid bareJid = user.asEntityBareJidIfPossible();
if (bareJid != null) { if (bareJid != null) {
return bareJid; return bareJid;
} }
@ -1059,7 +1059,7 @@ public final class Roster extends Manager {
if (resources != null) { if (resources != null) {
for (Resourcepart resource : resources.keySet()) { for (Resourcepart resource : resources.keySet()) {
packetUnavailable = new Presence(Presence.Type.unavailable); packetUnavailable = new Presence(Presence.Type.unavailable);
BareJid bareUserJid = user.asBareJidIfPossible(); EntityBareJid bareUserJid = user.asEntityBareJidIfPossible();
if (bareUserJid == null) { if (bareUserJid == null) {
LOGGER.warning("Can not transform user JID to bare JID: '" + user + "'"); LOGGER.warning("Can not transform user JID to bare JID: '" + user + "'");
continue; continue;
@ -1346,7 +1346,7 @@ public final class Roster extends Manager {
// No need to act on error presences send without from, i.e. // No need to act on error presences send without from, i.e.
// directly send from the users XMPP service, or where the from // directly send from the users XMPP service, or where the from
// address is not a bare JID // address is not a bare JID
if (from == null || !from.isBareJid()) { if (from == null || !from.isEntityBareJid()) {
break; break;
} }
userPresences = getUserPresences(key); userPresences = getUserPresences(key);
@ -1470,7 +1470,7 @@ public final class Roster extends Manager {
// Roster push (RFC 6121, 2.1.6) // Roster push (RFC 6121, 2.1.6)
// A roster push with a non-empty from not matching our address MUST be ignored // 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(); Jid from = rosterPacket.getFrom();
if (from != null && !from.equals(jid)) { if (from != null && !from.equals(jid)) {
LOGGER.warning("Ignoring roster push with a non matching 'from' ourJid='" + jid + "' from='" + from LOGGER.warning("Ignoring roster push with a non matching 'from' ourJid='" + jid + "' from='" + from

View file

@ -82,7 +82,7 @@ public class ChatConnectionTest {
} }
@Test @Test
public void validateDefaultSetMatchModeBareJid() { public void validateDefaultSetMatchModeEntityBareJid() {
ChatManager.setDefaultMatchMode(MatchMode.BARE_JID); ChatManager.setDefaultMatchMode(MatchMode.BARE_JID);
assertEquals(MatchMode.BARE_JID, ChatManager.getInstanceFor(new DummyConnection()).getMatchMode()); assertEquals(MatchMode.BARE_JID, ChatManager.getInstanceFor(new DummyConnection()).getMatchMode());
} }
@ -220,7 +220,7 @@ public class ChatConnectionTest {
* id and the user is a full jid. * id and the user is a full jid.
*/ */
@Test @Test
public void chatFoundWhenNoThreadFullJid() { public void chatFoundWhenNoThreadEntityFullJid() {
Chat outgoing = cm.createChat(JidTestUtil.DUMMY_AT_EXAMPLE_ORG, null); Chat outgoing = cm.createChat(JidTestUtil.DUMMY_AT_EXAMPLE_ORG, null);
Stanza incomingChat = createChatPacket(null, true); Stanza incomingChat = createChatPacket(null, true);
@ -252,7 +252,7 @@ public class ChatConnectionTest {
* and the user is a full jid. * and the user is a full jid.
*/ */
@Test @Test
public void chatFoundWithSameThreadFullJid() { public void chatFoundWithSameThreadEntityFullJid() {
Chat outgoing = cm.createChat(JidTestUtil.DUMMY_AT_EXAMPLE_ORG, null); Chat outgoing = cm.createChat(JidTestUtil.DUMMY_AT_EXAMPLE_ORG, null);
Stanza incomingChat = createChatPacket(outgoing.getThreadID(), true); Stanza incomingChat = createChatPacket(outgoing.getThreadID(), true);
@ -300,7 +300,7 @@ public class ChatConnectionTest {
* different id and the same base jid. * different id and the same base jid.
*/ */
@Test @Test
public void chatNotFoundWithDiffThreadFullJid() { public void chatNotFoundWithDiffThreadEntityFullJid() {
Chat outgoing = cm.createChat(JidTestUtil.DUMMY_AT_EXAMPLE_ORG, null); Chat outgoing = cm.createChat(JidTestUtil.DUMMY_AT_EXAMPLE_ORG, null);
Stanza incomingChat = createChatPacket(outgoing.getThreadID() + "ff", true); Stanza incomingChat = createChatPacket(outgoing.getThreadID() + "ff", true);
@ -322,11 +322,11 @@ public class ChatConnectionTest {
assertNull(listener.getNewChat()); 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); Message chatMsg = new Message(JidTestUtil.BARE_JID_1, Message.Type.chat);
chatMsg.setBody("the body message - " + System.currentTimeMillis()); chatMsg.setBody("the body message - " + System.currentTimeMillis());
Jid jid; Jid jid;
if (isFullJid) { if (isEntityFullJid) {
jid = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE; jid = JidTestUtil.DUMMY_AT_EXAMPLE_ORG_SLASH_DUMMYRESOURCE;
} else { } else {
jid = JidTestUtil.DUMMY_AT_EXAMPLE_ORG; jid = JidTestUtil.DUMMY_AT_EXAMPLE_ORG;

View file

@ -31,7 +31,7 @@ import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.muc.MultiUserChat.MucCreateConfigFormHandle; 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.DomainBareJid;
import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.jid.parts.Localpart; import org.jxmpp.jid.parts.Localpart;
@ -63,7 +63,7 @@ public class MultiUserChatIntegrationTest extends AbstractSmackIntegrationTest {
@SmackIntegrationTest @SmackIntegrationTest
public void mucTest() throws TimeoutException, Exception { 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 mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress); MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);

View file

@ -47,7 +47,7 @@ import org.jivesoftware.smackx.jingleold.nat.TransportCandidate;
import org.jivesoftware.smackx.jingleold.nat.TransportResolver; import org.jivesoftware.smackx.jingleold.nat.TransportResolver;
import org.jivesoftware.smackx.jingleold.packet.Jingle; import org.jivesoftware.smackx.jingleold.packet.Jingle;
import org.jivesoftware.smackx.jingleold.provider.JingleProvider; import org.jivesoftware.smackx.jingleold.provider.JingleProvider;
import org.jxmpp.jid.FullJid; import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
/** /**
@ -520,7 +520,7 @@ public class JingleManager implements JingleSessionListener {
* user. * user.
* @return The session on which the negotiation can be run. * @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); JingleSession session = new JingleSession(connection, (JingleSessionRequest) null, connection.getUser(), responder, jingleMediaManagers);
triggerSessionCreated(session); triggerSessionCreated(session);

View file

@ -26,7 +26,7 @@ import org.jivesoftware.smack.filter.StanzaFilter;
import org.jivesoftware.smack.filter.StanzaTypeFilter; import org.jivesoftware.smack.filter.StanzaTypeFilter;
import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.packet.Presence; 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.Jid;
import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.jid.parts.Resourcepart;
import org.jxmpp.util.XmppStringUtils; import org.jxmpp.util.XmppStringUtils;
@ -252,7 +252,7 @@ public class AgentRoster {
private Jid getPresenceMapKey(Jid user) { private Jid getPresenceMapKey(Jid user) {
Jid key = user; Jid key = user;
if (!contains(user)) { if (!contains(user)) {
key = user.asBareJidIfPossible(); key = user.asEntityBareJidIfPossible();
} }
return key; return key;
} }
@ -287,7 +287,7 @@ public class AgentRoster {
private class PresencePacketListener implements StanzaListener { private class PresencePacketListener implements StanzaListener {
public void processPacket(Stanza packet) { public void processPacket(Stanza packet) {
Presence presence = (Presence)packet; Presence presence = (Presence)packet;
FullJid from = presence.getFrom().asFullJidIfPossible(); EntityFullJid from = presence.getFrom().asEntityFullJidIfPossible();
if (from == null) { if (from == null) {
// TODO Check if we need to ignore these presences or this is a server bug? // 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()); LOGGER.warning("Presence with non full JID from: " + presence.toXML());
@ -326,7 +326,7 @@ public class AgentRoster {
synchronized (entries) { synchronized (entries) {
for (Iterator<String> i = entries.iterator(); i.hasNext();) { for (Iterator<String> i = entries.iterator(); i.hasNext();) {
String entry = i.next(); String entry = i.next();
if (entry.equals(key.asBareJidIfPossible())) { if (entry.equals(key.asEntityBareJidIfPossible())) {
fireEvent(EVENT_PRESENCE_CHANGED, packet); fireEvent(EVENT_PRESENCE_CHANGED, packet);
} }
} }
@ -347,7 +347,7 @@ public class AgentRoster {
synchronized (entries) { synchronized (entries) {
for (Iterator<String> i = entries.iterator(); i.hasNext();) { for (Iterator<String> i = entries.iterator(); i.hasNext();) {
String entry = i.next(); String entry = i.next();
if (entry.equals(key.asBareJidIfPossible())) { if (entry.equals(key.asEntityBareJidIfPossible())) {
fireEvent(EVENT_PRESENCE_CHANGED, packet); fireEvent(EVENT_PRESENCE_CHANGED, packet);
} }
} }

View file

@ -2,7 +2,7 @@ allprojects {
ext { ext {
shortVersion = '4.2.0-alpha2' shortVersion = '4.2.0-alpha2'
isSnapshot = true isSnapshot = true
jxmppVersion = '0.5.0-alpha3' jxmppVersion = '0.5.0-alpha4'
smackMinAndroidSdk = 8 smackMinAndroidSdk = 8
} }
} }