Packageorg.igniterealtime.xiff.data
Classpublic dynamic class XMPPStanza
InheritanceXMPPStanza Inheritance XMLStanza Inheritance ExtensionContainer
ImplementsIXMPPStanza
SubclassesIQ, Message, Presence

The base class for all XMPP stanza data classes.

See also

http://xmpp.org/rfcs/rfc3920.html#stanzas


Public Properties
 PropertyDefined by
  errorCode : int
The error code, assuming this stanza contains error information.
XMPPStanza
  errorCondition : String
The error condition, assuming this stanza contains error information.
XMPPStanza
  errorMessage : String
The error message, assuming this stanza contains error information.
XMPPStanza
  errorType : String
The error type, assuming this stanza contains error information.
XMPPStanza
 Inherited_exts : Object
ExtensionContainer
  from : EscapedJID
The JID of the sender.
XMPPStanza
  id : String
The unique identifier of this stanza.
XMPPStanza
  idGenerator : IIDGenerator
[static] The ID generator for this stanza type.
XMPPStanza
  to : EscapedJID
The JID of the recipient.
XMPPStanza
  type : String
The stanza type.
XMPPStanza
 InheritedXMLData : XML
[static]
XMLStanza
 InheritedXMLFactory : XMLDocument
[static]
XMLStanza
Public Methods
 MethodDefined by
  
XMPPStanza(recipient:EscapedJID, sender:EscapedJID, theType:String, theID:String, nName:String)
The following four first attributes are common to message, presence, and IQ stanzas.
XMPPStanza
 Inherited
ExtensionContainer
 Inherited
addTextNode(parent:XMLNode, elementName:String, value:String):XMLNode
Adds a simple text node to the parent node specified.
XMLStanza
  
deserialize(xmlNode:XMLNode):Boolean
XMPPStanza
 Inherited
ensureNode(node:XMLNode, elementName:String):XMLNode
Ensures that a node with a specific element name exists in the stanza.
XMLStanza
 Inherited
exists(value:*):Boolean
[static] A helper method to determine if a value is both not null and not undefined.
XMLStanza
  
generateID(prefix:String = null):String
[static] Generates a unique ID for the stanza.
XMPPStanza
 Inherited
ExtensionContainer
 Inherited
getAllExtensionsByNS(ns:String):Array
ExtensionContainer
 Inherited
getExtension(name:String):Extension
ExtensionContainer
 Inherited
getNode():XMLNode
XMLStanza
 Inherited
removeAllExtensions(ns:String):void
ExtensionContainer
 Inherited
ExtensionContainer
 Inherited
replaceTextNode(parent:XMLNode, original:XMLNode, elementName:String, value:String):XMLNode
Replaces one node in the stanza with another simple text node.
XMLStanza
  
serialize(parentNode:XMLNode):Boolean
Prepares the XML version of the stanza for transmission to the server.
XMPPStanza
 Inherited
setNode(node:XMLNode):Boolean
Sets the XML node that should be used for this stanza's internal XML representation.
XMLStanza
Public Constants
 ConstantDefined by
  CLIENT_NAMESPACE : String = "jabber:client"
[static]
XMPPStanza
  CLIENT_VERSION : String = "1.0"
[static] The version of XMPP specified in RFC 3920 is "1.0"; in particular, this encapsulates the stream-related protocols (Use of TLS (Section 5), Use of SASL (Section 6), and Stream Errors (Section 4.7)), as well as the semantics of the three defined XML stanza types (, , and ).
XMPPStanza
  NAMESPACE_FLASH : String = "http://www.jabber.com/streams/flash"
[static]
XMPPStanza
  NAMESPACE_STREAM : String = "http://etherx.jabber.org/streams"
[static]
XMPPStanza
  XML_LANG : String = "en"
[static]
XMPPStanza
Property detail
errorCodeproperty
errorCode:int  [read-write]

The error code, assuming this stanza contains error information. Error codes are deprecated in standard XMPP, but they are commonly used by older Jabber servers like Jabberd 1.4. For more information on error codes, and corresponding error conditions, see http://xmpp.org/extensions/xep-0086.html.

Implementation
    public function get errorCode():int
    public function set errorCode(value:int):void
errorConditionproperty 
errorCondition:String  [read-write]

The error condition, assuming this stanza contains error information. For more information on error conditions, see http://xmpp.org/extensions/xep-0086.html.

