Smack

org.jivesoftware.smack
Class XMPPException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.jivesoftware.smack.XMPPException
All Implemented Interfaces:
Serializable

public class XMPPException
extends Exception

A generic exception that is thrown when an error occurs performing an XMPP operation. XMPP servers can respond to error conditions with an error code and textual description of the problem, which are encapsulated in the XMPPError class. When appropriate, an XMPPError instance is attached instances of this exception.

When a stream error occured, the server will send a stream error to the client before closing the connection. Stream errors are unrecoverable errors. When a stream error is sent to the client an XMPPException will be thrown containing the StreamError sent by the server.

Author:
Matt Tucker
See Also:
XMPPError, Serialized Form

Constructor Summary
XMPPException()
          Creates a new XMPPException.
XMPPException(StreamError streamError)
          Cretaes a new XMPPException with the stream error that was the root case of the exception.
XMPPException(String message)
          Creates a new XMPPException with a description of the exception.
XMPPException(String message, Throwable wrappedThrowable)
          Creates a new XMPPException with a description of the exception and the Throwable that was the root cause of the exception.
XMPPException(String message, XMPPError error)
          Creates a new XMPPException with a description of the exception and the XMPPException that was the root cause of the exception.
XMPPException(String message, XMPPError error, Throwable wrappedThrowable)
          Creates a new XMPPException with a description of the exception, an XMPPError, and the Throwable that was the root cause of the exception.
XMPPException(Throwable wrappedThrowable)
          Creates a new XMPPException with the Throwable that was the root cause of the exception.
XMPPException(XMPPError error)
          Cretaes a new XMPPException with the XMPPError that was the root case of the exception.
 
Method Summary
 String getMessage()
           
 StreamError getStreamError()
          Returns the StreamError asscociated with this exception, or null if there isn't one.
 Throwable getWrappedThrowable()
          Returns the Throwable asscociated with this exception, or null if there isn't one.
 XMPPError getXMPPError()
          Returns the XMPPError asscociated with this exception, or null if there isn't one.
 void printStackTrace()
           
 void printStackTrace(PrintStream out)
           
 void printStackTrace(PrintWriter out)
           
 String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMPPException

public XMPPException()
Creates a new XMPPException.


XMPPException

public XMPPException(String message)
Creates a new XMPPException with a description of the exception.

Parameters:
message - description of the exception.

XMPPException

public XMPPException(Throwable wrappedThrowable)
Creates a new XMPPException with the Throwable that was the root cause of the exception.

Parameters:
wrappedThrowable - the root cause of the exception.

XMPPException

public XMPPException(StreamError streamError)
Cretaes a new XMPPException with the stream error that was the root case of the exception. When a stream error is received from the server then the underlying TCP connection will be closed by the server.

Parameters:
streamError - the root cause of the exception.

XMPPException

public XMPPException(XMPPError error)
Cretaes a new XMPPException with the XMPPError that was the root case of the exception.

Parameters:
error - the root cause of the exception.

XMPPException

public XMPPException(String message,
                     Throwable wrappedThrowable)
Creates a new XMPPException with a description of the exception and the Throwable that was the root cause of the exception.

Parameters:
message - a description of the exception.
wrappedThrowable - the root cause of the exception.

XMPPException

public XMPPException(String message,
                     XMPPError error,
                     Throwable wrappedThrowable)
Creates a new XMPPException with a description of the exception, an XMPPError, and the Throwable that was the root cause of the exception.

Parameters:
message - a description of the exception.
error - the root cause of the exception.
wrappedThrowable - the root cause of the exception.

XMPPException

public XMPPException(String message,
                     XMPPError error)
Creates a new XMPPException with a description of the exception and the XMPPException that was the root cause of the exception.

Parameters:
message - a description of the exception.
error - the root cause of the exception.
Method Detail

getXMPPError

public XMPPError getXMPPError()
Returns the XMPPError asscociated with this exception, or null if there isn't one.

Returns:
the XMPPError asscociated with this exception.

getStreamError

public StreamError getStreamError()
Returns the StreamError asscociated with this exception, or null if there isn't one. The underlying TCP connection is closed by the server after sending the stream error to the client.

Returns:
the StreamError asscociated with this exception.

getWrappedThrowable

public Throwable getWrappedThrowable()
Returns the Throwable asscociated with this exception, or null if there isn't one.

Returns:
the Throwable asscociated with this exception.

printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream out)
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintWriter out)
Overrides:
printStackTrace in class Throwable

getMessage

public String getMessage()
Overrides:
getMessage in class Throwable

toString

public String toString()
Overrides:
toString in class Throwable

Smack

Copyright © 2003-2007 Jive Software.