Package | org.igniterealtime.xiff.data |
Class | public class IQ |
Inheritance | IQ ![]() ![]() ![]() ![]() |
Implements | IIQ |
See also
Property | Defined 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 | ||
![]() | 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 | |
![]() | 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. | IQ | ||
![]() | to : EscapedJID
The JID of the recipient. | XMPPStanza | |
![]() | type : String
The stanza type. | XMPPStanza | |
![]() | xml : XML [override]
In addition to saving the XML, check for possible Extensions that are registered for listening this XML data. | XMPPStanza |
Method | Defined 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 | ||
![]() |
Add extension to the list of the given namespace and insert to the XML element as a child. | ExtensionContainer | |
generateID(prefix:String = null):String [static]
Generates a unique ID for the stanza. | IQ | ||
![]() | getAllExtensions():Array | ExtensionContainer | |
![]() | getAllExtensionsByNS(nameSpace:String):Array | ExtensionContainer | |
![]() | getAttribute(name:String):String
Convinience method for getting element value from the XML. | XMLStanza | |
![]() | getChildAttribute(elem:String, name:String):String
Convinience method for getting child element attribute value from the XML. | XMLStanza | |
![]() | getChildField(elem:String, name:String):String
Convinience method for getting child element value from the XML. | XMLStanza | |
![]() | getExtension(elementName:String):IExtension
Get the extension having the given element name. | ExtensionContainer | |
![]() | getField(name:String):String
Convinience method for getting element value from the XML. | XMLStanza | |
![]() | removeAllExtensions(nameSpace:String):void | ExtensionContainer | |
![]() | removeExtension(extension:IExtension):Boolean | ExtensionContainer | |
![]() | removeFields(name:String):void
Helper method for removing all child elements that have the given name. | XMLStanza | |
![]() | setAttribute(name:String, value:String):void
Convinience method for setting a value to a element in the XML. | XMLStanza | |
![]() | setChildAttribute(elem:String, name:String, value:String):void
Convinience method for setting an attribute for a child element of the XML. | XMLStanza | |
![]() | setChildField(elem:String, name:String, value:String):void
Convinience method for setting a value for a child element of the XML. | XMLStanza | |
![]() | setField(name:String, value:String):void
Convinience method for setting a value to a element in the XML. | XMLStanza | |
![]() | toString():String
Converts the base stanza XML to a string. | XMLStanza |
Constant | Defined 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 (message,
presence, and iq). | XMPPStanza | |
![]() | DEFAULT_NS : Namespace [static]
Default XML namespace. | XMLStanza | |
![]() | ELEMENT_IQ : String = iq [static] | XMPPStanza | |
![]() | ELEMENT_MESSAGE : String = message [static] | XMPPStanza | |
![]() | ELEMENT_PRESENCE : String = presence [static] | XMPPStanza | |
![]() | ELEMENT_TEMP : String = temp [static]
Internal name in XIFF for incoming data. | XMPPStanza | |
![]() | ERROR_AUTH : String = auth [static]
Retry after providing credentials
| XMPPStanza | |
![]() | ERROR_CANCEL : String = cancel [static]
Do not retry (the error is unrecoverable)
| XMPPStanza | |
![]() | ERROR_CONTINUE : String = continue [static]
Proceed (the condition was only a warning)
| XMPPStanza | |
![]() | ERROR_MODIFY : String = modify [static]
Retry after changing the data sent
| XMPPStanza | |
![]() | ERROR_WAIT : String = wait [static]
Retry after waiting (the error is temporary)
| XMPPStanza | |
![]() | FLASH_NS : Namespace [static]
| XMLStanza | |
![]() | NAMESPACE_BOSH : String = urn:xmpp:xbosh [static] | XMPPStanza | |
![]() | NAMESPACE_FLASH : String = http://www.jabber.com/streams/flash [static] | XMPPStanza | |
![]() | NAMESPACE_STREAM : String = http://etherx.jabber.org/streams [static] | XMPPStanza | |
![]() | STREAM_NS : Namespace [static]
| XMLStanza | |
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 | ||
![]() | XML_LANG : String = en [static] | XMPPStanza |
callback | property |
callback:Function
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.
public function get callback():Function
public function set callback(value:Function):void
errorCallback | property |
errorCallback:Function
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.
public function get errorCallback():Function
public function set errorCallback(value:Function):void
idGenerator | property |
idGenerator:IIDGenerator
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.
public static function get idGenerator():IIDGenerator
public static function set idGenerator(value:IIDGenerator):void
Message.idGenerator = new IncrementalGenerator();
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.
Info/Query, or IQ, is a request-response mechanism, similar in some ways to [HTTP]. The semantics of IQ enable an entity to make a request of, and receive a response from, another entity. The data content of the request and response is defined by the namespace declaration of a direct child element of the IQ element, and the interaction is tracked by the requesting entity through use of the 'id' attribute. Thus, IQ interactions follow a common pattern of structured data exchange such as get/result or set/result (although an error may be returned in reply to a request if appropriate):
Requesting Responding Entity Entity ---------- ---------- | | | <iq type='get' id='1'> | | ------------------------> | | | | <iq type='result' id='1'> | | <------------------------ | | | | <iq type='set' id='2'> | | ------------------------> | | | | <iq type='error' id='2'> | | <------------------------ | | |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, one of TYPE_constants
| |
iqCallback:Function (default = null ) — The function to be called when the server responds to the IQ
| |
iqErrorCallback:Function (default = null ) — The function to be called when there is an error
|
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
|
String — The generated ID
|
TYPE_ERROR | Constant |
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_GET | Constant |
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_RESULT | Constant |
public static const TYPE_RESULT:String = result
The stanza is a response to a successful get or set request.
TYPE_SET | Constant |
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.