1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 17:19:39 +02:00

Delete APIs scheduled for removal with Smack 4.5

This commit is contained in:
Florian Schmaus 2024-09-14 21:34:47 +02:00
parent af77e561c5
commit 4a101e2c99
38 changed files with 39 additions and 1534 deletions

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2016 Fernando Ramirez, 2020 Florian Schmaus
* Copyright 2016 Fernando Ramirez, 2020-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -65,18 +65,6 @@ public class BoBIQ extends IQ {
this(cid, null);
}
/**
* Get the BoB hash.
*
* @return the BoB hash
* @deprecated use {@link #getContentId()} instead.
*/
// TODO: Remove in Smack 4.5.
@Deprecated
public ContentId getBoBHash() {
return cid;
}
/**
* Get the BoB hash.
*

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2003-2007 Jive Software, 2018-2022 Florian Schmaus.
* Copyright 2003-2007 Jive Software, 2018-2024 Florian Schmaus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -442,27 +442,6 @@ public final class ServiceDiscoveryManager extends Manager {
return features.contains(feature);
}
/**
* Registers extended discovery information of this XMPP entity. When this
* client is queried for its information this data form will be returned as
* specified by XEP-0128.
* <p>
*
* Since no stanza is actually sent to the server it is safe to perform this
* operation before logging to the server. In fact, you may want to
* configure the extended info before logging to the server so that the
* information is already available if it is required upon login.
*
* @param info the data form that contains the extend service discovery
* information.
* @deprecated use {@link #addExtendedInfo(DataForm)} instead.
*/
// TODO: Remove in Smack 4.5
@Deprecated
public synchronized void setExtendedInfo(DataForm info) {
addExtendedInfo(info);
}
/**
* Registers extended discovery information of this XMPP entity. When this
* client is queried for its information this data form will be returned as
@ -518,19 +497,6 @@ public final class ServiceDiscoveryManager extends Manager {
return CollectionUtil.newListWith(extendedInfos);
}
/**
* Returns the data form as List of PacketExtensions, or null if no data form is set.
* This representation is needed by some classes (e.g. EntityCapsManager, NodeInformationProvider)
*
* @return the data form as List of PacketExtensions
* @deprecated use {@link #getExtendedInfo()} instead.
*/
// TODO: Remove in Smack 4.5
@Deprecated
public List<DataForm> getExtendedInfoAsList() {
return getExtendedInfo();
}
/**
* Removes the data form containing extended service discovery information
* from the information returned by this XMPP entity.<p>

View file

@ -17,7 +17,6 @@
package org.jivesoftware.smackx.disco.packet;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
@ -83,17 +82,6 @@ public class DiscoverInfo extends IQ implements DiscoverInfoView {
}
}
/**
* Deprecated.
*
* @deprecated use {@link DiscoverInfoBuilder} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public DiscoverInfo() {
super(ELEMENT, NAMESPACE);
}
/**
* Copy constructor.
*
@ -114,85 +102,11 @@ public class DiscoverInfo extends IQ implements DiscoverInfoView {
identitiesSet.addAll(d.identitiesSet);
}
/**
* Adds a new feature to the discovered information.
*
* @param feature the discovered feature
* @return true if the feature did not already exist.
* @deprecated use {@link DiscoverInfoBuilder#addFeature(String)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public boolean addFeature(String feature) {
return addFeature(new Feature(feature));
}
/**
* Adds a collection of features to the packet. Does noting if featuresToAdd is null.
*
* @param featuresToAdd TODO javadoc me please
* @deprecated use {@link DiscoverInfoBuilder#addFeatures(Collection)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public void addFeatures(Collection<String> featuresToAdd) {
if (featuresToAdd == null) return;
for (String feature : featuresToAdd) {
addFeature(feature);
}
}
/**
* Deprecated.
*
* @param feature the future.
* @return true if the feature is new.
* @deprecated use {@link DiscoverInfoBuilder#addFeature(DiscoverInfo.Feature)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public boolean addFeature(Feature feature) {
features.add(feature);
boolean featureIsNew = featuresSet.add(feature);
if (!featureIsNew) {
containsDuplicateFeatures = true;
}
return featureIsNew;
}
@Override
public List<Feature> getFeatures() {
return Collections.unmodifiableList(features);
}
/**
* Adds a new identity of the requested entity to the discovered information.
*
* @param identity the discovered entity's identity
* @deprecated use {@link DiscoverInfoBuilder#addIdentity(DiscoverInfo.Identity)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public void addIdentity(Identity identity) {
identities.add(identity);
identitiesSet.add(identity.getKey());
}
/**
* Adds identities to the DiscoverInfo stanza.
*
* @param identitiesToAdd TODO javadoc me please
* @deprecated use {@link DiscoverInfoBuilder#addIdentities(Collection)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public void addIdentities(Collection<Identity> identitiesToAdd) {
if (identitiesToAdd == null) return;
for (Identity identity : identitiesToAdd) {
addIdentity(identity);
}
}
@Override
public List<Identity> getIdentities() {
return Collections.unmodifiableList(identities);
@ -232,22 +146,6 @@ public class DiscoverInfo extends IQ implements DiscoverInfoView {
return node;
}
/**
* Sets the node attribute that supplements the 'jid' attribute. A node is merely
* something that is associated with a JID and for which the JID can provide information.<p>
*
* Node attributes SHOULD be used only when trying to provide or query information which
* is not directly addressable.
*
* @param node the node attribute that supplements the 'jid' attribute
* @deprecated use {@link DiscoverInfoBuilder#setNode(String)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public void setNode(String node) {
this.node = StringUtils.requireNullOrNotEmpty(node, "The node can not be the empty string");
}
/**
* Returns true if the specified feature is part of the discovered information.
*
@ -310,18 +208,6 @@ public class DiscoverInfo extends IQ implements DiscoverInfoView {
return new DiscoverInfoBuilder(this, stanzaId);
}
/**
* Deprecated, do not use.
*
* @deprecated use {@link #asBuilder(String)} instead.
*/
// TODO: Remove in Smack 4.5.
@Deprecated
@Override
public DiscoverInfo clone() {
return new DiscoverInfo(this);
}
public static DiscoverInfoBuilder builder(XMPPConnection connection) {
return new DiscoverInfoBuilder(connection);
}

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2014 Florian Schmaus.
* Copyright 2014-2024 Florian Schmaus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -50,25 +50,6 @@ public class JivePropertiesManager {
return javaObjectEnabled;
}
/**
* Convenience method to add a property to a packet.
*
* @param packet the stanza to add the property to.
* @param name the name of the property to add.
* @param value the value of the property to add.
* @deprecated use {@link #addProperty(StanzaBuilder, String, Object)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public static void addProperty(Stanza packet, String name, Object value) {
JivePropertiesExtension jpe = (JivePropertiesExtension) packet.getExtension(JivePropertiesExtension.NAMESPACE);
if (jpe == null) {
jpe = new JivePropertiesExtension();
packet.addExtension(jpe);
}
jpe.setProperty(name, value);
}
/**
* Convenience method to add a property to a stanza.
*

View file

@ -1,98 +0,0 @@
/**
*
* Copyright 2003-2007 Jive Software.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.smackx.muc;
import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid;
import org.jxmpp.jid.parts.Resourcepart;
/**
* Default implementation of the ParticipantStatusListener interface.<p>
*
* This class does not provide any behavior by default. It just avoids having
* to implement all the interface methods if the user is only interested in implementing
* some of the methods.
*
* @author Gaston Dombiak
* @deprecated use {@link ParticipantStatusListener} instead.
*/
// TODO: Remove in Smack 4.5
@Deprecated
public class DefaultParticipantStatusListener implements ParticipantStatusListener {
@Override
public void joined(EntityFullJid participant) {
}
@Override
public void left(EntityFullJid participant) {
}
@Override
public void kicked(EntityFullJid participant, Jid actor, String reason) {
}
@Override
public void voiceGranted(EntityFullJid participant) {
}
@Override
public void voiceRevoked(EntityFullJid participant) {
}
@Override
public void banned(EntityFullJid participant, Jid actor, String reason) {
}
@Override
public void membershipGranted(EntityFullJid participant) {
}
@Override
public void membershipRevoked(EntityFullJid participant) {
}
@Override
public void moderatorGranted(EntityFullJid participant) {
}
@Override
public void moderatorRevoked(EntityFullJid participant) {
}
@Override
public void ownershipGranted(EntityFullJid participant) {
}
@Override
public void ownershipRevoked(EntityFullJid participant) {
}
@Override
public void adminGranted(EntityFullJid participant) {
}
@Override
public void adminRevoked(EntityFullJid participant) {
}
@Override
public void nicknameChanged(EntityFullJid participant, Resourcepart newNickname) {
}
}

