Packageorg.igniterealtime.xiff.data
Classpublic class Message
InheritanceMessage Inheritance XMPPStanza Inheritance XMLStanza Inheritance ExtensionContainer Inheritance Object
Implements IMessage

Message, nuff said.

See also

http://tools.ietf.org/html/rfc3921#section-2.1.1


Public Properties
 PropertyDefined By
  attention : Boolean
Messages containing an attention extension SHOULD use the headline message type to avoid offline storage.
Message
  body : String
The message body in plain-text format.
Message
  correction : Boolean
When sending a message, people often introduce typing errors and send a follow-up message to correct them.
Message
  correctionId : String
Message ID of the message that is to be corrected.
Message
 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
 Inheritedfrom : EscapedJID
The JID of the sender.
XMPPStanza
  htmlBody : String
The message body in XHTML format.
Message
 Inheritedid : String
The unique identifier of this stanza.
XMPPStanza
  idGenerator : IIDGenerator
[static] The ID generator for this stanza type.
Message
  receipt : String
XEP-0184: Message Delivery Receipts This XMPP protocol extension for message delivery receipts, whereby the sender of a message can request notification that the message has been delivered to a client controlled by the intended recipient.
Message
  receiptId : String
Message ID of the message that had receipt request.
Message
  state : String
The chat state if any.
Message
  subject : String
The message subject.
Message
  thread : String
The message thread ID.
Message
  time : Date
[read-only] Time of the message in case of a delay.
Message
 Inheritedto : EscapedJID
The JID of the recipient.
XMPPStanza
 Inheritedtype : String
The stanza type.
XMPPStanza
 Inheritedxml : XML
[override] In addition to saving the XML, check for possible Extensions that are registered for listening this XML data.
XMPPStanza
Protected Properties
 PropertyDefined By
 InheriteddelayedDelivery : Date
[read-only] Time of the message/presence in case of a delay.
XMPPStanza
Public Methods
 MethodDefined By
  
Message(recipient:EscapedJID = null, msgID:String = null, msgBody:String = null, msgHTMLBody:String = null, msgType:String = null, msgSubject:String = null, chatState:String = null)
A class for abstraction and encapsulation of message data.
Message
 Inherited
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.
Message
 Inherited
ExtensionContainer
 Inherited
getAllExtensionsByNS(nameSpace:String):Array
ExtensionContainer
 Inherited
getAttribute(name:String):String
Convinience method for getting element value from the XML.
XMLStanza
 Inherited
getChildAttribute(elem:String, name:String):String
Convinience method for getting child element attribute value from the XML.
XMLStanza
 Inherited
getChildField(elem:String, name:String):String
Convinience method for getting child element value from the XML.
XMLStanza
 Inherited
getExtension(elementName:String):IExtension
Get the extension having the given element name.
ExtensionContainer
 Inherited
getField(name:String):String
Convinience method for getting element value from the XML.
XMLStanza
 Inherited
removeAllExtensions(nameSpace:String):void
ExtensionContainer
 Inherited
removeExtension(extension:IExtension):Boolean
ExtensionContainer
 Inherited
removeFields(name:String):void
Helper method for removing all child elements that have the given name.
XMLStanza
 Inherited
setAttribute(name:String, value:String):void
Convinience method for setting a value to a element in the XML.
XMLStanza
 Inherited
setChildAttribute(elem:String, name:String, value:String):void
Convinience method for setting an attribute for a child element of the XML.
XMLStanza
 Inherited
setChildField(elem:String, name:String, value:String):void
Convinience method for setting a value for a child element of the XML.
XMLStanza
 Inherited
setField(name:String, value:String):void
Convinience method for setting a value to a element in the XML.
XMLStanza
 Inherited
toString():String
Converts the base stanza XML to a string.
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 (message, presence, and iq).
XMPPStanza
 InheritedDEFAULT_NS : Namespace
[static] Default XML namespace.
XMLStanza
 InheritedELEMENT_IQ : String = iq
[static]
XMPPStanza
 InheritedELEMENT_MESSAGE : String = message
[static]
XMPPStanza
 InheritedELEMENT_PRESENCE : String = presence
[static]
XMPPStanza
 InheritedELEMENT_TEMP : String = temp
[static] Internal name in XIFF for incoming data.
XMPPStanza
 InheritedERROR_AUTH : String = auth
[static] Retry after providing credentials
XMPPStanza
 InheritedERROR_CANCEL : String = cancel
[static] Do not retry (the error is unrecoverable)
XMPPStanza
 InheritedERROR_CONTINUE : String = continue
[static] Proceed (the condition was only a warning)
XMPPStanza
 InheritedERROR_MODIFY : String = modify
[static] Retry after changing the data sent
XMPPStanza
 InheritedERROR_WAIT : String = wait
[static] Retry after waiting (the error is temporary)
XMPPStanza
 InheritedFLASH_NS : Namespace
