| 
 | Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jivesoftware.smack.packet.XMPPError
public class XMPPError
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, type, error condition as well as as an optional text explanation. Typical errors are:
| Code | XMPP Error | Type | 
| 500 | interna-server-error | WAIT | 
| 403 | forbidden | AUTH | 
| 400bad-request | MODIFY> | |
| 404 | item-not-found | CANCEL | 
| 409 | conflict | CANCEL | 
| 501 | feature-not-implemented | CANCEL | 
| 302 | gone | MODIFY | 
| 400 | jid-malformed | MODIFY | 
| 406 | no-acceptable | MODIFY | 
| 405 | not-allowed | CANCEL | 
| 401 | not-authorized | AUTH | 
| 402 | payment-required | AUTH | 
| 404 | recipient-unavailable | WAIT | 
| 302 | redirect | MODIFY | 
| 407 | registration-required | AUTH | 
| 404 | remote-server-not-found | CANCEL | 
| 504 | remote-server-timeout | WAIT | 
| 502 | remote-server-error | CANCEL | 
| 500 | resource-constraint | WAIT | 
| 503 | service-unavailable | CANCEL | 
| 407 | subscription-required | AUTH | 
| 500 | undefined-condition | WAIT | 
| 400 | unexpected-condition | WAIT | 
| 408 | request-timeout | CANCEL | 
| Nested Class Summary | |
|---|---|
| static class | XMPPError.ConditionA class to represent predefined error conditions. | 
| static class | XMPPError.TypeA class to represent the type of the Error. | 
| Constructor Summary | |
|---|---|
| XMPPError(int code)Deprecated. new errors should be created using the constructor XMPPError(condition) | |
| XMPPError(int code,
          String message)Deprecated. new errors should be created using the constructor XMPPError(condition, message) | |
| XMPPError(int code,
          XMPPError.Type type,
          String condition,
          String message,
          List<PacketExtension> extension)Creates a new error with the specified code, type, condition and message. | |
| XMPPError(XMPPError.Condition condition)Creates a new error with the specified condition infering the type and code. | |
| XMPPError(XMPPError.Condition condition,
          String messageText)Creates a new error with the specified condition and message infering the type and code. | |
| Method Summary | |
|---|---|
|  void | addExtension(PacketExtension extension)Adds a packet extension to the error. | 
|  int | getCode()Returns the error code. | 
|  String | getCondition()Returns the error condition. | 
|  PacketExtension | getExtension(String elementName,
             String namespace)Returns the first patcket extension that matches the specified element name and namespace, or null if it doesn't exist. | 
|  List<PacketExtension> | getExtensions()Returns an Iterator for the error extensions attached to the xmppError. | 
|  String | getMessage()Returns the message describing the error, or null if there is no message. | 
|  XMPPError.Type | getType()Returns the error type. | 
|  void | setExtension(List<PacketExtension> extension)Set the packet extension to the error. | 
|  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 | 
|---|
public XMPPError(XMPPError.Condition condition)
condition - the error condition.
public XMPPError(XMPPError.Condition condition,
                 String messageText)
condition - the error condition.messageText - a message describing the error.public XMPPError(int code)
code - the error code.
public XMPPError(int code,
                 String message)
code - the error code.message - a message describing the error.
public XMPPError(int code,
                 XMPPError.Type type,
                 String condition,
                 String message,
                 List<PacketExtension> extension)
code - the error code.type - the error type.condition - the error condition.message - a message describing the error.extension - list of packet extensions| Method Detail | 
|---|
public String getCondition()
public XMPPError.Type getType()
public int getCode()
public String getMessage()
public String toXML()
public String toString()
toString in class Objectpublic List<PacketExtension> getExtensions()
public PacketExtension getExtension(String elementName,
                                    String namespace)
elementName - the XML element name of the packet extension.namespace - the XML element namespace of the packet extension.
public void addExtension(PacketExtension extension)
extension - a packet extension.public void setExtension(List<PacketExtension> extension)
extension - a packet extension.| 
 | Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||