Package | org.igniterealtime.xiff.data |
Class | public dynamic class XMPPStanza |
Inheritance | XMPPStanza ![]() ![]() ![]() |
Implements | IXMPPStanza |
Subclasses | IQ, Message, Presence |
Three types can exist:
See also
Property | Defined 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 | ||
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 | ||
xml : XML [override]
In addition to saving the XML, check for possible Extensions that are registered for listening this XML data. | XMPPStanza |
Property | Defined By | ||
---|---|---|---|
delayedDelivery : Date [read-only]
Time of the message/presence in case of a delay. | XMPPStanza |
Method | Defined By | ||
---|---|---|---|
The following four first attributes are common to message, presence, and IQ stanzas. | XMPPStanza | ||
![]() |
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. | XMPPStanza | ||
![]() | 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 | |
XML_LANG : String = en [static] | XMPPStanza |
delayedDelivery | property |
delayedDelivery:Date
[read-only] Time of the message/presence in case of a delay. Used only for messages which were sent while user was offline.
Can be set only via XML as the value should come from the server.
There are two ways that might be possible coming from the server, XEP-0203 or XEP-0091, of which the latter is legacy.
XEP-0203: CCYY-MM-DDThh:mm:ss[.sss]TZD
XEP-0091: CCYYMMDDThh:mm:ss
protected function get delayedDelivery():Date
See also
errorCode | property |
errorCode:int
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.
Use NaN
to remove.
See the link for XEP-0086: Error Condition Mappings
public function get errorCode():int
public function set errorCode(value:int):void
See also
errorCondition | property |
errorCondition:String
The error condition, assuming this stanza contains error information.
Use null
to remove.
Error condition should be in lowercase and not contain any whitespace.
Error element must be qualified by urn:ietf:params:xml:ns:xmpp-stanzas namespace.
public function get errorCondition():String
public function set errorCondition(value:String):void
See also
errorMessage | property |
errorMessage:String
The error message, assuming this stanza contains error information.
Use null
to remove.
This is the text element that is a child of error element.
public function get errorMessage():String
public function set errorMessage(value:String):void
See also
errorType | property |
errorType:String
The error type, assuming this stanza contains error information.
Use null
to remove.
The value of the error element's 'type' attribute MUST be one of the following:
public function get errorType():String
public function set errorType(value:String):void
See also
from | property |
from:EscapedJID
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.
Use null
to remove.
public function get from():EscapedJID
public function set from(value:EscapedJID):void
id | property |
id:String
The unique identifier of this stanza. ID generation is accomplished using
the static generateID
method of the particular stanza type.
RFC: The optional 'id' attribute MAY be used by a sending entity for internal tracking of stanzas that it sends and receives (especially for tracking the request-response interaction inherent in the semantics of IQ stanzas). It is OPTIONAL for the value of the 'id' attribute to be unique globally, within a domain, or within a stream. The semantics of IQ stanzas impose additional restrictions; see IQ Semantics (Section 9.2.3).
Use null
to remove.
public function get id():String
public function set id(value:String):void
See also
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
See also
Message.idGenerator = new IncrementalGenerator();
to | property |
to:EscapedJID
The JID of the recipient.
Use null
to remove.
public function get to():EscapedJID
public function set to(value:EscapedJID):void
type | property |
type:String
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:
IQUse null
to remove.
RFC: The 'type' attribute specifies detailed information about the purpose or context of the message, presence, or IQ stanza. The particular allowable values for the 'type' attribute vary depending on whether the stanza is a message, presence, or IQ; the values for message and presence stanzas are specific to instant messaging and presence applications and therefore are defined in [XMPP-IM], whereas the values for IQ stanzas specify the role of an IQ stanza in a structured request-response "conversation" and thus are defined under IQ Semantics (Section 9.2.3) below. The only 'type' value common to all three stanzas is "error"; see Stanza Errors (Section 9.3).
public function get type():String
public function set type(value:String):void
See also
xml | property |
xml:XML
[override] In addition to saving the XML, check for possible Extensions that are registered for listening this XML data.
public function get xml():XML
public function set xml(value:XML):void
XMPPStanza | () | Constructor |
public function XMPPStanza(recipient:EscapedJID, sender:EscapedJID, theType:String, theID:String, nodeName:String)
The following four first attributes are common to message, presence, and IQ stanzas. The fifth, xml:lang, is not included here.
RFC 3920: 9. XML Stanzas
After TLS negotiation (Section 5) if desired, SASL negotiation (Section 6), and Resource Binding (Section 7) if necessary, XML stanzas can be sent over the streams. Three kinds of XML stanza are defined for the 'jabber:client' and 'jabber:server' namespaces: >message/<, >presence/<, and >iq/<. In addition, there are five common attributes for these kinds of stanza. These common attributes, as well as the basic semantics of the three stanza kinds, are defined herein; more detailed information regarding the syntax of XML stanzas in relation to instant messaging and presence applications is provided in [XMPP-IM].
| initiating to receiving | receiving to initiating ---------+---------------------------+----------------------- to | hostname of receiver | silently ignored from | silently ignored | hostname of receiver id | silently ignored | session key xml:lang | default language | default language version | signals XMPP 1.0 support | signals XMPP 1.0 supportParameters
recipient:EscapedJID — to
| |
sender:EscapedJID — from
| |
theType:String — type
| |
theID:String — id
| |
nodeName:String — One of the four ELEMENT_constants
|
See also
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
|
CLIENT_NAMESPACE | Constant |
public static const CLIENT_NAMESPACE:String = jabber:client
CLIENT_VERSION | Constant |
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 (message, presence, and iq).
ELEMENT_IQ | Constant |
public static const ELEMENT_IQ:String = iq
ELEMENT_MESSAGE | Constant |
public static const ELEMENT_MESSAGE:String = message
ELEMENT_PRESENCE | Constant |
public static const ELEMENT_PRESENCE:String = presence
ELEMENT_TEMP | Constant |
public static const ELEMENT_TEMP:String = temp
Internal name in XIFF for incoming data. The proper element name should be available after setting the XML.
ERROR_AUTH | Constant |
public static const ERROR_AUTH:String = auth
Retry after providing credentials
ERROR_CANCEL | Constant |
public static const ERROR_CANCEL:String = cancel
Do not retry (the error is unrecoverable)
ERROR_CONTINUE | Constant |
public static const ERROR_CONTINUE:String = continue
Proceed (the condition was only a warning)
ERROR_MODIFY | Constant |
public static const ERROR_MODIFY:String = modify
Retry after changing the data sent
ERROR_WAIT | Constant |
public static const ERROR_WAIT:String = wait
Retry after waiting (the error is temporary)
NAMESPACE_BOSH | Constant |
public static const NAMESPACE_BOSH:String = urn:xmpp:xbosh
NAMESPACE_FLASH | Constant |
public static const NAMESPACE_FLASH:String = http://www.jabber.com/streams/flash
NAMESPACE_STREAM | Constant |
public static const NAMESPACE_STREAM:String = http://etherx.jabber.org/streams
XML_LANG | Constant |
public static const XML_LANG:String = en