Package | org.igniterealtime.xiff.data |
Class | public class Message |
Inheritance | Message ![]() ![]() ![]() |
Implements | IMessage |
See also
Property | Defined by | ||
---|---|---|---|
body : String
The message body in plain-text format.
| Message | ||
![]() | 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 | |
![]() | _exts : Object | ExtensionContainer | |
![]() | from : EscapedJID
The JID of the sender.
| XMPPStanza | |
htmlBody : String
The message body in XHTML format.
| Message | ||
![]() | id : String
The unique identifier of this stanza.
| XMPPStanza | |
idGenerator : IIDGenerator
[static]
The ID generator for this stanza type.
| 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 | ||
![]() | to : EscapedJID
The JID of the recipient.
| XMPPStanza | |
![]() | type : String
The stanza type.
| XMPPStanza | |
![]() | XMLData : XML [static]
| XMLStanza | |
![]() | XMLFactory : XMLDocument [static]
| XMLStanza |
Method | Defined 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 | ||
![]() | ExtensionContainer | ||
![]() |
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 Message instance with its data.
| Message | ||
![]() |
ensureNode(node:XMLNode, elementName:String):XMLNode
Ensures that a node with a specific element name exists in the stanza.
| XMLStanza | |
![]() |
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.
| Message | ||
![]() |
getAllExtensions():Array
| ExtensionContainer | |
![]() |
getAllExtensionsByNS(ns:String):Array
| ExtensionContainer | |
![]() |
getExtension(name:String):Extension
| ExtensionContainer | |
![]() |
getNode():XMLNode
| XMLStanza | |
MessageStaticConstructor():Boolean
[static]
| Message | ||
![]() |
removeAllExtensions(ns:String):void
| ExtensionContainer | |
![]() |
removeExtension(ext:IExtension):Boolean
| ExtensionContainer | |
![]() |
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 Message into XML form for sending to a server.
| Message | ||
![]() |
setNode(node:XMLNode):Boolean
Sets the XML node that should be used for this stanza's internal XML representation.
| 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 (
| XMPPStanza | |
![]() | NAMESPACE_FLASH : String = "http://www.jabber.com/streams/flash" [static]
| XMPPStanza | |
![]() | NAMESPACE_STREAM : String = "http://etherx.jabber.org/streams" [static]
| XMPPStanza | |
NS_RECEIPT : String = "urn:xmpp:receipts" [static]
The name space 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 | ||
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 | ||
![]() | XML_LANG : String = "en" [static]
| XMPPStanza |
body | property |
body:String
[read-write]The message body in plain-text format. If a client cannot render HTML-formatted text, this text is typically used instead.
Implementation public function get body():String
public function set body(value:String):void
htmlBody | property |
htmlBody:String
[read-write]The message body in XHTML format. Internally, this uses the XHTML data extension.
Implementation public function get htmlBody():String
public function set htmlBody(value:String):void
See also
idGenerator | property |
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
Message.idGenerator = new IncrementalGenerator();
state | property |
state:String
[read-write]
The chat state if any. Possible values, in addition to null
, are:
public function get state():String
public function set state(value:String):void
subject | property |
subject:String
[read-write]The message subject. Typically chat and groupchat-type messages do not use subjects. Rather, this is reserved for normal and headline-type messages.
Implementation public function get subject():String
public function set subject(value:String):void
thread | property |
thread:String
[read-write]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.
Implementation public function get thread():String
public function set thread(value:String):void
time | property |
time:Date
[read-only]Time of the message in case of a delay. Used only for messages which were sent while user was offline.
CCYY-MM-DDThh:mm:ss[.sss]TZD
public function get time():Date
See also
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.
Parametersrecipient: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
|
deserialize | () | method |
public override function deserialize(xmlNode:XMLNode):Boolean
Deserializes an XML object and populates the Message instance with its data.
ParametersxmlNode:XMLNode — The XML to deserialize
|
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.
Parametersprefix:String (default = null ) — The prefix for the ID to be generated
|
String — The generated ID
|
MessageStaticConstructor | () | method |
public static function MessageStaticConstructor():Boolean
Returns
Boolean |
serialize | () | method |
public override function serialize(parentNode:XMLNode):Boolean
Serializes the Message into XML form for sending to a server.
ParametersparentNode:XMLNode |
Boolean — An indication as to whether serialization was successful
|
NS_RECEIPT | constant |
public static const NS_RECEIPT:String = "urn:xmpp:receipts"
The name space used in the message delivery node.
See also
NS_STATE | constant |
public static const NS_STATE:String = "http://jabber.org/protocol/chatstates"
The name space used in the Chat state node.
See also
RECEIPT_RECEIVED | constant |
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
RECEIPT_REQUEST | constant |
public static const RECEIPT_REQUEST:String = "request"
Included by a sending entity that wishes to know if the message has been received.
STATE_ACTIVE | constant |
public static const STATE_ACTIVE:String = "active"
User is actively participating in the chat session.
STATE_COMPOSING | constant |
public static const STATE_COMPOSING:String = "composing"
User is composing a message.
STATE_GONE | constant |
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_INACTIVE | constant |
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_PAUSED | constant |
public static const STATE_PAUSED:String = "paused"
User had been composing but now has stopped. Suggested delay after last activity some 30 seconds.
TYPE_CHAT | constant |
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_ERROR | constant |
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_GROUPCHAT | constant |
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_HEADLINE | constant |
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_NORMAL | constant |
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".