Packageorg.igniterealtime.xiff.data
Classpublic class IQ
InheritanceIQ Inheritance XMPPStanza Inheritance XMLStanza Inheritance ExtensionContainer
ImplementsIIQ

A class for abstraction and encapsulation of IQ (info-query) data.



Public Properties
 PropertyDefined by
  callback : Function
The function that will be called when an IQ result is received with the same ID as one you send.
IQ
  errorCallback : Function
The function that will be called when an IQ error is received with the same ID as one you send.
IQ
 InheritederrorCode : int
The error code, assuming this stanza contains error information.
XMPPStanza
 InheritederrorCondition : String
The error condition, assuming this stanza contains error information.
XMPPStanza
 InheritederrorMessage : String
The error message, assuming this stanza contains error information.
XMPPStanza
 InheritederrorType : String
The error type, assuming this stanza contains error information.
XMPPStanza
 Inherited_exts : Object
ExtensionContainer
 Inheritedfrom : EscapedJID
The JID of the sender.
XMPPStanza
 Inheritedid : String
The unique identifier of this stanza.
XMPPStanza
  idGenerator : IIDGenerator
[static] The ID generator for this stanza type.
IQ
 Inheritedto : EscapedJID
The JID of the recipient.
XMPPStanza
 Inheritedtype : String
The stanza type.
XMPPStanza
 InheritedXMLData : XML
[static]
XMLStanza
 InheritedXMLFactory : XMLDocument
[static]
XMLStanza
Public Methods
 MethodDefined by
  
IQ(recipient:EscapedJID = null, iqType:String = null, iqID:String = null, iqCallback:Function = null, iqErrorCallback:Function = null)
A class for abstraction and encapsulation of IQ (info-query) data.
IQ
 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
Deserializes an XML object and populates the IQ instance with its data.
IQ
 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.
IQ
 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
Serializes the IQ into XML form for sending to a server.
IQ
 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
 InheritedCLIENT_NAMESPACE : String = "jabber:client"
[static]
XMPPStanza
 InheritedCLIENT_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
 InheritedNAMESPACE_FLASH : String = "http://www.jabber.com/streams/flash"
[static]
XMPPStanza
 InheritedNAMESPACE_STREAM : String = "http://etherx.jabber.org/streams"
[static]
XMPPStanza
  TYPE_ERROR : String = "error"
[static] The stanza reports an error that has occurred regarding processing or delivery of a previously-sent get or set request.
IQ
  TYPE_GET : String = "get"
[static] The stanza requests information, inquires about what data is needed in order to complete further operations, etc.
IQ
  TYPE_RESULT : String = "result"
[static] The stanza is a response to a successful get or set request.
IQ
  TYPE_SET : String = "set"
[static] The stanza provides data that is needed for an operation to be completed, sets new values, replaces existing values, etc.
IQ
 InheritedXML_LANG : String = "en"
[static]
XMPPStanza
Property detail
callbackproperty
callback:Function  [read-write]

The function that will be called when an IQ result is received with the same ID as one you send.

Callback functions take one parameter which will be the IQ instance received from the server.

This isn't a required property, but is useful if you need to respond to server responses to an IQ.

Implementation
    public function get callback():Function
    public function set callback(value:Function):void
errorCallbackproperty 
errorCallback:Function  [read-write]

The function that will be called when an IQ error is received with the same ID as one you send.

Callback functions take one parameter which will be the IQ instance received from the server.

This isn't a required property, but is useful if you need to respond to server responses to an IQ.

Implementation
    public function get errorCallback():Function
    public function set errorCallback(value:Function):void
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();

Constructor detail
IQ()constructor
public function IQ(recipient:EscapedJID = null, iqType:String = null, iqID:String = null, iqCallback:Function = null, iqErrorCallback:Function = null)

A class for abstraction and encapsulation of IQ (info-query) data.

Parameters
recipient:EscapedJID (default = null) — The JID of the IQ recipient
 
iqType:String (default = null) — The type of the IQ - there are static variables declared for each type
 
iqID:String (default = null) — The unique ID of the IQ
 
iqCallback:Function (default = null) — The function to be called when the server responds to the IQ
 
iqErrorCallback:Function (default = null) — The object instance containing the callback method
Method detail
deserialize()method
public override function deserialize(xmlNode:XMLNode):Boolean

Deserializes an XML object and populates the IQ instance with its data.

Parameters
xmlNode:XMLNode — The XML to deserialize

Returns
Boolean — An indication as to whether deserialization was sucessful
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 override function serialize(parentNode:XMLNode):Boolean

Serializes the IQ into XML form for sending to a server.

Parameters
parentNode:XMLNode

Returns
Boolean — An indication as to whether serialization was successful
Constant detail
TYPE_ERRORconstant
public static const TYPE_ERROR:String = "error"

The stanza reports an error that has occurred regarding processing or delivery of a previously-sent get or set request.

See also

TYPE_GETconstant 
public static const TYPE_GET:String = "get"

The stanza requests information, inquires about what data is needed in order to complete further operations, etc.

TYPE_RESULTconstant 
public static const TYPE_RESULT:String = "result"

The stanza is a response to a successful get or set request.

TYPE_SETconstant 
public static const TYPE_SET:String = "set"

The stanza provides data that is needed for an operation to be completed, sets new values, replaces existing values, etc.