Implementation
    public function get errorCondition():String
    public function set errorCondition(value:String):void
errorMessageproperty 
errorMessage:String  [read-write]

The error message, assuming this stanza contains error information.

Implementation
    public function get errorMessage():String
    public function set errorMessage(value:String):void
errorTypeproperty 
errorType:String  [read-write]

The error type, assuming this stanza contains error information. For more information on error types, see http://xmpp.org/extensions/xep-0086.html.

Implementation
    public function get errorType():String
    public function set errorType(value:String):void
fromproperty 
from:EscapedJID  [read-write]

The JID of the sender. Most, if not all, server implementations follow the specifications that prevent this from being falsified. Thus, under normal circumstances, you don't need to supply this information because the server will fill it in automatically.

Implementation
    public function get from():EscapedJID
    public function set from(value:EscapedJID):void
idproperty 
id:String  [read-write]

The unique identifier of this stanza. ID generation is accomplished using the static generateID method of the particular stanza type.

Implementation
    public function get id():String
    public function set id(value:String):void

See also

idGeneratorproperty 
idGenerator:IIDGenerator  [read-write]

The ID generator for this stanza type. ID generators must implement the IIDGenerator interface. The XIFF library comes with a few default ID generators that have already been implemented (see org.igniterealtime.xiff.data.id.. Setting the ID generator by stanza type is useful if you'd like to use different ID generation schemes for each type. For instance, messages could use the incremental ID generation scheme provided by the IncrementalGenerator class, while IQs could use the shared object ID generation scheme provided by the SOIncrementalGenerator class.

Implementation
    public static function get idGenerator():IIDGenerator
    public function set idGenerator(value:IIDGenerator):void

Example
The following sets the ID generator for the Message stanza type to an IncrementalGenerator found in org.igniterealtime.xiff.data.id.IncrementalGenerator:
Message.idGenerator = new IncrementalGenerator();

toproperty 
to:EscapedJID  [read-write]

The JID of the recipient.

Implementation
    public function get to():EscapedJID
    public function set to(value:EscapedJID):void
typeproperty 
type:String  [read-write]

The stanza type. There are MANY types available, depending on what kind of stanza this is. The XIFF Library defines the types for IQ, Presence, and Message in each respective class as static string variables. Below is a listing of each: IQ

Presence Message

Implementation
    public function get type():String
    public function set type(value:String):void
Constructor detail
XMPPStanza()constructor
public function XMPPStanza(recipient:EscapedJID, sender:EscapedJID, theType:String, theID:String, nName:String)

The following four first attributes are common to message, presence, and IQ stanzas. The fifth, xml:lang, is not included here.

Parameters
recipient:EscapedJID — to
 
sender:EscapedJID — from
 
theType:String — type
 
theID:String — id
 
nName:String
Method detail
deserialize()method
public function deserialize(xmlNode:XMLNode):BooleanParameters
xmlNode:XMLNode

Returns
Boolean
generateID()method 
public static function generateID(prefix:String = null):String

Generates a unique ID for the stanza. ID generation is handled using a variety of mechanisms, but the default for the library uses the IncrementalGenerator.

Parameters
prefix:String (default = null) — The prefix for the ID to be generated

Returns
String — The generated ID
serialize()method 
public function serialize(parentNode:XMLNode):Boolean

Prepares the XML version of the stanza for transmission to the server.

Parameters
parentNode:XMLNode — (Optional) The parent node that the stanza should be appended to during serialization

Returns
Boolean — An indication as to whether serialization was successful
Constant detail
CLIENT_NAMESPACEconstant
public static const CLIENT_NAMESPACE:String = "jabber:client"
CLIENT_VERSIONconstant 
public static const CLIENT_VERSION:String = "1.0"

The version of XMPP specified in RFC 3920 is "1.0"; in particular, this encapsulates the stream-related protocols (Use of TLS (Section 5), Use of SASL (Section 6), and Stream Errors (Section 4.7)), as well as the semantics of the three defined XML stanza types (, , and ).

NAMESPACE_FLASHconstant 
public static const NAMESPACE_FLASH:String = "http://www.jabber.com/streams/flash"
NAMESPACE_STREAMconstant 
public static const NAMESPACE_STREAM:String = "http://etherx.jabber.org/streams"
XML_LANGconstant 
public static const XML_LANG:String = "en"