Packageorg.igniterealtime.xiff.data
Classpublic class Presence
InheritancePresence Inheritance XMPPStanza Inheritance XMLStanza Inheritance ExtensionContainer
ImplementsIPresence

This class provides encapsulation for manipulation of presence data for sending and receiving.



Public Properties
 PropertyDefined by
 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
 InheritedidGenerator : IIDGenerator
[static] The ID generator for this stanza type.
XMPPStanza
  priority : int
The priority of the presence, usually on a scale of 1-5.
Presence
  show : String
The show value; away, online, etc.
Presence
  status : String
The status; usually used for "away messages."
Presence
 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
  
Presence(recipient:EscapedJID = null, sender:EscapedJID = null, presenceType:String = null, showVal:String = null, statusVal:String = null, priorityVal:int = 0)
Presence
 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 Presence instance with its data.
Presence
 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
 Inherited
generateID(prefix:String = null):String
[static] Generates a unique ID for the stanza.
XMPPStanza
 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 Presence into XML form for sending to a server.
Presence
 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
  SHOW_AWAY : String = "away"
[static] The entity or resource is temporarily away.
Presence
  SHOW_CHAT : String = "chat"
[static] The entity or resource is actively interested in chatting.
Presence
  SHOW_DND : String = "dnd"
[static] The entity or resource is busy (dnd = "Do Not Disturb").
Presence
  SHOW_XA : String = "xa"
[static] The entity or resource is away for an extended period (xa = "eXtended Away").
Presence
  TYPE_ERROR : String = "error"
[static] An error has occurred regarding processing of a previously-sent presence stanza; if the presence stanza is of type "error", it MUST include an error child element.
Presence
  TYPE_PROBE : String = "probe"
[static] A request for an entity's current presence; SHOULD be generated only by a server on behalf of a user.
Presence
  TYPE_SUBSCRIBE : String = "subscribe"
[static] The sender wishes to subscribe to the recipient's presence.
Presence
  TYPE_SUBSCRIBED : String = "subscribed"
[static] The sender has allowed the recipient to receive their presence.
Presence
  TYPE_UNAVAILABLE : String = "unavailable"
[static] Signals that the entity is no longer available for communication.
Presence
  TYPE_UNSUBSCRIBE : String = "unsubscribe"
[static] The sender is unsubscribing from the receiver's presence.
Presence
  TYPE_UNSUBSCRIBED : String = "unsubscribed"
[static] The subscription request has been denied or a previously-granted subscription has been cancelled.
Presence
 InheritedXML_LANG : String = "en"
[static]
XMPPStanza
Property detail
priorityproperty
priority:int  [read-write]

The priority of the presence, usually on a scale of 1-5. RFC: "The value MUST be an integer between -128 and +127"

Implementation
    public function get priority():int
    public function set priority(value:int):void
showproperty 
show:String  [read-write]

The show value; away, online, etc. There are predefined static variables in the Presence class for this:

Implementation
    public function get show():String
    public function set show(value:String):void
statusproperty 
status:String  [read-write]

The status; usually used for "away messages."

Implementation
    public function get status():String
    public function set status(value:String):void
Constructor detail
Presence()constructor
public function Presence(recipient:EscapedJID = null, sender:EscapedJID = null, presenceType:String = null, showVal:String = null, statusVal:String = null, priorityVal:int = 0)

Parameters
recipient:EscapedJID (default = null) — The recipient of the presence, usually in the form of a JID.
 
sender:EscapedJID (default = null) — The sender of the presence, usually in the form of a JID.
 
presenceType:String (default = null) — The type of presence as a string. There are predefined static variables for
 
showVal:String (default = null) — What to show for this presence (away, online, etc.) There are predefined static variables for
 
statusVal:String (default = null) — The status; usually used for the "away message."
 
priorityVal:int (default = 0) — The priority of this presence; usually on a scale of 1-5.
Method detail
deserialize()method
public override function deserialize(xmlNode:XMLNode):Boolean

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

Parameters
xmlNode:XMLNode — The XML to deserialize

Returns
Boolean — An indication as to whether deserialization was sucessful
serialize()method 
public override function serialize(parentNode:XMLNode):Boolean

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

Parameters
parentNode:XMLNode

Returns
Boolean — An indication as to whether serialization was successful
Constant detail
SHOW_AWAYconstant
public static const SHOW_AWAY:String = "away"

The entity or resource is temporarily away.

SHOW_CHATconstant 
public static const SHOW_CHAT:String = "chat"

The entity or resource is actively interested in chatting.

SHOW_DNDconstant 
public static const SHOW_DND:String = "dnd"

The entity or resource is busy (dnd = "Do Not Disturb").

SHOW_XAconstant 
public static const SHOW_XA:String = "xa"

The entity or resource is away for an extended period (xa = "eXtended Away").

TYPE_ERRORconstant 
public static const TYPE_ERROR:String = "error"

An error has occurred regarding processing of a previously-sent presence stanza; if the presence stanza is of type "error", it MUST include an error child element.

TYPE_PROBEconstant 
public static const TYPE_PROBE:String = "probe"

A request for an entity's current presence; SHOULD be generated only by a server on behalf of a user.

TYPE_SUBSCRIBEconstant 
public static const TYPE_SUBSCRIBE:String = "subscribe"

The sender wishes to subscribe to the recipient's presence.

TYPE_SUBSCRIBEDconstant 
public static const TYPE_SUBSCRIBED:String = "subscribed"

The sender has allowed the recipient to receive their presence.

TYPE_UNAVAILABLEconstant 
public static const TYPE_UNAVAILABLE:String = "unavailable"

Signals that the entity is no longer available for communication.

TYPE_UNSUBSCRIBEconstant 
public static const TYPE_UNSUBSCRIBE:String = "unsubscribe"

The sender is unsubscribing from the receiver's presence.

TYPE_UNSUBSCRIBEDconstant 
public static const TYPE_UNSUBSCRIBED:String = "unsubscribed"

The subscription request has been denied or a previously-granted subscription has been cancelled.