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

Remove API parts scheduled to be removed in Smack 4.3

This commit is contained in:
Florian Schmaus 2017-08-16 14:31:46 +02:00
parent 80eaaf2d71
commit ba323b51f9
11 changed files with 39 additions and 158 deletions

View file

@ -963,52 +963,12 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
replyTimeout = timeout;
}
/**
* Set the default value used to determine if new connection will reply to unknown IQ requests. The pre-configured
* default is 'true'.
*
* @param replyToUnkownIqDefault
* @see #setReplyToUnknownIq(boolean)
* @deprecated Use {@link SmackConfiguration#setUnknownIqRequestReplyMode(org.jivesoftware.smack.SmackConfiguration.UnknownIqRequestReplyMode)} instead.
*/
@Deprecated
// TODO Remove in Smack 4.3
public static void setReplyToUnknownIqDefault(boolean replyToUnkownIqDefault) {
SmackConfiguration.UnknownIqRequestReplyMode mode;
if (replyToUnkownIqDefault) {
mode = SmackConfiguration.UnknownIqRequestReplyMode.replyServiceUnavailable;
} else {
mode = SmackConfiguration.UnknownIqRequestReplyMode.doNotReply;
}
SmackConfiguration.setUnknownIqRequestReplyMode(mode);
}
private SmackConfiguration.UnknownIqRequestReplyMode unknownIqRequestReplyMode = SmackConfiguration.getUnknownIqRequestReplyMode();
public void setUnknownIqRequestReplyMode(UnknownIqRequestReplyMode unknownIqRequestReplyMode) {
this.unknownIqRequestReplyMode = Objects.requireNonNull(unknownIqRequestReplyMode, "Mode must not be null");
}
/**
* Set if Smack will automatically send
* {@link org.jivesoftware.smack.packet.XMPPError.Condition#feature_not_implemented} when a request IQ without a
* registered {@link IQRequestHandler} is received.
*
* @param replyToUnknownIq
* @deprecated use {@link #setUnknownIqRequestReplyMode(UnknownIqRequestReplyMode)} instead.
*/
@Deprecated
// TODO Remove in Smack 4.3
public void setReplyToUnknownIq(boolean replyToUnknownIq) {
SmackConfiguration.UnknownIqRequestReplyMode mode;
if (replyToUnknownIq) {
mode = SmackConfiguration.UnknownIqRequestReplyMode.replyServiceUnavailable;
} else {
mode = SmackConfiguration.UnknownIqRequestReplyMode.doNotReply;
}
unknownIqRequestReplyMode = mode;
}
protected void parseAndProcessStanza(XmlPullParser parser) throws Exception {
ParserUtils.assertAtStartTag(parser);
int parserDepth = parser.getDepth();

View file

@ -345,8 +345,7 @@ public final class SmackConfiguration {
replyServiceUnavailable,
}
// TODO Change to replyFeatureNotImplemented in Smack 4.3
private static UnknownIqRequestReplyMode unknownIqRequestReplyMode = UnknownIqRequestReplyMode.replyServiceUnavailable;
private static UnknownIqRequestReplyMode unknownIqRequestReplyMode = UnknownIqRequestReplyMode.replyFeatureNotImplemented;
public static UnknownIqRequestReplyMode getUnknownIqRequestReplyMode() {
return unknownIqRequestReplyMode;

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2003-2007 Jive Software, 2015 Florian Schmaus
* Copyright 2003-2007 Jive Software, 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.
@ -16,7 +16,6 @@
*/
package org.jivesoftware.smack.packet;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -102,50 +101,6 @@ public class XMPPError extends AbstractError {
private final Type type;
private final Stanza stanza;
// TODO: Deprecated constructors
// deprecate in 4.3
/**
* Create a new XMPPError.
*
* @param condition
* @deprecated use {@link Builder} instead.
*/
@Deprecated
public XMPPError(Condition condition) {
this(condition, null, null, null, null, null, null);
}
/**
* Create a new XMPPError.
*
* @param condition
* @param applicationSpecificCondition
* @deprecated use {@link Builder} instead.
*/
@Deprecated
public XMPPError(Condition condition, ExtensionElement applicationSpecificCondition) {
this(condition, null, null, null, null, Arrays.asList(applicationSpecificCondition), null);
}
/**
* Creates a new error with the specified type, condition and message.
* This constructor is used when the condition is not recognized automatically by XMPPError
* i.e. there is not a defined instance of ErrorCondition or it does not apply the default
* specification.
*
* @param type the error type.
* @param condition the error condition.
* @param descriptiveTexts
* @param extensions list of stanza(/packet) extensions
* @deprecated use {@link Builder} instead.
*/
@Deprecated
public XMPPError(Condition condition, String conditionText, String errorGenerator, Type type, Map<String, String> descriptiveTexts,
List<ExtensionElement> extensions) {
this(condition, conditionText, errorGenerator, type, descriptiveTexts, extensions, null);
}
/**
* Creates a new error with the specified type, condition and message.
* This constructor is used when the condition is not recognized automatically by XMPPError

View file

@ -41,19 +41,6 @@ public class StringUtils {
public static final char[] HEX_CHARS = "0123456789abcdef".toCharArray();
/**
* Escape <code>input</code> for XML.
*
* @param input the input to escape.
* @return the XML escaped variant of <code>input</code>.
* @deprecated use {@link #escapeForXml(CharSequence)} instead.
*/
// Remove in 4.3.
@Deprecated
public static CharSequence escapeForXML(CharSequence input) {
return escapeForXml(input);
}
/**
* Escape <code>input</code> for XML.
*