View file

@ -1,88 +0,0 @@
/**
*
* Copyright 2003-2007 Jive Software.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.smackx.muc;
import org.jxmpp.jid.Jid;
/**
* Default implementation of the UserStatusListener interface.<p>
*
* This class does not provide any behavior by default. It just avoids having
* to implement all the interface methods if the user is only interested in implementing
* some of the methods.
*
* @author Gaston Dombiak
* @deprecated use {@link UserStatusListener} instead.
*/
// TODO: Remove in Smack 4.5.
@Deprecated
public class DefaultUserStatusListener implements UserStatusListener {
@Override
public void kicked(Jid actor, String reason) {
}
@Override
public void voiceGranted() {
}
@Override
public void voiceRevoked() {
}
@Override
public void banned(Jid actor, String reason) {
}
@Override
public void membershipGranted() {
}
@Override
public void membershipRevoked() {
}
@Override
public void moderatorGranted() {
}
@Override
public void moderatorRevoked() {
}
@Override
public void ownershipGranted() {
}
@Override
public void ownershipRevoked() {
}
@Override
public void adminGranted() {
}
@Override
public void adminRevoked() {
}
@Override
public void roomDestroyed(MultiUserChat alternateMUC, String password, String reason) {
}
}

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2015-2020 Florian Schmaus
* Copyright 2015-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -60,13 +60,8 @@ public final class MucEnterConfiguration {
since = builder.since;
timeout = builder.timeout;
final PresenceBuilder joinPresenceBuilder;
if (builder.joinPresence == null) {
joinPresenceBuilder = builder.joinPresenceBuilder.ofType(Presence.Type.available);
}
else {
joinPresenceBuilder = builder.joinPresence.asBuilder();
}
final PresenceBuilder joinPresenceBuilder = builder.joinPresenceBuilder.ofType(Presence.Type.available);
// Indicate the client supports MUC
joinPresenceBuilder.addExtension(new MUCInitialPresence(password, maxChars, maxStanzas, seconds,
since));
@ -95,9 +90,6 @@ public final class MucEnterConfiguration {
private final PresenceBuilder joinPresenceBuilder;
// TODO: Remove in Smack 4.5.
private Presence joinPresence;
Builder(Resourcepart nickname, XMPPConnection connection) {
this.nickname = Objects.requireNonNull(nickname, "Nickname must not be null");
@ -107,28 +99,6 @@ public final class MucEnterConfiguration {
joinPresenceBuilder = connection.getStanzaFactory().buildPresenceStanza();
}
/**
* Set the presence used to join the MUC room.
* <p>
* The 'to' value of the given presence will be overridden and the given presence must be of type
* 'available', otherwise an {@link IllegalArgumentException} will be thrown.
* <p>
*
* @param presence TODO javadoc me please
* @return a reference to this builder.
* @deprecated use {@link #withPresence(Consumer)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public Builder withPresence(Presence presence) {
if (presence.getType() != Presence.Type.available) {
throw new IllegalArgumentException("Presence must be of type 'available'");
}
joinPresence = presence;
return this;
}
/**
* Set the presence used to join the MUC room.
* <p>

View file

@ -718,7 +718,7 @@ public class MultiUserChat {
// nickname.
if (isJoined()) {
try {
leaveSync();
leave();
}
catch (XMPPErrorException | NoResponseException | MucNotJoinedException e) {
LOGGER.log(Level.WARNING, "Could not leave MUC prior joining, assuming we are not joined", e);
@ -738,23 +738,6 @@ public class MultiUserChat {
return getMyRoomJid() != null;
}
/**
* Leave the chat room.
*
* @return the leave presence as reflected by the MUC.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
* @throws XMPPErrorException if there was an XMPP error returned.
* @throws NoResponseException if there was no response from the remote entity.
* @throws MucNotJoinedException if not joined to the Multi-User Chat.
* @deprecated use {@link #leave()} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public synchronized Presence leaveSync() throws NotConnectedException, InterruptedException, MucNotJoinedException, NoResponseException, XMPPErrorException {
return leave();
}
/**
* Leave the chat room.
*
@ -1028,36 +1011,6 @@ public class MultiUserChat {
invite(connection.getStanzaFactory().buildMessageStanza(), user, reason);
}
/**
* Invites another user to the room in which one is an occupant using a given Message. The invitation
* will be sent to the room which in turn will forward the invitation to the invitee.<p>
*
* If the room is password-protected, the invitee will receive a password to use to join
* the room. If the room is members-only, the invitee may be added to the member list.
*
* @param message the message to use for sending the invitation.
* @param user the user to invite to the room.(e.g. hecate@shakespeare.lit)
* @param reason the reason why the user is being invited.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
* @deprecated use {@link #invite(MessageBuilder, EntityBareJid, String)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public void invite(Message message, EntityBareJid user, String reason) throws NotConnectedException, InterruptedException {
// TODO listen for 404 error code when inviter supplies a non-existent JID
message.setTo(room);
// Create the MUCUser packet that will include the invitation
MUCUser mucUser = new MUCUser();
MUCUser.Invite invite = new MUCUser.Invite(reason, user);
mucUser.setInvite(invite);
// Add the MUCUser packet that includes the invitation to the message
message.addExtension(mucUser);
connection.sendStanza(message);
}
/**
* Invites another user to the room in which one is an occupant using a given Message. The invitation
* will be sent to the room which in turn will forward the invitation to the invitee.<p>
@ -2137,20 +2090,6 @@ public class MultiUserChat {
;
}
/**
* Sends a Message to the chat room.
*
* @param message the message.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
* @deprecated use {@link #sendMessage(MessageBuilder)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public void sendMessage(Message message) throws NotConnectedException, InterruptedException {
sendMessage(message.asBuilder());
}
/**
* Sends a Message to the chat room.
*

View file

@ -1,6 +1,6 @@
/**
*
* Copyright © 2014-2015 Florian Schmaus
* Copyright © 2014-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -88,7 +88,7 @@ public abstract class MultiUserChatException extends SmackException {
/**
* Thrown when trying to enter a MUC room that is not hosted a domain providing a MUC service.
* Try {@link MultiUserChatManager#getXMPPServiceDomains()} for a list of client-local domains
* Try {@link MultiUserChatManager#getMucServiceDomains()} for a list of client-local domains
* providing a MUC service.
*/
public static class NotAMucServiceException extends MultiUserChatException {

View file

@ -1,6 +1,6 @@
/**
*
* Copyright © 2014-2021 Florian Schmaus
* Copyright © 2014-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -421,22 +421,6 @@ public final class MultiUserChatManager extends Manager {
return serviceDiscoveryManager.findServices(MUCInitialPresence.NAMESPACE, false, false);
}
/**
* Returns a collection with the XMPP addresses of the Multi-User Chat services.
*
* @return a collection with the XMPP addresses of the Multi-User Chat services.
* @throws XMPPErrorException if there was an XMPP error returned.
* @throws NoResponseException if there was no response from the remote entity.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
* @deprecated use {@link #getMucServiceDomains()} instead.
*/
// TODO: Remove in Smack 4.5
@Deprecated
public List<DomainBareJid> getXMPPServiceDomains() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return getMucServiceDomains();
}
/**
* Check if the provided domain bare JID provides a MUC service.
*

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2003-2007 Jive Software, 2015-2020 Florian Schmaus
* Copyright 2003-2007 Jive Software, 2015-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -248,32 +248,6 @@ public final class PepManager extends Manager {
return pepPubSubManager;
}
/**
* Adds a listener to PEPs. The listener will be fired anytime PEP events are received from remote XMPP clients.
*
* @param pepListener a roster exchange listener.
* @return true if pepListener was added.
* @deprecated use {@link #addPepEventListener(String, Class, PepEventListener)} instead.
*/
// TODO: Remove in Smack 4.5
@Deprecated
public boolean addPepListener(PepListener pepListener) {
return pepListeners.add(pepListener);
}
/**
* Removes a listener from PEP events.
*
* @param pepListener a roster exchange listener.
* @return true, if pepListener was removed.
* @deprecated use {@link #removePepEventListener(PepEventListener)} instead.
*/
// TODO: Remove in Smack 4.5.
@Deprecated
public boolean removePepListener(PepListener pepListener) {
return pepListeners.remove(pepListener);
}
/**
* Publish an event.
*

View file

@ -31,7 +31,7 @@ public class ItemDeleteEvent extends SubscriptionEvent {
* Constructs an <code>ItemDeleteEvent</code> that indicates the supplied
* items (by id) have been deleted, and that the event matches the listed
* subscriptions. The subscriptions would have been created by calling
* {@link LeafNode#subscribe(String)}.
* {@link LeafNode#subscribe(org.jxmpp.Jid)}.
*
* @param nodeId The id of the node the event came from
* @param deletedItemIds The item ids of the items that were deleted.

View file

@ -52,8 +52,6 @@ import org.jivesoftware.smackx.shim.packet.HeadersExtension;
import org.jivesoftware.smackx.xdata.packet.DataForm;
import org.jxmpp.jid.Jid;
import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.stringprep.XmppStringprepException;
public abstract class Node {
protected final PubSubManager pubSubManager;
@ -403,39 +401,6 @@ public abstract class Node {
return reply.getExtension(PubSubElementType.SUBSCRIPTION);
}
/**
* The user subscribes to the node using the supplied jid. The
* bare jid portion of this one must match the jid for the connection.
*
* Please note that the {@link Subscription.State} should be checked
* on return since more actions may be required by the caller.
* {@link Subscription.State#pending} - The owner must approve the subscription
* request before messages will be received.
* {@link Subscription.State#unconfigured} - If the {@link Subscription#isConfigRequired()} is true,
* the caller must configure the subscription before messages will be received. If it is false
* the caller can configure it but is not required to do so.
*
* @param jidString The jid to subscribe as.
* @return The subscription
* @throws XMPPErrorException if there was an XMPP error returned.
* @throws NoResponseException if there was no response from the remote entity.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
* @throws IllegalArgumentException if the provided string is not a valid JID.
* @deprecated use {@link #subscribe(Jid)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public Subscription subscribe(String jidString) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
Jid jid;
try {
jid = JidCreate.from(jidString);
} catch (XmppStringprepException e) {
throw new IllegalArgumentException(e);
}
return subscribe(jid);
}
/**
* The user subscribes to the node using the supplied jid and subscription
* options. The bare jid portion of this one must match the jid for the
@ -466,42 +431,6 @@ public abstract class Node {
return reply.getExtension(PubSubElementType.SUBSCRIPTION);
}
/**
* The user subscribes to the node using the supplied jid and subscription
* options. The bare jid portion of this one must match the jid for the
* connection.
*
* Please note that the {@link Subscription.State} should be checked
* on return since more actions may be required by the caller.
* {@link Subscription.State#pending} - The owner must approve the subscription
* request before messages will be received.
* {@link Subscription.State#unconfigured} - If the {@link Subscription#isConfigRequired()} is true,
* the caller must configure the subscription before messages will be received. If it is false
* the caller can configure it but is not required to do so.
*
* @param jidString The jid to subscribe as.
* @param subForm TODO javadoc me please
*
* @return The subscription
* @throws XMPPErrorException if there was an XMPP error returned.
* @throws NoResponseException if there was no response from the remote entity.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
* @throws IllegalArgumentException if the provided string is not a valid JID.
* @deprecated use {@link #subscribe(Jid, FillableSubscribeForm)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public Subscription subscribe(String jidString, FillableSubscribeForm subForm) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
Jid jid;
try {
jid = JidCreate.from(jidString);
} catch (XmppStringprepException e) {
throw new IllegalArgumentException(e);
}
return subscribe(jid, subForm);
}
/**
* Remove the subscription related to the specified JID. This will only
* work if there is only 1 subscription. If there are multiple subscriptions,

View file

@ -156,33 +156,6 @@ public final class PubSubManager extends Manager {
return pubSubManager;
}
/**
* Deprecated.
*
* @param connection the connection.
* @return the PubSub manager for the given connection.
* @deprecated use {@link #getInstanceFor(XMPPConnection)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public static PubSubManager getInstance(XMPPConnection connection) {
return getInstanceFor(connection);
}
/**
* Deprecated.
*
* @param connection the connection.
* @param pubSubService the XMPP address of the PubSub service.
* @return the PubSub manager for the given connection.
* @deprecated use {@link #getInstanceFor(XMPPConnection, BareJid)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5.
public static PubSubManager getInstance(XMPPConnection connection, BareJid pubSubService) {
return getInstanceFor(connection, pubSubService);
}
/**
* Create a pubsub manager associated to the specified connection where
* the pubsub requests require a specific to address for packets.

View file

@ -59,27 +59,6 @@ public class SimplePayload implements XmlElement {
ns = StringUtils.requireNotNullNorEmpty(qname.getNamespaceURI(), "Could not determine namespace from XML payload");
}
/**
* Construct a <code>SimplePayload</code> object with the specified element name,
* namespace and content. The content must be well formed XML.
*
* @param elementName The root element name (of the payload)
* @param namespace The namespace of the payload, null if there is none
* @param xmlPayload The payload data
* @deprecated use {@link #SimplePayload(String)} instead.
*/
// TODO: Remove in Smack 4.5
@Deprecated
public SimplePayload(String elementName, String namespace, CharSequence xmlPayload) {
this(xmlPayload.toString());
if (!elementName.equals(this.elemName)) {
throw new IllegalArgumentException();
}
if (!namespace.equals(this.ns)) {
throw new IllegalArgumentException();
}
}
@Override
public String getElementName() {
return elemName;

View file

@ -106,7 +106,7 @@ public final class VCardManager extends Manager {
vcard.setType(IQ.Type.set);
// Also make sure to generate a new stanza id (the given vcard could be a vcard result), in which case we don't
// want to use the same stanza id again (although it wouldn't break if we did)
vcard.setStanzaId();
// vcard.setStanzaId(); TODO FIXME
connection().sendIqRequestAndWaitForResponse(vcard);
}

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2003-2007 Jive Software, 2019-2021 Florian Schmaus.
* Copyright 2003-2007 Jive Software, 2019-2024 Florian Schmaus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -342,23 +342,6 @@ public abstract class FormField implements XmlElement {
return XmppDateTime.parseXEP0082Date(valueString);
}
/**
* Returns the field's name, also known as the variable name in case this is an filled out answer form.
* <p>
* According to XEP-4 § 3.2 the variable name (the 'var' attribute)
* "uniquely identifies the field in the context of the form" (if the field is not of type 'fixed', in which case
* the field "MAY possess a 'var' attribute")
* </p>
*
* @return the field's name.
* @deprecated use {@link #getFieldName()} instead.
*/
// TODO: Remove in Smack 4.5
@Deprecated
public String getVariable() {
return getFieldName();
}
/**
* Returns the field's name, also known as the variable name in case this is an filled out answer form.
* <p>

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2003-2007 Jive Software, 2020-2021 Florian Schmaus.
* Copyright 2003-2007 Jive Software, 2020-2024 Florian Schmaus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -33,7 +33,6 @@ import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.StanzaView;
import org.jivesoftware.smack.packet.XmlEnvironment;
import org.jivesoftware.smack.util.CollectionUtil;
import org.jivesoftware.smack.util.Objects;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.XmlStringBuilder;
@ -356,8 +355,7 @@ public final class DataForm implements ExtensionElement {
}
public static final class Builder {
// TODO: Make this field final once setType() is gone.
private Type type;
private final Type type;
private String title;
private List<String> instructions;
private ReportedData reportedData;
@ -409,20 +407,6 @@ public final class DataForm implements ExtensionElement {
}
}
/**
* Deprecated do not use.
*
* @param type the type.
* @return a reference to this builder.
* @deprecated use {@link DataForm#builder(Type)} instead.
*/
@Deprecated
// TODO: Remove in Smack 4.5 and then make this.type final.
public Builder setType(Type type) {
this.type = Objects.requireNonNull(type);
return this;
}
/**
* Sets the description of the data. It is similar to the title on a web page or an X window.
* You can put a &lt;title/&gt; on either a form to fill out, or a set of data results.