[static]
XMLStanza
 InheritedNAMESPACE_BOSH : String = urn:xmpp:xbosh
[static]
XMPPStanza
 InheritedNAMESPACE_FLASH : String = http://www.jabber.com/streams/flash
[static]
XMPPStanza
 InheritedNAMESPACE_STREAM : String = http://etherx.jabber.org/streams
[static]
XMPPStanza
  NS_ATTENTION : String = urn:xmpp:attention:0
[static] The namespace used in the message delivery node.
Message
  NS_CORRECTION : String = urn:xmpp:message-correct:0
[static] The namespace used in the XEP-0308: Last Message Correction.
Message
  NS_RECEIPT : String = urn:xmpp:receipts
[static] The namespace used in the message delivery node.
Message
  NS_STATE : String = http://jabber.org/protocol/chatstates
[static] The name space used in the Chat state node.
Message
  RECEIPT_RECEIVED : String = received
[static] Included by a receiving entity that wishes to inform the sending entity that the message has been received.
Message
  RECEIPT_REQUEST : String = request
[static] Included by a sending entity that wishes to know if the message has been received.
Message
  STATE_ACTIVE : String = active
[static] User is actively participating in the chat session.
Message
  STATE_COMPOSING : String = composing
[static] User is composing a message.
Message
  STATE_GONE : String = gone
[static] User has effectively ended their participation in the chat session.
Message
  STATE_INACTIVE : String = inactive
[static] User has not been actively participating in the chat session.
Message
  STATE_PAUSED : String = paused
[static] User had been composing but now has stopped.
Message
 InheritedSTREAM_NS : Namespace
[static]
XMLStanza
  TYPE_CHAT : String = chat
[static] The message is sent in the context of a one-to-one chat session.
Message
  TYPE_ERROR : String = error
[static] The message is generated by an entity that experiences an error in processing a message received from another entity (for details regarding stanza error syntax, refer to [xmpp-core]).
Message
  TYPE_GROUPCHAT : String = groupchat
[static] The message is sent in the context of a multi-user chat environment (similar to that of [IRC]).
Message
  TYPE_HEADLINE : String = headline
[static] The message provides an alert, a notification, or other information to which no reply is expected (e.g., news headlines, sports updates, near-real-time market data, and syndicated content).
Message
  TYPE_NORMAL : String = normal
[static] The message is a standalone message that is sent outside the context of a one-to-one conversation or groupchat, and to which it is expected that the recipient will reply.
Message
 InheritedXML_LANG : String = en
[static]
XMPPStanza
Property Detail
attentionproperty
attention:Boolean

Messages containing an attention extension SHOULD use the headline message type to avoid offline storage. In case the attention property is used, type is set to "headline" automatically.

However there is no check for the type when removing the attention, by setting it to false.


Implementation
    public function get attention():Boolean
    public function set attention(value:Boolean):void

See also

bodyproperty 
body:String

The message body in plain-text format. If a client cannot render HTML-formatted text, this text is typically used instead.

Use null to remove.


Implementation
    public function get body():String
    public function set body(value:String):void
correctionproperty 
correction:Boolean

When sending a message, people often introduce typing errors and send a follow-up message to correct them. This property allows the sending client to flag the second message as correcting the first.


Implementation
    public function get correction():Boolean
    public function set correction(value:Boolean):void

See also

correctionIdproperty 
correctionId:String

Message ID of the message that is to be corrected.


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

See also

htmlBodyproperty 
htmlBody:String

The message body in XHTML format. Internally, this uses the XHTML data extension. TODO: Use extension registery to solve if the proper extension is enabled...

Use null to remove.


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

See also

idGeneratorproperty 
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.


Implementation
    public static function get idGenerator():IIDGenerator
    public static 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();
receiptproperty 
receipt:String

XEP-0184: Message Delivery Receipts

This XMPP protocol extension for message delivery receipts, whereby the sender of a message can request notification that the message has been delivered to a client controlled by the intended recipient.


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

See also

receiptIdproperty 
receiptId:String

Message ID of the message that had receipt request. Can be set only when the 'receipt' is Message.RECEIPT_RECEIVED.

While sending 'received', this property must be set to the message id that contained the 'request'.


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

See also

stateproperty 
state:String

The chat state if any. Possible values are:

Use null to remove.

TODO: XEP states that this protocol SHOULD NOT be used with message types other than "chat" or "groupchat".


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

See also

subjectproperty 
subject:String

The message subject. Typically chat and groupchat-type messages do not use subjects. Rather, this is reserved for normal and headline-type messages.

Use null to remove.


Implementation
    public function get subject():String
    public function set subject(value:String):void
threadproperty 
thread:String

The message thread ID. Threading is used to group messages of the same discussion together. The library does not perform message grouping, rather it is up to any client authors to properly perform this task.

Use null to remove.


Implementation
    public function get thread():String
    public function set thread(value:String):void
timeproperty 
time:Date  [read-only]

Time of the message 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


