2014-03-12 11:50:05 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Copyright 2014 Florian Schmaus
|
|
|
|
*
|
|
|
|
* 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.sasl;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import org.jivesoftware.smack.XMPPException;
|
2019-09-24 23:32:08 +02:00
|
|
|
import org.jivesoftware.smack.sasl.packet.SaslNonza.SASLFailure;
|
2014-03-12 11:50:05 +01:00
|
|
|
|
|
|
|
public class SASLErrorException extends XMPPException {
|
|
|
|
|
|
|
|
/**
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2014-03-12 11:50:05 +01:00
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 6247573875760717257L;
|
|
|
|
|
|
|
|
private final SASLFailure saslFailure;
|
|
|
|
private final String mechanism;
|
2019-05-17 21:56:46 +02:00
|
|
|
private final Map<String, String> texts;
|
2014-03-12 11:50:05 +01:00
|
|
|
|
|
|
|
public SASLErrorException(String mechanism, SASLFailure saslFailure) {
|
2014-04-05 18:40:48 +02:00
|
|
|
this(mechanism, saslFailure, new HashMap<String, String>());
|
2014-03-12 11:50:05 +01:00
|
|
|
}
|
2014-04-05 18:40:48 +02:00
|
|
|
|
2019-05-17 21:56:46 +02:00
|
|
|
public SASLErrorException(String mechanism, SASLFailure saslFailure, Map<String, String> texts) {
|
2014-04-05 18:40:48 +02:00
|
|
|
super("SASLError using " + mechanism + ": " + saslFailure.getSASLErrorString());
|
2014-03-12 11:50:05 +01:00
|
|
|
this.mechanism = mechanism;
|
|
|
|
this.saslFailure = saslFailure;
|
|
|
|
this.texts = texts;
|
|
|
|
}
|
|
|
|
|
|
|
|
public SASLFailure getSASLFailure() {
|
|
|
|
return saslFailure;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getMechanism() {
|
|
|
|
return mechanism;
|
|
|
|
}
|
|
|
|
|
2019-05-17 21:56:46 +02:00
|
|
|
public Map<String, String> getTexts() {
|
2014-03-12 11:50:05 +01:00
|
|
|
return texts;
|
|
|
|
}
|
|
|
|
}
|