Package org.jivesoftware.smack.packet
Class StanzaError
java.lang.Object
org.jivesoftware.smack.packet.AbstractError
org.jivesoftware.smack.packet.StanzaError
- All Implemented Interfaces:
Element
,ExtensionElement
,NamedElement
,XmlElement
,XmlLangElement
Represents an XMPP error sub-packet. Typically, a server responds to a request that has
problems by sending the stanza back and including an error packet. Each error has a type,
error condition as well as as an optional text explanation. Typical errors are:
XMPP Error Condition | Type | RFC 6120 Section |
---|---|---|
bad-request | MODIFY | 8.3.3.1 |
conflict | CANCEL | 8.3.3.2 |
feature-not-implemented | CANCEL | 8.3.3.3 |
forbidden | AUTH | 8.3.3.4 |
gone | CANCEL | 8.3.3.5 |
internal-server-error | WAIT | 8.3.3.6 |
item-not-found | CANCEL | 8.3.3.7 |
jid-malformed | MODIFY | 8.3.3.8 |
not-acceptable | MODIFY | 8.3.3.9 |
not-allowed | CANCEL | 8.3.3.10 |
not-authorized | AUTH | 8.3.3.11 |
policy-violation | MODIFY | 8.3.3.12 |
recipient-unavailable | WAIT | 8.3.3.13 |
redirect | MODIFY | 8.3.3.14 |
registration-required | AUTH | 8.3.3.15 |
remote-server-not-found | CANCEL | 8.3.3.16 |
remote-server-timeout | WAIT | 8.3.3.17 |
resource-constraint | WAIT | 8.3.3.18 |
service-unavailable | CANCEL | 8.3.3.19 |
subscription-required | AUTH | 8.3.3.20 |
undefined-condition | MODIFY | 8.3.3.21 |
unexpected-request | WAIT | 8.3.3.22 |
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static enum
static enum
A class to represent the type of the Error. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
Deprecated.static final QName
Fields inherited from class org.jivesoftware.smack.packet.AbstractError
descriptiveTexts, extensions, textNamespace
-
Constructor Summary
ConstructorDescriptionStanzaError
(StanzaError.Condition condition, String conditionText, String errorGenerator, StanzaError.Type type, Map<String, String> descriptiveTexts, List<XmlElement> extensions) Creates a new error with the specified type, condition and message. -
Method Summary
Modifier and TypeMethodDescriptionstatic StanzaError.Builder
from
(StanzaError.Condition condition, String descriptiveText) static StanzaError.Builder
static StanzaError.Builder
getBuilder
(StanzaError xmppError) static StanzaError.Builder
getBuilder
(StanzaError.Condition condition) Returns the error condition.Returns the root element name.Returns the root element XML namespace.getType()
Returns the error type.toString()
toXML
(XmlEnvironment enclosingNamespace) Methods inherited from class org.jivesoftware.smack.packet.AbstractError
addDescriptiveTextsAndExtensions, getDescriptiveText, getDescriptiveText, getExtension
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getQName
-
Field Details
-
ERROR_CONDITION_AND_TEXT_NAMESPACE
- See Also:
-
NAMESPACE
Deprecated.TODO describe me.- See Also:
-
ERROR
- See Also:
-
QNAME
-
-
Constructor Details
-
StanzaError
public StanzaError(StanzaError.Condition condition, String conditionText, String errorGenerator, StanzaError.Type type, Map<String, String> descriptiveTexts, List<XmlElement> extensions) Creates a new error with the specified type, condition and message. This constructor is used when the condition is not recognized automatically by XMPPError i.e. there is not a defined instance of ErrorCondition or it does not apply the default specification.- Parameters:
type
- the error type.condition
- the error condition.conditionText
- TODO javadoc me pleaseerrorGenerator
- TODO javadoc me pleasedescriptiveTexts
- TODO javadoc me pleaseextensions
- list of stanza extensions
-
-
Method Details
-
getCondition
Returns the error condition.- Returns:
- the error condition.
-
getType
Returns the error type.- Returns:
- the error type.
-
getErrorGenerator
-
getConditionText
-
toString
-
getElementName
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
Description copied from interface:XmlElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceXmlElement
- Returns:
- the namespace.
-
toXML
-
from
-
getBuilder
-
getBuilder
-
getBuilder
-