Implementation
    public function get time():Date

See also

Constructor Detail
Message()Constructor
public function Message(recipient:EscapedJID = null, msgID:String = null, msgBody:String = null, msgHTMLBody:String = null, msgType:String = null, msgSubject:String = null, chatState:String = null)

A class for abstraction and encapsulation of message data.

The message stanza kind can be seen as a "push" mechanism whereby one entity pushes information to another entity, similar to the communications that occur in a system such as email. All message stanzas SHOULD possess a 'to' attribute that specifies the intended recipient of the message; upon receiving such a stanza, a server SHOULD route or deliver it to the intended recipient (see Server Rules for Handling XML Stanzas (Section 10) for general routing and delivery rules related to XML stanzas).

Parameters
recipient:EscapedJID (default = null) — The JID of the message recipient
 
msgID:String (default = null) — The JID of the message sender - the server should report an error if this is falsified
 
msgBody:String (default = null) — The message ID
 
msgHTMLBody:String (default = null) — The message body in plain-text format
 
msgType:String (default = null) — The message body in XHTML format
 
msgSubject:String (default = null) — The message type
 
chatState:String (default = null) — (Optional) The message subject
Method Detail
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
Constant Detail
NS_ATTENTIONConstant
public static const NS_ATTENTION:String = urn:xmpp:attention:0

The namespace used in the message delivery node.

See also

NS_CORRECTIONConstant 
public static const NS_CORRECTION:String = urn:xmpp:message-correct:0

The namespace used in the XEP-0308: Last Message Correction.

See also

NS_RECEIPTConstant 
public static const NS_RECEIPT:String = urn:xmpp:receipts

The namespace used in the message delivery node.

See also

NS_STATEConstant 
public static const NS_STATE:String = http://jabber.org/protocol/chatstates

The name space used in the Chat state node.

See also

RECEIPT_RECEIVEDConstant 
public static const RECEIPT_RECEIVED:String = received

Included by a receiving entity that wishes to inform the sending entity that the message has been received.

The received element SHOULD be the only child of the message stanza and MUST mirror the 'id' of the sent message.

See also

RECEIPT_REQUESTConstant 
public static const RECEIPT_REQUEST:String = request

Included by a sending entity that wishes to know if the message has been received.

See also

STATE_ACTIVEConstant 
public static const STATE_ACTIVE:String = active

User is actively participating in the chat session.

STATE_COMPOSINGConstant 
public static const STATE_COMPOSING:String = composing

User is composing a message.

STATE_GONEConstant 
public static const STATE_GONE:String = gone

User has effectively ended their participation in the chat session. Suggested delay after last activity some 10 minutes.

STATE_INACTIVEConstant 
public static const STATE_INACTIVE:String = inactive

User has not been actively participating in the chat session. Suggested delay after last activity some 2 minutes.

STATE_PAUSEDConstant 
public static const STATE_PAUSED:String = paused

User had been composing but now has stopped. Suggested delay after last activity some 30 seconds.

TYPE_CHATConstant 
public static const TYPE_CHAT:String = chat

The message is sent in the context of a one-to-one chat session. Typically a receiving client will present message of type "chat" in an interface that enables one-to-one chat between the two parties, including an appropriate conversation history. Detailed recommendations regarding one-to-one chat sessions are provided under Section 5.1. of RFC 3921 (draft version).

See also

TYPE_ERRORConstant 
public static const TYPE_ERROR:String = error

The message is generated by an entity that experiences an error in processing a message received from another entity (for details regarding stanza error syntax, refer to [xmpp-core]). A client that receives a message of type "error" SHOULD present an appropriate interface informing the sender of the nature of the error.

TYPE_GROUPCHATConstant 
public static const TYPE_GROUPCHAT:String = groupchat

The message is sent in the context of a multi-user chat environment (similar to that of [IRC]). Typically a receiving client will present a message of type "groupchat" in an interface that enables many-to-many chat between the parties, including a roster of parties in the chatroom and an appropriate conversation history. For detailed information about XMPP-based groupchat, refer to [XEP-0045].

See also

TYPE_HEADLINEConstant 
public static const TYPE_HEADLINE:String = headline

The message provides an alert, a notification, or other information to which no reply is expected (e.g., news headlines, sports updates, near-real-time market data, and syndicated content). Because no reply to the message is expected, typically a receiving client will present a message of type "headline" in an interface that appropriately differentiates the message from standalone messages, chat messages, or groupchat messages (e.g., by not providing the recipient with the ability to reply). The receiving server SHOULD deliver the message to all of the recipient’s available resources.

TYPE_NORMALConstant 
public static const TYPE_NORMAL:String = normal

The message is a standalone message that is sent outside the context of a one-to-one conversation or groupchat, and to which it is expected that the recipient will reply. Typically a receiving client will present a message of type "normal" in an interface that enables the recipient to reply, but without a conversation history. The default value of the ’type’ attribute is "normal".