Packageorg.igniterealtime.xiff.data.im
Classpublic class RosterExtension
InheritanceRosterExtension Inheritance Extension Inheritance XMLStanza Inheritance ExtensionContainer
ImplementsIExtension

An IQ extension for roster data. Roster data is typically any data that is sent or received with the "jabber:iq:roster" namespace.



Public Properties
 PropertyDefined by
 Inherited_exts : Object
ExtensionContainer
 InheritedXMLData : XML
[static]
XMLStanza
 InheritedXMLFactory : XMLDocument
[static]
XMLStanza
Public Methods
 MethodDefined by
  
RosterExtension(parent:XMLNode = null)
RosterExtension
 Inherited
ExtensionContainer
  
addItem(jid:EscapedJID = null, subscription:String = "", displayName:String = "", groups:Array = null):void
Adds a single roster item to the extension payload.
RosterExtension
 Inherited
addTextNode(parent:XMLNode, elementName:String, value:String):XMLNode
Adds a simple text node to the parent node specified.
XMLStanza
  
deserialize(node:XMLNode):Boolean
Deserializes the RosterExtension data.
RosterExtension
  
enable():void
[static] Performs the registration of this extension into the extension registry.
RosterExtension
 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
ExtensionContainer
 Inherited
getAllExtensionsByNS(ns:String):Array
ExtensionContainer
  
getAllItems():Array
Get all the items from this roster query.
RosterExtension
  
getElementName():String
Gets the element name associated with this extension.
RosterExtension
 Inherited
getExtension(name:String):Extension
ExtensionContainer
  
Gets one item from the roster query, returning the first item found with the JID specified.
RosterExtension
 Inherited
getNode():XMLNode
XMLStanza
  
getNS():String
Gets the namespace associated with this extension.
RosterExtension
 Inherited
remove():void
Removes the extension from its parent.
Extension
 Inherited
removeAllExtensions(ns:String):void
ExtensionContainer
  
Removes all items from the roster data.
RosterExtension
 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(parent:XMLNode):Boolean
Serializes the RosterExtension data to XML for sending.
RosterExtension
 Inherited
setNode(node:XMLNode):Boolean
Sets the XML node that should be used for this stanza's internal XML representation.
XMLStanza
 Inherited
toString():String
Converts the extension stanza XML to a string.
Extension
Public Constants
 ConstantDefined by
  ASK_TYPE_NONE : String = "none"
[static]
RosterExtension
  ASK_TYPE_SUBSCRIBE : String = "subscribe"
[static]
RosterExtension
  ASK_TYPE_UNSUBSCRIBE : String = "unsubscribe"
[static]
RosterExtension
  ELEMENT_NAME : String = "query"
[static]
RosterExtension
  NS : String = "jabber:iq:roster"
[static]
RosterExtension
  SHOW_PENDING : String = "Pending"
[static]
RosterExtension
  SHOW_UNAVAILABLE : String = "unavailable"
[static]
RosterExtension
  SUBSCRIBE_TYPE_BOTH : String = "both"
[static]
RosterExtension
  SUBSCRIBE_TYPE_FROM : String = "from"
[static]
RosterExtension
  SUBSCRIBE_TYPE_NONE : String = "none"
[static]
RosterExtension
  SUBSCRIBE_TYPE_REMOVE : String = "remove"
[static]
RosterExtension
  SUBSCRIBE_TYPE_TO : String = "to"
[static]
RosterExtension
Constructor detail
RosterExtension()constructor
public function RosterExtension(parent:XMLNode = null)Parameters
parent:XMLNode (default = null)
Method detail
addItem()method
public function addItem(jid:EscapedJID = null, subscription:String = "", displayName:String = "", groups:Array = null):void

Adds a single roster item to the extension payload.

Parameters
jid:EscapedJID (default = null) — The JID of the contact to add
 
subscription:String (default = "") — The subscription type of the roster item contact. There are pre-defined static variables for these string options in this class definition.
 
displayName:String (default = "") — The display name or nickname of the contact.
 
groups:Array (default = null) — An array of strings of the group names that this contact should be placed in.
deserialize()method 
public function deserialize(node:XMLNode):Boolean

Deserializes the RosterExtension data.

Parameters
node:XMLNode — The XML node associated this data

Returns
Boolean — An indicator as to whether deserialization was successful
enable()method 
public static function enable():void

Performs the registration of this extension into the extension registry.

getAllItems()method 
public function getAllItems():Array

Get all the items from this roster query.

Returns
Array — An array of roster items.
getElementName()method 
public function getElementName():String

Gets the element name associated with this extension. The element for this extension is "query".

Returns
String — The element name
getItemByJID()method 
public function getItemByJID(jid:EscapedJID):RosterItem

Gets one item from the roster query, returning the first item found with the JID specified. If none is found, then it returns null.

Parameters
jid:EscapedJID

Returns
RosterItem — A roster item object with the following attributes: "jid", "subscription", "displayName", and "groups".
getNS()method 
public function getNS():String

Gets the namespace associated with this extension. The namespace for the RosterExtension is "jabber:iq:roster".

Returns
String — The namespace
removeAllItems()method 
public function removeAllItems():void

Removes all items from the roster data.

serialize()method 
public function serialize(parent:XMLNode):Boolean

Serializes the RosterExtension data to XML for sending.

Parameters
parent:XMLNode — The parent node that this extension should be serialized into

Returns
Boolean — An indicator as to whether serialization was successful
Constant detail
ASK_TYPE_NONEconstant
public static const ASK_TYPE_NONE:String = "none"
ASK_TYPE_SUBSCRIBEconstant 
public static const ASK_TYPE_SUBSCRIBE:String = "subscribe"
ASK_TYPE_UNSUBSCRIBEconstant 
public static const ASK_TYPE_UNSUBSCRIBE:String = "unsubscribe"
ELEMENT_NAMEconstant 
public static const ELEMENT_NAME:String = "query"
NSconstant 
public static const NS:String = "jabber:iq:roster"
SHOW_PENDINGconstant 
public static const SHOW_PENDING:String = "Pending"
SHOW_UNAVAILABLEconstant 
public static const SHOW_UNAVAILABLE:String = "unavailable"
SUBSCRIBE_TYPE_BOTHconstant 
public static const SUBSCRIBE_TYPE_BOTH:String = "both"
SUBSCRIBE_TYPE_FROMconstant 
public static const SUBSCRIBE_TYPE_FROM:String = "from"
SUBSCRIBE_TYPE_NONEconstant 
public static const SUBSCRIBE_TYPE_NONE:String = "none"
SUBSCRIBE_TYPE_REMOVEconstant 
public static const SUBSCRIBE_TYPE_REMOVE:String = "remove"
SUBSCRIBE_TYPE_TOconstant 
public static const SUBSCRIBE_TYPE_TO:String = "to"