public class XMPPError
extends java.lang.Object
Code | XMPP Error | Type |
500 | interna-server-error | WAIT |
403 | forbidden | AUTH |
400 | bad-requestMODIFY | >|
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 |
Modifier and Type | Class and Description |
---|---|
static class |
XMPPError.Condition
A class to represent predefined error conditions.
|
static class |
XMPPError.Type
A class to represent the type of the Error.
|
Constructor and Description |
---|
XMPPError(int code)
Deprecated.
new errors should be created using the constructor XMPPError(condition)
|
XMPPError(int code,
java.lang.String message)
Deprecated.
new errors should be created using the constructor XMPPError(condition, message)
|
XMPPError(int code,
XMPPError.Type type,
java.lang.String condition,
java.lang.String message,
java.util.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,
java.lang.String messageText)
Creates a new error with the specified condition and message infering the type and code.
|
Modifier and Type | Method and Description |
---|---|
void |
addExtension(PacketExtension extension)
Adds a packet extension to the error.
|
int |
getCode()
Returns the error code.
|
java.lang.String |
getCondition()
Returns the error condition.
|
PacketExtension |
getExtension(java.lang.String elementName,
java.lang.String namespace)
Returns the first patcket extension that matches the specified element name and
namespace, or null if it doesn't exist.
|
java.util.List<PacketExtension> |
getExtensions()
Returns an Iterator for the error extensions attached to the xmppError.
|
java.lang.String |
getMessage()
Returns the message describing the error, or null if there is no message.
|
XMPPError.Type |
getType()
Returns the error type.
|
void |
setExtension(java.util.List<PacketExtension> extension)
Set the packet extension to the error.
|
java.lang.String |
toString() |
java.lang.String |
toXML()
Returns the error as XML.
|
public XMPPError(XMPPError.Condition condition)
condition
- the error condition.public XMPPError(XMPPError.Condition condition, java.lang.String messageText)
condition
- the error condition.messageText
- a message describing the error.public XMPPError(int code)
code
- the error code.public XMPPError(int code, java.lang.String message)
code
- the error code.message
- a message describing the error.public XMPPError(int code, XMPPError.Type type, java.lang.String condition, java.lang.String message, java.util.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 extensionspublic java.lang.String getCondition()
public XMPPError.Type getType()
public int getCode()
public java.lang.String getMessage()
public java.lang.String toXML()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<PacketExtension> getExtensions()
public PacketExtension getExtension(java.lang.String elementName, java.lang.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(java.util.List<PacketExtension> extension)
extension
- a packet extension.Copyright © 2003-2007 Jive Software.