2014-03-12 11:50:05 +01:00
|
|
|
/**
|
|
|
|
*
|
2020-04-04 13:03:31 +02:00
|
|
|
* Copyright 2014-2020 Florian Schmaus
|
2014-03-12 11:50:05 +01:00
|
|
|
*
|
|
|
|
* 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.smack;
|
|
|
|
|
2020-05-26 21:39:08 +02:00
|
|
|
import java.security.cert.CertificateException;
|
2020-04-04 13:03:31 +02:00
|
|
|
import java.util.Collections;
|
2014-03-12 11:50:05 +01:00
|
|
|
import java.util.List;
|
|
|
|
|
2020-04-04 13:03:31 +02:00
|
|
|
import org.jivesoftware.smack.c2s.XmppClientToServerTransport.LookupConnectionEndpointsFailed;
|
2015-02-26 18:41:17 +01:00
|
|
|
import org.jivesoftware.smack.filter.StanzaFilter;
|
2020-04-04 13:03:31 +02:00
|
|
|
import org.jivesoftware.smack.util.StringUtils;
|
|
|
|
import org.jivesoftware.smack.util.rce.RemoteConnectionEndpoint;
|
|
|
|
import org.jivesoftware.smack.util.rce.RemoteConnectionEndpointLookupFailure;
|
|
|
|
import org.jivesoftware.smack.util.rce.RemoteConnectionException;
|
2017-06-14 17:12:43 +02:00
|
|
|
|
2015-02-14 17:15:02 +01:00
|
|
|
import org.jxmpp.jid.Jid;
|
2014-03-12 11:50:05 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Smack uses SmackExceptions for errors that are not defined by any XMPP specification.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-03-12 11:50:05 +01:00
|
|
|
* @author Florian Schmaus
|
|
|
|
*/
|
2019-02-10 21:53:31 +01:00
|
|
|
public abstract class SmackException extends Exception {
|
2014-03-12 11:50:05 +01:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-03-12 11:50:05 +01:00
|
|
|
*/
|
2019-02-10 21:53:31 +01:00
|
|
|
private static final long serialVersionUID = 1844674365368214458L;
|
2014-03-12 11:50:05 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a new SmackException with the Throwable that was the root cause of the exception.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-03-12 11:50:05 +01:00
|
|
|
* @param wrappedThrowable the root cause of the exception.
|
|
|
|
*/
|
2019-02-10 21:39:48 +01:00
|
|
|
protected SmackException(Throwable wrappedThrowable) {
|
2014-03-12 11:50:05 +01:00
|
|
|
super(wrappedThrowable);
|
|
|
|
}
|
|
|
|
|
2019-02-10 21:39:48 +01:00
|
|
|
protected SmackException(String message) {
|
2014-03-12 11:50:05 +01:00
|
|
|
super(message);
|
|
|
|
}
|
|
|
|
|
2019-02-10 21:53:31 +01:00
|
|
|
protected SmackException(String message, Throwable wrappedThrowable) {
|
2014-03-12 11:50:05 +01:00
|
|
|
super(message, wrappedThrowable);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected SmackException() {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-03-31 14:17:30 +02:00
|
|
|
* Exception thrown always when there was no response to an request within the stanza reply timeout of the used
|
|
|
|
* connection instance. You can modify (e.g. increase) the stanza reply timeout with
|
2017-01-12 20:57:19 +01:00
|
|
|
* {@link XMPPConnection#setReplyTimeout(long)}.
|
2014-03-12 11:50:05 +01:00
|
|
|
*/
|
2015-04-06 10:45:12 +02:00
|
|
|
public static final class NoResponseException extends SmackException {
|
2014-03-12 11:50:05 +01:00
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-03-12 11:50:05 +01:00
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = -6523363748984543636L;
|
|
|
|
|
2015-02-26 18:41:17 +01:00
|
|
|
private final StanzaFilter filter;
|
2015-02-19 12:11:19 +01:00
|
|
|
|
2015-06-02 17:21:33 +02:00
|
|
|
private NoResponseException(String message) {
|
|
|
|
this(message, null);
|
|
|
|
}
|
|
|
|
|
2015-02-26 18:41:17 +01:00
|
|
|
private NoResponseException(String message, StanzaFilter filter) {
|
2015-02-19 12:11:19 +01:00
|
|
|
super(message);
|
|
|
|
this.filter = filter;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the filter that was used to collect the response.
|
|
|
|
*
|
|
|
|
* @return the used filter or <code>null</code>.
|
|
|
|
*/
|
2015-02-26 18:41:17 +01:00
|
|
|
public StanzaFilter getFilter() {
|
2015-02-19 12:11:19 +01:00
|
|
|
return filter;
|
|
|
|
}
|
|
|
|
|
2015-06-02 17:21:33 +02:00
|
|
|
public static NoResponseException newWith(XMPPConnection connection, String waitingFor) {
|
|
|
|
final StringBuilder sb = getWaitingFor(connection);
|
|
|
|
sb.append(" While waiting for ").append(waitingFor);
|
2020-04-04 13:03:31 +02:00
|
|
|
sb.append(" [").append(connection).append(']');
|
2015-06-02 17:21:33 +02:00
|
|
|
return new NoResponseException(sb.toString());
|
2015-02-19 12:11:19 +01:00
|
|
|
}
|
|
|
|
|
2019-03-05 08:21:59 +01:00
|
|
|
public static NoResponseException newWith(long timeout,
|
2019-02-04 08:59:39 +01:00
|
|
|
StanzaCollector collector, boolean stanzaCollectorCancelled) {
|
2019-03-14 18:23:33 +01:00
|
|
|
return newWith(timeout, collector.getStanzaFilter(), stanzaCollectorCancelled);
|
2014-03-12 11:50:05 +01:00
|
|
|
}
|
2015-02-19 12:11:19 +01:00
|
|
|
|
2015-02-26 18:41:17 +01:00
|
|
|
public static NoResponseException newWith(XMPPConnection connection, StanzaFilter filter) {
|
2019-03-14 18:23:33 +01:00
|
|
|
return newWith(connection.getReplyTimeout(), filter, false);
|
2019-02-04 08:59:39 +01:00
|
|
|
}
|
|
|
|
|
2019-03-14 18:23:33 +01:00
|
|
|
public static NoResponseException newWith(long timeout, StanzaFilter filter, boolean stanzaCollectorCancelled) {
|
2019-03-05 08:21:59 +01:00
|
|
|
final StringBuilder sb = getWaitingFor(timeout);
|
2019-02-04 08:59:39 +01:00
|
|
|
if (stanzaCollectorCancelled) {
|
|
|
|
sb.append(" StanzaCollector has been cancelled.");
|
|
|
|
}
|
2015-06-02 17:21:33 +02:00
|
|
|
sb.append(" Waited for response using: ");
|
2015-02-19 12:11:19 +01:00
|
|
|
if (filter != null) {
|
|
|
|
sb.append(filter.toString());
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
sb.append("No filter used or filter was 'null'");
|
|
|
|
}
|
|
|
|
sb.append('.');
|
|
|
|
return new NoResponseException(sb.toString(), filter);
|
|
|
|
}
|
|
|
|
|
2015-06-02 17:21:33 +02:00
|
|
|
private static StringBuilder getWaitingFor(XMPPConnection connection) {
|
2019-03-05 08:21:59 +01:00
|
|
|
return getWaitingFor(connection.getReplyTimeout());
|
|
|
|
}
|
|
|
|
|
|
|
|
private static StringBuilder getWaitingFor(final long replyTimeout) {
|
2015-06-02 17:21:33 +02:00
|
|
|
final StringBuilder sb = new StringBuilder(256);
|
|
|
|
sb.append("No response received within reply timeout. Timeout was "
|
|
|
|
+ replyTimeout + "ms (~"
|
|
|
|
+ replyTimeout / 1000 + "s).");
|
|
|
|
return sb;
|
|
|
|
}
|
2014-03-12 11:50:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static class NotLoggedInException extends SmackException {
|
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-03-12 11:50:05 +01:00
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 3216216839100019278L;
|
|
|
|
|
|
|
|
public NotLoggedInException() {
|
2014-10-05 17:00:13 +02:00
|
|
|
super("Client is not logged in");
|
2014-03-12 11:50:05 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class AlreadyLoggedInException extends SmackException {
|
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-03-12 11:50:05 +01:00
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 5011416918049935231L;
|
|
|
|
|
|
|
|
public AlreadyLoggedInException() {
|
2014-10-05 17:00:13 +02:00
|
|
|
super("Client is already logged in");
|
2014-03-12 11:50:05 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-11 09:49:16 +02:00
|
|
|
public static class AlreadyConnectedException extends SmackException {
|
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-09-11 09:49:16 +02:00
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 5011416918049135231L;
|
|
|
|
|
|
|
|
public AlreadyConnectedException() {
|
2014-10-05 17:00:13 +02:00
|
|
|
super("Client is already connected");
|
2014-09-11 09:49:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-12 11:50:05 +01:00
|
|
|
public static class NotConnectedException extends SmackException {
|
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-03-12 11:50:05 +01:00
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 9197980400776001173L;
|
|
|
|
|
|
|
|
public NotConnectedException() {
|
2015-07-29 08:20:46 +02:00
|
|
|
this(null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public NotConnectedException(String optionalHint) {
|
|
|
|
super("Client is not, or no longer, connected."
|
|
|
|
+ (optionalHint != null ? ' ' + optionalHint : ""));
|
2014-03-12 11:50:05 +01:00
|
|
|
}
|
2015-06-09 13:43:05 +02:00
|
|
|
|
|
|
|
public NotConnectedException(XMPPConnection connection, String details) {
|
|
|
|
super("The connection " + connection.toString() + " is no longer connected. "
|
|
|
|
+ details);
|
|
|
|
}
|
2015-07-03 12:57:30 +02:00
|
|
|
|
|
|
|
public NotConnectedException(XMPPConnection connection, StanzaFilter stanzaFilter) {
|
|
|
|
super("The connection " + connection
|
|
|
|
+ " is no longer connected while waiting for response with " + stanzaFilter);
|
|
|
|
}
|
2019-02-04 08:59:39 +01:00
|
|
|
|
|
|
|
public NotConnectedException(XMPPConnection connection, StanzaFilter stanzaFilter,
|
|
|
|
Exception connectionException) {
|
|
|
|
super("The connection " + connection + " is no longer connected while waiting for response with "
|
|
|
|
+ stanzaFilter + " because of " + connectionException, connectionException);
|
|
|
|
}
|
2014-03-12 11:50:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static class IllegalStateChangeException extends SmackException {
|
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-03-12 11:50:05 +01:00
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = -1766023961577168927L;
|
|
|
|
|
|
|
|
public IllegalStateChangeException() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-29 12:35:11 +02:00
|
|
|
public abstract static class SecurityRequiredException extends SmackException {
|
2014-03-12 11:50:05 +01:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-03-12 11:50:05 +01:00
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 384291845029773545L;
|
|
|
|
|
2014-09-11 09:49:16 +02:00
|
|
|
public SecurityRequiredException(String message) {
|
|
|
|
super(message);
|
|
|
|
}
|
2014-03-12 11:50:05 +01:00
|
|
|
}
|
|
|
|
|
2014-10-05 17:00:13 +02:00
|
|
|
public static class SecurityRequiredByClientException extends SecurityRequiredException {
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-10-05 17:00:13 +02:00
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 2395325821201543159L;
|
|
|
|
|
|
|
|
public SecurityRequiredByClientException() {
|
|
|
|
super("SSL/TLS required by client but not supported by server");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class SecurityRequiredByServerException extends SecurityRequiredException {
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-10-05 17:00:13 +02:00
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 8268148813117631819L;
|
|
|
|
|
|
|
|
public SecurityRequiredByServerException() {
|
|
|
|
super("SSL/TLS required by server but disabled in client");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-29 09:21:04 +02:00
|
|
|
public static class SecurityNotPossibleException extends SmackException {
|
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-05-29 09:21:04 +02:00
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = -6836090872690331336L;
|
|
|
|
|
|
|
|
public SecurityNotPossibleException(String message) {
|
|
|
|
super(message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-04 13:03:31 +02:00
|
|
|
public abstract static class ConnectionException extends SmackException {
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
protected ConnectionException(Throwable wrappedThrowable) {
|
|
|
|
super(wrappedThrowable);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected ConnectionException(String message) {
|
|
|
|
super(message);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final class GenericConnectionException extends ConnectionException {
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deprecated, do not use.
|
|
|
|
*
|
|
|
|
* @param wrappedThrowable the wrapped throwable.
|
|
|
|
*/
|
|
|
|
@Deprecated
|
|
|
|
public GenericConnectionException(Throwable wrappedThrowable) {
|
|
|
|
super(wrappedThrowable);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-06-17 11:00:05 +02:00
|
|
|
/**
|
2020-04-04 13:03:31 +02:00
|
|
|
* This exception is thrown if Smack is unable to connect to all hosts of a given XMPP
|
|
|
|
* service. The connection exceptions can be retrieved with
|
|
|
|
* {@link EndpointConnectionException#getConnectionExceptions()}, which will have the exception causing the
|
|
|
|
* connection failure set and retrievable with {@link RemoteConnectionException#getException()}.
|
2014-06-17 11:00:05 +02:00
|
|
|
*/
|
2020-04-04 13:03:31 +02:00
|
|
|
public static final class EndpointConnectionException extends ConnectionException {
|
2014-03-12 11:50:05 +01:00
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-03-12 11:50:05 +01:00
|
|
|
*/
|
2020-04-04 13:03:31 +02:00
|
|
|
private static final long serialVersionUID = 1;
|
2014-03-12 11:50:05 +01:00
|
|
|
|
2020-04-04 13:03:31 +02:00
|
|
|
private final List<RemoteConnectionEndpointLookupFailure> lookupFailures;
|
|
|
|
private final List<? extends RemoteConnectionException<?>> connectionExceptions;
|
2014-03-12 11:50:05 +01:00
|
|
|
|
2020-04-04 13:03:31 +02:00
|
|
|
private EndpointConnectionException(String message, List<RemoteConnectionEndpointLookupFailure> lookupFailures,
|
|
|
|
List<? extends RemoteConnectionException<?>> connectionExceptions) {
|
|
|
|
super(message);
|
|
|
|
// At least one list must contain an entry.
|
|
|
|
assert !lookupFailures.isEmpty() || !connectionExceptions.isEmpty();
|
|
|
|
this.lookupFailures = lookupFailures;
|
|
|
|
this.connectionExceptions = connectionExceptions;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static EndpointConnectionException from(List<RemoteConnectionEndpointLookupFailure> lookupFailures,
|
|
|
|
List<? extends RemoteConnectionException<?>> connectionExceptions) {
|
|
|
|
StringBuilder sb = new StringBuilder(256);
|
|
|
|
|
|
|
|
if (!lookupFailures.isEmpty()) {
|
|
|
|
sb.append("Could not lookup the following endpoints: ");
|
|
|
|
StringUtils.appendTo(lookupFailures, sb);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!connectionExceptions.isEmpty()) {
|
|
|
|
sb.append("The following addresses failed: ");
|
|
|
|
StringUtils.appendTo(connectionExceptions, sb, rce -> sb.append(rce.getErrorMessage()));
|
|
|
|
}
|
|
|
|
|
|
|
|
return new EndpointConnectionException(sb.toString(), lookupFailures, connectionExceptions);
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<RemoteConnectionEndpointLookupFailure> getLookupFailures() {
|
|
|
|
return lookupFailures;
|
2014-03-12 11:50:05 +01:00
|
|
|
}
|
|
|
|
|
2020-04-04 13:03:31 +02:00
|
|
|
public List<? extends RemoteConnectionException<? extends RemoteConnectionEndpoint>> getConnectionExceptions() {
|
|
|
|
return connectionExceptions;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final class NoEndpointsDiscoveredException extends ConnectionException {
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
private final List<LookupConnectionEndpointsFailed> lookupFailures;
|
|
|
|
|
|
|
|
private NoEndpointsDiscoveredException(String message, List<LookupConnectionEndpointsFailed> lookupFailures) {
|
2014-09-24 13:34:25 +02:00
|
|
|
super(message);
|
2020-04-04 13:03:31 +02:00
|
|
|
this.lookupFailures = Collections.unmodifiableList(lookupFailures);
|
2014-03-12 11:50:05 +01:00
|
|
|
}
|
|
|
|
|
2020-04-04 13:03:31 +02:00
|
|
|
public List<LookupConnectionEndpointsFailed> getLookupFailures() {
|
|
|
|
return lookupFailures;
|
2014-09-24 13:34:25 +02:00
|
|
|
}
|
|
|
|
|
2020-04-04 13:03:31 +02:00
|
|
|
public static NoEndpointsDiscoveredException from(List<LookupConnectionEndpointsFailed> lookupFailures) {
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
|
|
|
if (lookupFailures.isEmpty()) {
|
|
|
|
sb.append("No endpoint lookup finished within the timeout");
|
|
|
|
} else {
|
2020-07-28 19:00:04 +02:00
|
|
|
sb.append("No endpoints could be discovered due the following lookup failures: ");
|
2020-04-04 13:03:31 +02:00
|
|
|
StringUtils.appendTo(lookupFailures, sb);
|
|
|
|
}
|
|
|
|
|
|
|
|
return new NoEndpointsDiscoveredException(sb.toString(), lookupFailures);
|
2014-03-12 11:50:05 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class FeatureNotSupportedException extends SmackException {
|
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-03-12 11:50:05 +01:00
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 4713404802621452016L;
|
|
|
|
|
2014-03-17 21:06:45 +01:00
|
|
|
private final String feature;
|
2015-02-14 17:15:02 +01:00
|
|
|
private final Jid jid;
|
2014-03-17 21:06:45 +01:00
|
|
|
|
|
|
|
public FeatureNotSupportedException(String feature) {
|
|
|
|
this(feature, null);
|
|
|
|
}
|
|
|
|
|
2015-02-14 17:15:02 +01:00
|
|
|
public FeatureNotSupportedException(String feature, Jid jid) {
|
2014-03-17 21:06:45 +01:00
|
|
|
super(feature + " not supported" + (jid == null ? "" : " by '" + jid + "'"));
|
|
|
|
this.jid = jid;
|
|
|
|
this.feature = feature;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the feature which is not supported.
|
|
|
|
*
|
|
|
|
* @return the feature which is not supported
|
|
|
|
*/
|
|
|
|
public String getFeature() {
|
|
|
|
return feature;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get JID which does not support the feature. The JID can be null in cases when there are
|
|
|
|
* multiple JIDs queried for this feature.
|
|
|
|
*
|
|
|
|
* @return the JID which does not support the feature, or null
|
|
|
|
*/
|
2015-02-14 17:15:02 +01:00
|
|
|
public Jid getJid() {
|
2014-03-17 21:06:45 +01:00
|
|
|
return jid;
|
2014-03-12 11:50:05 +01:00
|
|
|
}
|
|
|
|
}
|
2014-03-17 21:06:45 +01:00
|
|
|
|
|
|
|
public static class ResourceBindingNotOfferedException extends SmackException {
|
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-03-17 21:06:45 +01:00
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 2346934138253437571L;
|
|
|
|
|
2014-10-05 17:00:13 +02:00
|
|
|
public ResourceBindingNotOfferedException() {
|
|
|
|
super("Resource binding was not offered by server");
|
|
|
|
}
|
2014-03-17 21:06:45 +01:00
|
|
|
}
|
2019-02-07 20:43:45 +01:00
|
|
|
|
2019-02-10 21:55:07 +01:00
|
|
|
/**
|
|
|
|
* A Smack exception wrapping another exception. Note that usage of this class is consider bad practice. This class
|
|
|
|
* will eventually be marked deprecated and removed.
|
|
|
|
*/
|
2019-02-07 20:43:45 +01:00
|
|
|
public static class SmackWrappedException extends SmackException {
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
public SmackWrappedException(Exception exception) {
|
|
|
|
super(exception);
|
|
|
|
}
|
2019-02-10 21:39:48 +01:00
|
|
|
|
|
|
|
public SmackWrappedException(String message, Exception exception) {
|
|
|
|
super(message, exception);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-10 21:55:07 +01:00
|
|
|
/**
|
|
|
|
* A Smack exception wrapping a text message. Note that usage of this class is consider bad practice. This class
|
|
|
|
* will eventually be marked deprecated and removed.
|
|
|
|
*/
|
2019-02-10 21:39:48 +01:00
|
|
|
public static class SmackMessageException extends SmackException {
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
public SmackMessageException(String message) {
|
|
|
|
super(message);
|
|
|
|
}
|
2019-02-07 20:43:45 +01:00
|
|
|
}
|
2019-02-10 19:50:46 +01:00
|
|
|
|
|
|
|
public static class SmackSaslException extends SmackException {
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
public SmackSaslException(Exception exception) {
|
|
|
|
super(exception);
|
|
|
|
}
|
|
|
|
|
|
|
|
public SmackSaslException(String message) {
|
|
|
|
super(message);
|
|
|
|
}
|
|
|
|
|
|
|
|
public SmackSaslException(String message, Exception exception) {
|
|
|
|
super(message, exception);
|
|
|
|
}
|
|
|
|
}
|
2020-05-26 21:39:08 +02:00
|
|
|
|
|
|
|
public static class SmackCertificateException extends SmackException {
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
private final CertificateException certificateException;
|
|
|
|
|
|
|
|
public SmackCertificateException(CertificateException certificateException) {
|
|
|
|
this.certificateException = certificateException;
|
|
|
|
}
|
|
|
|
|
|
|
|
public CertificateException getCertificateException() {
|
|
|
|
return certificateException;
|
|
|
|
}
|
|
|
|
}
|
2014-03-12 11:50:05 +01:00
|
|
|
}
|