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

View File

@ -27,7 +27,7 @@ import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.PlainStreamElement;
import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.FullJid;
import org.jxmpp.jid.EntityFullJid;
/**
* The XMPPConnection interface provides an interface for connections to an XMPP server and
@ -115,7 +115,7 @@ public interface XMPPConnection {
*
* @return the full XMPP address of the user logged in.
*/
public FullJid getUser();
public EntityFullJid getUser();
/**
* Returns the stream ID for this connection, which is the value set by the server

View File

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

View File

@ -21,7 +21,7 @@ import java.io.Reader;
import java.io.Writer;
import org.jivesoftware.smack.StanzaListener;
import org.jxmpp.jid.FullJid;
import org.jxmpp.jid.EntityFullJid;
/**
* Interface that allows for implementing classes to debug XML traffic. That is a GUI window that
@ -41,7 +41,7 @@ public interface SmackDebugger {
*
* @param user the user@host/resource that has just logged in
*/
public abstract void userHasLogged(FullJid user);
public abstract void userHasLogged(EntityFullJid user);
/**
* Returns the special Reader that wraps the main Reader and logs data to the GUI.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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
* no specific address was provided.
*/
// TODO should return BareJid
// TODO should return EntityBareJid
public Jid getReplyRoom() {
List<MultipleAddresses.Address> replyRoom = extension.getAddressesOfType(MultipleAddresses.Type.replyroom);
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.smackx.address.packet.MultipleAddresses;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jxmpp.jid.BareJid;
import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.FullJid;
import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid;
import java.util.ArrayList;
@ -178,9 +178,9 @@ public class MultipleRecipientManager {
to.add(original.getFrom());
}
// Remove the sender from the TO/CC list (try with bare JID too)
FullJid from = connection.getUser();
EntityFullJid from = connection.getUser();
if (!to.remove(from) && !cc.remove(from)) {
BareJid bareJID = from.asBareJid();
EntityBareJid bareJID = from.asBareJid();
to.remove(bareJID);
cc.remove(bareJID);
}

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@ import org.jivesoftware.smack.iqrequest.IQRequestHandler.Mode;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.XMPPError;
import org.jivesoftware.smackx.si.packet.StreamInitiation;
import org.jxmpp.jid.FullJid;
import org.jxmpp.jid.EntityFullJid;
import java.util.List;
import java.util.Map;
@ -33,7 +33,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
/**
* The file transfer manager class handles the sending and recieving of files.
* To send a file invoke the {@link #createOutgoingFileTransfer(FullJid)} method.
* To send a file invoke the {@link #createOutgoingFileTransfer(EntityFullJid)} method.
* <p>
* And to recieve a file add a file transfer listener to the manager. The
* listener will notify you when there is a new file transfer request. To create
@ -117,7 +117,7 @@ public final class FileTransferManager extends Manager {
* @return The send file object on which the negotiated transfer can be run.
* @exception IllegalArgumentException if userID is null or not a full JID
*/
public OutgoingFileTransfer createOutgoingFileTransfer(FullJid userID) {
public OutgoingFileTransfer createOutgoingFileTransfer(EntityFullJid userID) {
// We need to create outgoing file transfers with a full JID since this method will later
// use XEP-0095 to negotiate the stream. This is done with IQ stanzas that need to be addressed to a full JID
// in order to reach an client entity.

View File

@ -17,7 +17,7 @@
package org.jivesoftware.smackx.muc;
import org.jxmpp.jid.FullJid;
import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid;
import org.jxmpp.jid.parts.Resourcepart;
@ -32,49 +32,49 @@ import org.jxmpp.jid.parts.Resourcepart;
*/
public class DefaultParticipantStatusListener implements ParticipantStatusListener {
public void joined(FullJid participant) {
public void joined(EntityFullJid participant) {
}
public void left(FullJid participant) {
public void left(EntityFullJid participant) {
}
public void kicked(FullJid participant, Jid actor, String reason) {
public void kicked(EntityFullJid participant, Jid actor, String reason) {
}
public void voiceGranted(FullJid participant) {
public void voiceGranted(EntityFullJid participant) {
}
public void voiceRevoked(FullJid participant) {
public void voiceRevoked(EntityFullJid participant) {
}
public void banned(FullJid participant, Jid actor, String reason) {
public void banned(EntityFullJid participant, Jid actor, String reason) {
}
public void membershipGranted(FullJid participant) {
public void membershipGranted(EntityFullJid participant) {
}
public void membershipRevoked(FullJid participant) {
public void membershipRevoked(EntityFullJid participant) {
}
public void moderatorGranted(FullJid participant) {
public void moderatorGranted(EntityFullJid participant) {
}
public void moderatorRevoked(FullJid participant) {
public void moderatorRevoked(EntityFullJid participant) {
}
public void ownershipGranted(FullJid participant) {
public void ownershipGranted(EntityFullJid participant) {
}
public void ownershipRevoked(FullJid participant) {
public void ownershipRevoked(EntityFullJid participant) {
}
public void adminGranted(FullJid participant) {
public void adminGranted(EntityFullJid participant) {
}
public void adminRevoked(FullJid participant) {
public void adminRevoked(EntityFullJid participant) {
}
public void nicknameChanged(FullJid participant, Resourcepart newNickname) {
public void nicknameChanged(EntityFullJid participant, Resourcepart newNickname) {
}
}

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
* directory . The information that may be discovered is the XMPP address of the room and the room
* name. The address of the room may be used for obtaining more detailed information
* {@link org.jivesoftware.smackx.muc.MultiUserChatManager#getRoomInfo(org.jxmpp.jid.BareJid)}
* {@link org.jivesoftware.smackx.muc.MultiUserChatManager#getRoomInfo(org.jxmpp.jid.EntityBareJid)}
* or could be used for joining the room
* {@link org.jivesoftware.smackx.muc.MultiUserChatManager#getMultiUserChat(org.jxmpp.jid.BareJid)}
* {@link org.jivesoftware.smackx.muc.MultiUserChatManager#getMultiUserChat(org.jxmpp.jid.EntityBareJid)}
* and {@link org.jivesoftware.smackx.muc.MultiUserChat#join(org.jxmpp.jid.parts.Resourcepart)}.
*
* @author Gaston Dombiak

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

View File

@ -50,10 +50,10 @@ import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
import org.jivesoftware.smackx.muc.packet.MUCInitialPresence;
import org.jivesoftware.smackx.muc.packet.MUCUser;
import org.jxmpp.jid.BareJid;
import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.Jid;
import org.jxmpp.jid.JidWithLocalpart;
import org.jxmpp.jid.EntityJid;
public final class MultiUserChatManager extends Manager {
private final static String DISCO_NODE = MUCInitialPresence.NAMESPACE + "#rooms";
@ -78,9 +78,9 @@ public final class MultiUserChatManager extends Manager {
XMPPConnection connection = weakRefConnection.get();
if (connection == null)
return Collections.emptyList();
Set<BareJid> joinedRooms = MultiUserChatManager.getInstanceFor(connection).getJoinedRooms();
Set<EntityBareJid> joinedRooms = MultiUserChatManager.getInstanceFor(connection).getJoinedRooms();
List<DiscoverItems.Item> answer = new ArrayList<DiscoverItems.Item>();
for (BareJid room : joinedRooms) {
for (EntityBareJid room : joinedRooms) {
answer.add(new DiscoverItems.Item(room));
}
return answer;
@ -111,14 +111,14 @@ public final class MultiUserChatManager extends Manager {
new NotFilter(MessageTypeFilter.ERROR));
private final Set<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
* those instances to get garbage collected. Note that MultiUserChat instances can not get garbage collected while
* the user is joined, because then the MUC will have PacketListeners added to the XMPPConnection.
*/
private final Map<BareJid, WeakReference<MultiUserChat>> multiUserChats = new HashMap<>();
private final Map<EntityBareJid, WeakReference<MultiUserChat>> multiUserChats = new HashMap<>();
private MultiUserChatManager(XMPPConnection connection) {
super(connection);
@ -131,7 +131,7 @@ public final class MultiUserChatManager extends Manager {
final MUCUser mucUser = MUCUser.from(message);
// Check if the MUCUser extension includes an invitation
if (mucUser.getInvite() != null) {
BareJid mucJid = message.getFrom().asBareJidIfPossible();
EntityBareJid mucJid = message.getFrom().asEntityBareJidIfPossible();
if (mucJid == null) {
LOGGER.warning("Invite to non bare JID: '" + message.toXML() + "'");
return;
@ -160,7 +160,7 @@ public final class MultiUserChatManager extends Manager {
* @param jid the name of the room in the form "roomName@service", where "service" is the hostname at which the
* multi-user chat service is running. Make sure to provide a valid JID.
*/
public synchronized MultiUserChat getMultiUserChat(BareJid jid) {
public synchronized MultiUserChat getMultiUserChat(EntityBareJid jid) {
WeakReference<MultiUserChat> weakRefMultiUserChat = multiUserChats.get(jid);
if (weakRefMultiUserChat == null) {
return createNewMucAndAddToMap(jid);
@ -172,7 +172,7 @@ public final class MultiUserChatManager extends Manager {
return multiUserChat;
}
private MultiUserChat createNewMucAndAddToMap(BareJid jid) {
private MultiUserChat createNewMucAndAddToMap(EntityBareJid jid) {
MultiUserChat multiUserChat = new MultiUserChat(connection(), jid, this);
multiUserChats.put(jid, new WeakReference<MultiUserChat>(multiUserChat));
return multiUserChat;
@ -198,7 +198,7 @@ public final class MultiUserChatManager extends Manager {
*
* @return a List of the rooms where the user has joined using a given connection.
*/
public Set<BareJid> getJoinedRooms() {
public Set<EntityBareJid> getJoinedRooms() {
return Collections.unmodifiableSet(joinedRooms);
}
@ -213,15 +213,15 @@ public final class MultiUserChatManager extends Manager {
* @throws NotConnectedException
* @throws InterruptedException
*/
public List<BareJid> getJoinedRooms(JidWithLocalpart user) throws NoResponseException, XMPPErrorException,
public List<EntityBareJid> getJoinedRooms(EntityJid user) throws NoResponseException, XMPPErrorException,
NotConnectedException, InterruptedException {
// Send the disco packet to the user
DiscoverItems result = ServiceDiscoveryManager.getInstanceFor(connection()).discoverItems(user, DISCO_NODE);
List<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
for (DiscoverItems.Item item : items) {
BareJid muc = item.getEntityID().asBareJidIfPossible();
EntityBareJid muc = item.getEntityID().asEntityBareJidIfPossible();
if (muc == null) {
LOGGER.warning("Not a bare JID: " + item.getEntityID());
continue;
@ -242,7 +242,7 @@ public final class MultiUserChatManager extends Manager {
* @throws NotConnectedException
* @throws InterruptedException
*/
public RoomInfo getRoomInfo(BareJid room) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
public RoomInfo getRoomInfo(EntityBareJid room) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection()).discoverInfo(room);
return new RoomInfo(info);
}
@ -313,7 +313,7 @@ public final class MultiUserChatManager extends Manager {
* @throws NotConnectedException
* @throws InterruptedException
*/
public void decline(BareJid room, String inviter, String reason) throws NotConnectedException, InterruptedException {
public void decline(EntityBareJid room, String inviter, String reason) throws NotConnectedException, InterruptedException {
Message message = new Message(room);
// Create the MUCUser packet that will include the rejection
@ -346,11 +346,11 @@ public final class MultiUserChatManager extends Manager {
invitationsListeners.remove(listener);
}
void addJoinedRoom(BareJid room) {
void addJoinedRoom(EntityBareJid room) {
joinedRooms.add(room);
}
void removeJoinedRoom(BareJid room) {
void removeJoinedRoom(EntityBareJid room) {
joinedRooms.remove(room);
}
}

View File

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

View File

@ -17,7 +17,7 @@
package org.jivesoftware.smackx.muc;
import org.jxmpp.jid.FullJid;
import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid;
import org.jxmpp.jid.parts.Resourcepart;
@ -37,7 +37,7 @@ public interface ParticipantStatusListener {
* @param participant the participant that has just joined the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void joined(FullJid participant);
public abstract void joined(EntityFullJid participant);
/**
* Called when a room occupant has left the room on its own. This means that the occupant was
@ -46,7 +46,7 @@ public interface ParticipantStatusListener {
* @param participant the participant that has left the room on its own.
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void left(FullJid participant);
public abstract void left(EntityFullJid participant);
/**
* Called when a room participant has been kicked from the room. This means that the kicked
@ -57,7 +57,7 @@ public interface ParticipantStatusListener {
* @param actor the moderator that kicked the occupant from the room (e.g. user@host.org).
* @param reason the reason provided by the actor to kick the occupant from the room.
*/
public abstract void kicked(FullJid participant, Jid actor, String reason);
public abstract void kicked(EntityFullJid participant, Jid actor, String reason);
/**
* Called when a moderator grants voice to a visitor. This means that the visitor
@ -66,7 +66,7 @@ public interface ParticipantStatusListener {
* @param participant the participant that was granted voice in the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void voiceGranted(FullJid participant);
public abstract void voiceGranted(EntityFullJid participant);
/**
* Called when a moderator revokes voice from a participant. This means that the participant
@ -76,7 +76,7 @@ public interface ParticipantStatusListener {
* @param participant the participant that was revoked voice from the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void voiceRevoked(FullJid participant);
public abstract void voiceRevoked(EntityFullJid participant);
/**
* Called when an administrator or owner banned a participant from the room. This means that
@ -87,7 +87,7 @@ public interface ParticipantStatusListener {
* @param actor the administrator that banned the occupant (e.g. user@host.org).
* @param reason the reason provided by the administrator to ban the occupant.
*/
public abstract void banned(FullJid participant, Jid actor, String reason);
public abstract void banned(EntityFullJid participant, Jid actor, String reason);
/**
* Called when an administrator grants a user membership to the room. This means that the user
@ -96,7 +96,7 @@ public interface ParticipantStatusListener {
* @param participant the participant that was granted membership in the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void membershipGranted(FullJid participant);
public abstract void membershipGranted(EntityFullJid participant);
/**
* Called when an administrator revokes a user membership to the room. This means that the
@ -105,7 +105,7 @@ public interface ParticipantStatusListener {
* @param participant the participant that was revoked membership from the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void membershipRevoked(FullJid participant);
public abstract void membershipRevoked(EntityFullJid participant);
/**
* Called when an administrator grants moderator privileges to a user. This means that the user
@ -115,7 +115,7 @@ public interface ParticipantStatusListener {
* @param participant the participant that was granted moderator privileges in the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void moderatorGranted(FullJid participant);
public abstract void moderatorGranted(EntityFullJid participant);
/**
* Called when an administrator revokes moderator privileges from a user. This means that the
@ -125,7 +125,7 @@ public interface ParticipantStatusListener {
* @param participant the participant that was revoked moderator privileges in the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void moderatorRevoked(FullJid participant);
public abstract void moderatorRevoked(EntityFullJid participant);
/**
* Called when an owner grants a user ownership on the room. This means that the user
@ -135,7 +135,7 @@ public interface ParticipantStatusListener {
* @param participant the participant that was granted ownership on the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void ownershipGranted(FullJid participant);
public abstract void ownershipGranted(EntityFullJid participant);
/**
* Called when an owner revokes a user ownership on the room. This means that the user
@ -145,7 +145,7 @@ public interface ParticipantStatusListener {
* @param participant the participant that was revoked ownership on the room
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void ownershipRevoked(FullJid participant);
public abstract void ownershipRevoked(EntityFullJid participant);
/**
* Called when an owner grants administrator privileges to a user. This means that the user
@ -155,7 +155,7 @@ public interface ParticipantStatusListener {
* @param participant the participant that was granted administrator privileges
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void adminGranted(FullJid participant);
public abstract void adminGranted(EntityFullJid participant);
/**
* Called when an owner revokes administrator privileges from a user. This means that the user
@ -165,7 +165,7 @@ public interface ParticipantStatusListener {
* @param participant the participant that was revoked administrator privileges
* (e.g. room@conference.jabber.org/nick).
*/
public abstract void adminRevoked(FullJid participant);
public abstract void adminRevoked(EntityFullJid participant);
/**
* Called when a participant changed his/her nickname in the room. The new participant's
@ -175,6 +175,6 @@ public interface ParticipantStatusListener {
* (e.g. room@conference.jabber.org/nick).
* @param newNickname the new nickname that the participant decided to use.
*/
public abstract void nicknameChanged(FullJid participant, Resourcepart newNickname);
public abstract void nicknameChanged(EntityFullJid participant, Resourcepart newNickname);
}

View File

@ -26,7 +26,7 @@ import java.util.logging.Logger;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
import org.jivesoftware.smackx.xdata.Form;
import org.jivesoftware.smackx.xdata.FormField;
import org.jxmpp.jid.BareJid;
import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.Jid;
/**
@ -43,7 +43,7 @@ public class RoomInfo {
/**
* JID of the room. The localpart of the JID is commonly used as the ID of the room or name.
*/
private final BareJid room;
private final EntityBareJid room;
/**
* Description of the room.
*/
@ -132,7 +132,7 @@ public class RoomInfo {
RoomInfo(DiscoverInfo info) {
final Jid from = info.getFrom();
if (from != null) {
this.room = info.getFrom().asBareJidIfPossible();
this.room = info.getFrom().asEntityBareJidIfPossible();
} else {
this.room = null;
}
@ -240,7 +240,7 @@ public class RoomInfo {
*
* @return the JID of the room whose information was discovered.
*/
public BareJid getRoom() {
public EntityBareJid getRoom() {
return room;
}

View File

@ -17,7 +17,7 @@
package org.jivesoftware.smackx.muc;
import org.jxmpp.jid.FullJid;
import org.jxmpp.jid.EntityFullJid;
/**
* A listener that is fired anytime a MUC room changes its subject.
@ -32,6 +32,6 @@ public interface SubjectUpdatedListener {
* @param subject the new room's subject.
* @param from the user that changed the room's subject (e.g. room@conference.jabber.org/nick).
*/
public abstract void subjectUpdated(String subject, FullJid from);
public abstract void subjectUpdated(String subject, EntityFullJid from);
}

View File

@ -20,7 +20,7 @@ import java.io.Serializable;
import org.jivesoftware.smack.packet.NamedElement;
import org.jivesoftware.smack.util.XmlStringBuilder;
import org.jxmpp.jid.BareJid;
import org.jxmpp.jid.EntityBareJid;
/**
* Represents a request to the server to destroy a room. The sender of the request should be the
@ -38,13 +38,13 @@ public class Destroy implements NamedElement, Serializable {
public static final String ELEMENT = "destroy";
private final String reason;
private final BareJid jid;
private final EntityBareJid jid;
public Destroy(Destroy other) {
this(other.jid, other.reason);
}
public Destroy(BareJid alternativeJid, String reason) {
public Destroy(EntityBareJid alternativeJid, String reason) {
this.jid = alternativeJid;
this.reason = reason;
}
@ -54,7 +54,7 @@ public class Destroy implements NamedElement, Serializable {
*
* @return the JID of an alternate location.
*/
public BareJid getJid() {
public EntityBareJid getJid() {
return jid;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,7 +36,7 @@ import org.jivesoftware.smack.packet.Stanza;
/**
* This class can be used in conjunction with a mocked XMPP connection (
* {@link ConnectionUtils#createMockedConnection(Protocol, org.jxmpp.jid.FullJid, org.jxmpp.jid.DomainBareJid)}) to
* {@link ConnectionUtils#createMockedConnection(Protocol, org.jxmpp.jid.EntityFullJid, org.jxmpp.jid.DomainBareJid)}) to
* verify an XMPP protocol. This can be accomplished in the following was:
* <ul>
* <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.packet.Message;
import org.jivesoftware.smack.util.StringUtils;
import org.jxmpp.jid.JidWithLocalpart;
import org.jxmpp.jid.EntityJid;
import java.util.Set;
import java.util.Collections;
@ -41,7 +41,7 @@ public class Chat {
private ChatManager chatManager;
private String threadID;
private JidWithLocalpart participant;
private EntityJid participant;
private final Set<ChatMessageListener> listeners = new CopyOnWriteArraySet<ChatMessageListener>();
/**
@ -51,7 +51,7 @@ public class Chat {
* @param participant the user to chat with.
* @param threadID the thread ID to use.
*/
Chat(ChatManager chatManager, JidWithLocalpart participant, String threadID) {
Chat(ChatManager chatManager, EntityJid participant, String threadID) {
if (StringUtils.isEmpty(threadID)) {
throw new IllegalArgumentException("Thread ID must not be null");
}
@ -76,7 +76,7 @@ public class Chat {
*
* @return the name of the user the chat is occuring with.
*/
public JidWithLocalpart getParticipant() {
public EntityJid getParticipant() {
return participant;
}

View File

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

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

View File

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

View File

@ -31,7 +31,7 @@ import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.muc.MultiUserChat.MucCreateConfigFormHandle;
import org.jxmpp.jid.BareJid;
import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.jid.parts.Localpart;
@ -63,7 +63,7 @@ public class MultiUserChatIntegrationTest extends AbstractSmackIntegrationTest {
@SmackIntegrationTest
public void mucTest() throws TimeoutException, Exception {
BareJid mucAddress = JidCreate.bareFrom(Localpart.from("smack-inttest-" + randomString), mucService.getDomain());
EntityBareJid mucAddress = JidCreate.bareFrom(Localpart.from("smack-inttest-" + randomString), mucService.getDomain());
MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);

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

View File

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

View File

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