Remove deprecated methods from XMPPConnection

This commit is contained in:
Florian Schmaus 2017-08-11 23:50:32 +02:00
parent a203d3198c
commit 0602ae064a
5 changed files with 5 additions and 116 deletions

View File

@ -323,12 +323,6 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
return config;
}
@SuppressWarnings("deprecation")
@Override
public DomainBareJid getServiceName() {
return getXMPPServiceDomain();
}
@Override
public DomainBareJid getXMPPServiceDomain() {
if (xmppServiceDomain != null) {
@ -665,12 +659,6 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
}
}
@Deprecated
@Override
public void sendPacket(Stanza packet) throws NotConnectedException, InterruptedException {
sendStanza(packet);
}
@Override
public void sendStanza(Stanza stanza) throws NotConnectedException, InterruptedException {
Objects.requireNonNull(stanza, "Stanza must not be null");
@ -803,18 +791,6 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
collectors.remove(collector);
}
@Override
@Deprecated
public void addPacketListener(StanzaListener packetListener, StanzaFilter packetFilter) {
addAsyncStanzaListener(packetListener, packetFilter);
}
@Override
@Deprecated
public boolean removePacketListener(StanzaListener packetListener) {
return removeAsyncStanzaListener(packetListener);
}
@Override
public void addSyncStanzaListener(StanzaListener packetListener, StanzaFilter packetFilter) {
if (packetListener == null) {
@ -976,18 +952,6 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
}
}
@SuppressWarnings("deprecation")
@Override
public long getPacketReplyTimeout() {
return getReplyTimeout();
}
@SuppressWarnings("deprecation")
@Override
public void setPacketReplyTimeout(long timeout) {
setReplyTimeout(timeout);
}
@Override
public long getReplyTimeout() {
return replyTimeout;

View File

@ -72,18 +72,6 @@ import org.jxmpp.jid.EntityFullJid;
*/
public interface XMPPConnection {
/**
* Returns the name of the service provided by the XMPP server for this connection.
* This is also called XMPP domain of the connected server. After
* authenticating with the server the returned value may be different.
*
* @return the name of the service provided by the XMPP server.
// TODO remove this once the java bugs are fixed, causing a warning
// * @deprecated use {@link #getXMPPServiceDomain()} instead.
*/
// @Deprecated
public DomainBareJid getServiceName();
/**
* Returns the XMPP Domain of the service provided by the XMPP server and used for this connection. After
* authenticating with the server the returned value may be different.
@ -165,18 +153,6 @@ public interface XMPPConnection {
*/
public boolean isUsingCompression();
/**
* Sends the specified stanza(/packet) to the server.
*
* @param packet the stanza(/packet) to send.
* @throws NotConnectedException
* @throws InterruptedException
* @deprecated use {@link #sendStanza(Stanza)} instead.
*/
// TODO Remove in 4.3.
@Deprecated
public void sendPacket(Stanza packet) throws NotConnectedException, InterruptedException;
/**
* Sends the specified stanza to the server.
*
@ -281,35 +257,6 @@ public interface XMPPConnection {
*/
public void removeStanzaCollector(StanzaCollector collector);
/**
* Registers a stanza(/packet) listener with this connection.
* <p>
* This method has been deprecated. It is important to differentiate between using an asynchronous stanza(/packet) listener
* (preferred where possible) and a synchronous stanza(/packet) lister. Refer
* {@link #addAsyncStanzaListener(StanzaListener, StanzaFilter)} and
* {@link #addSyncStanzaListener(StanzaListener, StanzaFilter)} for more information.
* </p>
*
* @param packetListener the stanza(/packet) listener to notify of new received packets.
* @param packetFilter the stanza(/packet) filter to use.
* @deprecated use {@link #addAsyncStanzaListener(StanzaListener, StanzaFilter)} or
* {@link #addSyncStanzaListener(StanzaListener, StanzaFilter)}.
*/
// TODO Remove in 4.3.
@Deprecated
public void addPacketListener(StanzaListener packetListener, StanzaFilter packetFilter);
/**
* Removes a stanza(/packet) listener for received packets from this connection.
*
* @param packetListener the stanza(/packet) listener to remove.
* @return true if the stanza(/packet) listener was removed
* @deprecated use {@link #removeAsyncStanzaListener(StanzaListener)} or {@link #removeSyncStanzaListener(StanzaListener)}.
*/
// TODO Remove in 4.3.
@Deprecated
public boolean removePacketListener(StanzaListener packetListener);
/**
* Registers a <b>synchronous</b> stanza(/packet) listener with this connection. A stanza(/packet) listener will be invoked only when
* an incoming stanza(/packet) is received. A stanza(/packet) filter determines which packets will be delivered to the listener. If
@ -405,28 +352,6 @@ public interface XMPPConnection {
*/
public void removePacketInterceptor(StanzaListener packetInterceptor);
/**
* Returns the current value of the reply timeout in milliseconds for request for this
* XMPPConnection instance.
*
* @return the stanza(/packet) reply timeout in milliseconds
* @deprecated use {@link #getReplyTimeout()} instead.
*/
@Deprecated
// TODO Remove in Smack 4.3
public long getPacketReplyTimeout();
/**
* Set the stanza(/packet) reply timeout in milliseconds. In most cases, Smack will throw a
* {@link NoResponseException} if no reply to a request was received within the timeout period.
*
* @param timeout the stanza(/packet) reply timeout in milliseconds
* @deprecated use {@link #setReplyTimeout(long)} instead.
*/
@Deprecated
// TODO Remove in Smack 4.3
public void setPacketReplyTimeout(long timeout);
/**
* Returns the current value of the reply timeout in milliseconds for request for this
* XMPPConnection instance.

View File

@ -62,7 +62,7 @@ public class ServiceAdministrationManager extends Manager {
}
public RemoteCommand addUser() {
return addUser(connection().getServiceName());
return addUser(connection().getXMPPServiceDomain());
}
public RemoteCommand addUser(Jid service) {
@ -90,7 +90,7 @@ public class ServiceAdministrationManager extends Manager {
}
public RemoteCommand deleteUser() {
return deleteUser(connection().getServiceName());
return deleteUser(connection().getXMPPServiceDomain());
}
public RemoteCommand deleteUser(Jid service) {

View File

@ -151,7 +151,7 @@ public final class PingManager extends Manager {
private boolean isValidErrorPong(Jid destinationJid, XMPPErrorException xmppErrorException) {
// If it is an error error response and the destination was our own service, then this must mean that the
// service responded, i.e. is up and pingable.
if (destinationJid.equals(connection().getServiceName())) {
if (destinationJid.equals(connection().getXMPPServiceDomain())) {
return true;
}

View File

@ -1,6 +1,6 @@
/**
*
* Copyright 2015-2016 Florian Schmaus
* Copyright 2015-2017 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -74,7 +74,7 @@ public class IntTestUtil {
ServiceAdministrationManager adminManager = ServiceAdministrationManager.getInstanceFor(connection);
EntityBareJid userJid = JidCreate.entityBareFrom(Localpart.from(username), connection.getServiceName());
EntityBareJid userJid = JidCreate.entityBareFrom(Localpart.from(username), connection.getXMPPServiceDomain());
adminManager.addUser(userJid, password);
connection.disconnect();