Packageorg.igniterealtime.xiff.data.im
Classpublic class RosterExtension
InheritanceRosterExtension Inheritance Extension Inheritance XMLStanza Inheritance ExtensionContainer Inheritance Object
Implements IExtension

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

See also

http://xmpp.org/rfcs/rfc3921.html#roster


Public Properties
 PropertyDefined By
  items : Array
Array of RosterItem objects
RosterExtension
 Inheritedxml : XML
[override] Override in order to take care of setting the Namespace and checking for containing extensions.
Extension
Public Methods
 MethodDefined By
  
RosterExtension(parent:XML = null)
RosterExtension
 Inherited
Add extension to the list of the given namespace and insert to the XML element as a child.
ExtensionContainer
  
addItem(jid:EscapedJID = null, subscription:String, nickname:String, groups:Array = null):void
Adds a single roster item to the extension payload.
RosterExtension
 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
  
Gets the element name associated with this extension.
RosterExtension
 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
  
Gets one item from the roster query, returning the first item found with the JID specified.
RosterExtension
  
getNS():String
Gets the namespace associated with this extension.
RosterExtension
 Inherited
remove():void
Removes the extension from its parent.
Extension
 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
  ASK_TYPE_NONE : String = none
[static]
RosterExtension
  ASK_TYPE_SUBSCRIBE : String = subscribe
[static]
RosterExtension
  ASK_TYPE_UNSUBSCRIBE : String = unsubscribe
[static]
RosterExtension
 InheritedDEFAULT_NS : Namespace
[static] Default XML namespace.
XMLStanza
  ELEMENT_NAME : String = query
[static]
RosterExtension
 InheritedFLASH_NS : Namespace
[static]
XMLStanza
  NS : String = jabber:iq:roster
[static]
RosterExtension
  SHOW_PENDING : String = Pending
[static]
RosterExtension
  SHOW_UNAVAILABLE : String = unavailable
[static]
RosterExtension
 InheritedSTREAM_NS : Namespace
[static]
XMLStanza
  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
Property Detail
itemsproperty
items:Array

Array of RosterItem objects


Implementation
    public function get items():Array
    public function set items(value:Array):void
Constructor Detail
RosterExtension()Constructor
public function RosterExtension(parent:XML = null)

Parameters
parent:XML (default = null)
Method Detail
addItem()method
public function addItem(jid:EscapedJID = null, subscription:String, nickname: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 — The subscription type of the roster item contact. There are pre-defined static variables for these string options in this class definition.
 
nickname:String — 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.

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", "nickname", 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
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