导航菜单

页面标题

页面副标题

Housing v14.7.8 - XMPPException.java 源代码

正在查看: Housing v14.7.8 应用的 XMPPException.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package org.jivesoftware.smack;

import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.packet.StreamError;
import org.jivesoftware.smack.packet.XMPPError;

public abstract class XMPPException extends Exception {
    private static final long serialVersionUID = 6881651633890968625L;

    public static class StreamErrorException extends XMPPException {
        private static final long serialVersionUID = 3400556867134848886L;
        private final StreamError streamError;

        public StreamErrorException(StreamError streamError) {
            super(streamError.getCondition().toString() + " You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions\n" + streamError.toString());
            this.streamError = streamError;
        }

        public StreamError getStreamError() {
            return this.streamError;
        }
    }

    public static class XMPPErrorException extends XMPPException {
        private static final long serialVersionUID = 212790389529249604L;
        private final XMPPError error;

        public XMPPErrorException(String str, XMPPError xMPPError) {
            super(str);
            this.error = xMPPError;
        }

        public static void ifHasErrorThenThrow(Stanza stanza) throws XMPPErrorException {
            XMPPError error = stanza.getError();
            if (error != null) {
                throw new XMPPErrorException(error);
            }
        }

        @Override
        public String getMessage() {
            String message = super.getMessage();
            return message != null ? message : this.error.toString();
        }

        public XMPPError getXMPPError() {
            return this.error;
        }

        public XMPPErrorException(String str, XMPPError xMPPError, Throwable th) {
            super(str, th);
            this.error = xMPPError;
        }

        public XMPPErrorException(XMPPError xMPPError) {
            this.error = xMPPError;
        }
    }

    public XMPPException() {
    }

    public XMPPException(String str) {
        super(str);
    }

    public XMPPException(String str, Throwable th) {
        super(str, th);
    }
}