Smack

org.jivesoftware.smack.packet
Class XMPPError

java.lang.Object
  extended by org.jivesoftware.smack.packet.XMPPError

public class XMPPError
extends Object

Represents a XMPP error sub-packet. Typically, a server responds to a request that has problems by sending the packet back and including an error packet. Each error has a code as well as as an optional text explanation. Typical error codes are as follows:

CodeDescription
302 Redirect
400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Not Allowed
406 Not Acceptable
407 Registration Required
408 Request Timeout
409 Conflict
500 Internal Server XMPPError
501 Not Implemented
502 Remote Server Error
503 Service Unavailable
504 Remote Server Timeout

Author:
Matt Tucker

Constructor Summary
XMPPError(int code)
          Creates a new error with the specified code and no message..
XMPPError(int code, String message)
          Creates a new error with the specified code and message.
 
Method Summary
 int getCode()
          Returns the error code.
 String getMessage()
          Returns the message describing the error, or null if there is no message.
 String toString()
           
 String toXML()
          Returns the error as XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMPPError

public XMPPError(int code)
Creates a new error with the specified code and no message..

Parameters:
code - the error code.

XMPPError

public XMPPError(int code,
                 String message)
Creates a new error with the specified code and message.

Parameters:
code - the error code.
message - a message describing the error.
Method Detail

getCode

public int getCode()
Returns the error code.

Returns:
the error code.

getMessage

public String getMessage()
Returns the message describing the error, or null if there is no message.

Returns:
the message describing the error, or null if there is no message.

toXML

public String toXML()
Returns the error as XML.

Returns:
the error as XML.

toString

public String toString()
Overrides:
toString in class Object

Smack

Copyright © 2003 Jive Software.