Package org.jivesoftware.smack.packet
Class StreamError
- java.lang.Object
-
- org.jivesoftware.smack.packet.AbstractError
-
- org.jivesoftware.smack.packet.StreamError
-
- All Implemented Interfaces:
Element
,FullyQualifiedElement
,NamedElement
,Nonza
,TopLevelStreamElement
,XmlLangElement
public class StreamError extends AbstractError implements Nonza
Represents a stream error packet. Stream errors are unrecoverable errors where the server will close the underlying TCP connection after the stream error was sent to the client. These is the list of stream errors as defined in the XMPP spec:Stream Errors Code Description bad-format the entity has sent XML that cannot be processed unsupported-encoding the entity has sent a namespace prefix that is unsupported bad-namespace-prefix Remote Server Timeout conflict the server is closing the active stream for this entity because a new stream has been initiated that conflicts with the existing stream. connection-timeout the entity has not generated any traffic over the stream for some period of time. host-gone the value of the 'to' attribute provided by the initiating entity in the stream header corresponds to a hostname that is no longer hosted by the server. host-unknown the value of the 'to' attribute provided by the initiating entity in the stream header does not correspond to a hostname that is hosted by the server. improper-addressing a stanza sent between two servers lacks a 'to' or 'from' attribute internal-server-error the server has experienced a misconfiguration. invalid-from the JID or hostname provided in a 'from' address does not match an authorized JID. invalid-namespace the streams namespace name is invalid. invalid-xml the entity has sent invalid XML over the stream. not-authorized the entity has attempted to send data before the stream has been authenticated policy-violation the entity has violated some local service policy. remote-connection-failed Rthe server is unable to properly connect to a remote entity. resource-constraint Rthe server lacks the system resources necessary to service the stream. restricted-xml the entity has attempted to send restricted XML features. see-other-host the server will not provide service to the initiating entity but is redirecting traffic to another host. system-shutdown the server is being shut down and all active streams are being closed. undefined-condition the error condition is not one of those defined by the other conditions in this list. unsupported-encoding the initiating entity has encoded the stream in an encoding that is not supported. unsupported-stanza-type the initiating entity has sent a first-level child of the stream that is not supported. unsupported-version the value of the 'version' attribute provided by the initiating entity in the stream header specifies a version of XMPP that is not supported. not-well-formed the initiating entity has sent XML that is not well-formed. Stream error syntax:
<stream:error> <defined-condition xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> [<text xmlns='urn:ietf:params:xml:ns:xmpp-streams' xml:lang='langcode'> OPTIONAL descriptive text </text>] [OPTIONAL application-specific condition element] </stream:error>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StreamError.Condition
The defined stream error conditions, see RFC 6120 ยง 4.9.3.-
Nested classes/interfaces inherited from class org.jivesoftware.smack.packet.AbstractError
AbstractError.Builder<B extends AbstractError.Builder<B>>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ELEMENT
static java.lang.String
NAMESPACE
-
Fields inherited from class org.jivesoftware.smack.packet.AbstractError
descriptiveTexts, extensions, textNamespace
-
-
Constructor Summary
Constructors Constructor Description StreamError(StreamError.Condition condition, java.lang.String conditionText, java.util.Map<java.lang.String,java.lang.String> descriptiveTexts, java.util.List<ExtensionElement> extensions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamError.Condition
getCondition()
java.lang.String
getConditionText()
java.lang.String
getElementName()
Returns the root element name.java.lang.String
getNamespace()
Returns the root element XML namespace.java.lang.String
toString()
XmlStringBuilder
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.FullyQualifiedElement
getLanguage, getQName
-
-
-
-
Field Detail
-
ELEMENT
public static final java.lang.String ELEMENT
- See Also:
- Constant Field Values
-
NAMESPACE
public static final java.lang.String NAMESPACE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StreamError
public StreamError(StreamError.Condition condition, java.lang.String conditionText, java.util.Map<java.lang.String,java.lang.String> descriptiveTexts, java.util.List<ExtensionElement> extensions)
-
-
Method Detail
-
getCondition
public StreamError.Condition getCondition()
-
getConditionText
public java.lang.String getConditionText()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toXML
public XmlStringBuilder toXML(XmlEnvironment enclosingNamespace)
-
getNamespace
public java.lang.String getNamespace()
Description copied from interface:FullyQualifiedElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceFullyQualifiedElement
- Returns:
- the namespace.
-
getElementName
public java.lang.String getElementName()
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
-