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
public class StanzaError extends AbstractError implements ExtensionElement
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 Errors 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
Nested Classes Modifier and Type Class Description static classStanzaError.Builderstatic classStanzaError.Conditionstatic classStanzaError.TypeA class to represent the type of the Error.
-
Field Summary
Fields Modifier and Type Field Description static StringERRORstatic StringERROR_CONDITION_AND_TEXT_NAMESPACEstatic StringNAMESPACEDeprecated.static QNameQNAME-
Fields inherited from class org.jivesoftware.smack.packet.AbstractError
descriptiveTexts, extensions, textNamespace
-
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StanzaError.Builderfrom(StanzaError.Condition condition, String descriptiveText)static StanzaError.BuildergetBuilder()static StanzaError.BuildergetBuilder(StanzaError xmppError)static StanzaError.BuildergetBuilder(StanzaError.Condition condition)StanzaError.ConditiongetCondition()Returns the error condition.StringgetConditionText()StringgetElementName()Returns the root element name.StringgetErrorGenerator()StringgetNamespace()Returns the root element XML namespace.StanzaError.TypegetType()Returns the error type.StringtoString()XmlStringBuildertoXML(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 Detail
-
ERROR_CONDITION_AND_TEXT_NAMESPACE
public static final String ERROR_CONDITION_AND_TEXT_NAMESPACE
- See Also:
- Constant Field Values
-
NAMESPACE
@Deprecated public static final String NAMESPACE
Deprecated.TODO describe me.- See Also:
- Constant Field Values
-
ERROR
public static final String ERROR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
getCondition
public StanzaError.Condition getCondition()
Returns the error condition.- Returns:
- the error condition.
-
getType
public StanzaError.Type getType()
Returns the error type.- Returns:
- the error type.
-
getErrorGenerator
public String getErrorGenerator()
-
getConditionText
public String getConditionText()
-
getElementName
public String getElementName()
Description copied from interface:NamedElementReturns the root element name.- Specified by:
getElementNamein interfaceNamedElement- Returns:
- the element name.
-
getNamespace
public String getNamespace()
Description copied from interface:XmlElementReturns the root element XML namespace.- Specified by:
getNamespacein interfaceXmlElement- Returns:
- the namespace.
-
toXML
public XmlStringBuilder toXML(XmlEnvironment enclosingNamespace)
-
from
public static StanzaError.Builder from(StanzaError.Condition condition, String descriptiveText)
-
getBuilder
public static StanzaError.Builder getBuilder()
-
getBuilder
public static StanzaError.Builder getBuilder(StanzaError.Condition condition)
-
getBuilder
public static StanzaError.Builder getBuilder(StanzaError xmppError)
-
-