public class XMPPError extends Object
XMPP Error | Type |
internal-server-error | WAIT |
forbidden | AUTH |
bad-request | MODIFY |
item-not-found | CANCEL |
conflict | CANCEL |
feature-not-implemented | CANCEL |
gone | MODIFY |
jid-malformed | MODIFY |
not-acceptable | MODIFY |
not-allowed | CANCEL |
not-authorized | AUTH |
payment-required | AUTH |
recipient-unavailable | WAIT |
redirect | MODIFY |
registration-required | AUTH |
remote-server-not-found | CANCEL |
remote-server-timeout | WAIT |
remote-server-error | CANCEL |
resource-constraint | WAIT |
service-unavailable | CANCEL |
subscription-required | AUTH |
undefined-condition | WAIT |
unexpected-condition | WAIT |
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(XMPPError.Condition condition)
Creates a new error with the specified condition inferring the type.
|
XMPPError(XMPPError.Condition condition,
String messageText)
Creates a new error with the specified condition and message infering the type.
|
XMPPError(XMPPError.Type type,
String condition,
String message,
List<PacketExtension> extension)
Creates a new error with the specified type, condition and message.
|
Modifier and Type | Method and Description |
---|---|
void |
addExtension(PacketExtension extension)
Adds a packet extension to the error.
|
String |
getCondition()
Returns the error condition.
|
PacketExtension |
getExtension(String elementName,
String namespace)
Returns the first packet extension that matches the specified element name and
namespace, or null if it doesn't exist.
|
List<PacketExtension> |
getExtensions()
Returns a List of 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() |
CharSequence |
toXML()
Returns the error as XML.
|
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(XMPPError.Type type, String condition, String message, List<PacketExtension> extension)
type
- the error type.condition
- the error condition.message
- a message describing the error.extension
- list of packet extensionspublic String getCondition()
public XMPPError.Type getType()
public String getMessage()
public CharSequence toXML()
public 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.