Packagenet.user1.reactor.snapshot
Classpublic class RoomListSnapshot
InheritanceRoomListSnapshot Inheritance Snapshot Inheritance flash.events.EventDispatcher

Since : Reactor 1.0.0

The RoomListSnapshot class is used to load a list of fully qualified roomIDs for all rooms on the server or all rooms with a given qualifier. The following code demonstrates:
   // Create a snapshot of roomIDs including every room on the server 
   var snapshot:RoomListSnapshot = new RoomListSnapshot(null, true);
   
   // Register a callback function
   snapshot.onLoad = function ():void { 
     trace("Here is the room list: " + snapshot.getRoomList());
   }
   
   // Or register a listener function
   snapshot.addEventListener(SnapshotEvent.LOAD, loadListener);
   function loadListener (e:SnapshotEvent):void {
     var snapshot:RoomListSnapshot = RoomListSnapshot(e.target);
     trace("Here are the rooms on the server: " + snapshot.getRoomList());
   }
   
   // Load the room list by passing the snapshot object to 
   // Reactor's updateSnapshot() method:
   reactor.updateSnapshot(snapshot);
   

The list of room IDs retrieved by RoomListSnapshot is a one-time snapshot of the state of the server, and is not kept up to date after it is loaded. To update a RoomListSnapshot object to match latest the state of the server, pass that object to Reactor's updateSnapshot() method.

See also

SnapshotEvent
Snapshot
net.user1.reactor.Reactor.updateSnapshot()


Public Variables
 VariableDefined By
 InheritedonLoad : Function
A callback function to be invoked when this snapshot's data is loaded.
Snapshot
Public Methods
 MethodDefined By
  
RoomListSnapshot(qualifier:String = null, recursive:Boolean = false)
Constructor
RoomListSnapshot
  
getQualifier():String
Returns the qualifier of the rooms that are included in this snapshot.
RoomListSnapshot
  
getRecursive():Boolean
Indicates whether the room list for this snapshot includes rooms directly qualified by the specified qualifier only, or also all rooms qualified by all child qualifiers of the specified qualifier.
RoomListSnapshot
  
getRoomList():Array
Returns an array of the fully qualified roomIDs of the rooms with the qualifier specified by this snapshot.
RoomListSnapshot
 Inherited
getStatus():String
Returns the status of the most recent snapshot load-operation.
Snapshot
 Inherited
Indicates whether the snapshot is currently loading data.
Snapshot
Events
 Event Summary Defined By
 Inherited Dispatched when a snapshot object has been updated in response to an earlier call to Reactor's updateSnapshot() method.Snapshot
 Inherited Dispatched when the result of an update request has been received by a snapshot object.Snapshot
Constructor Description
RoomListSnapshot()Constructor
public function RoomListSnapshot(qualifier:String = null, recursive:Boolean = false)

Constructor

Parameters
qualifier:String (default = null) — The room id qualifier of the rooms that should be included in the list. For a server-wide room list, supply null for qualifier and true for recursive. For a list of rooms with no qualifier, supply null for qualifier and false for recursive. For a list of rooms with the qualifier "chat.sports", supply "chat.sports" for qualifier and false for recursive. In Reactor 1.0.0, recursion is supported when qualifier is null only.
 
recursive:Boolean (default = false) — Indicates whether the room list for this snapshot should include rooms directly qualified by the specified qualifier only, or also all rooms qualified by all child qualifiers of the specified qualifier. For Reactor 1.0.0, this parameter applies to the unnamed qualifier only (i.e., when the qualifier parameter is null).
Method Descriptions
getQualifier()method
public function getQualifier():String

Since : Reactor 1.0.0

Returns the qualifier of the rooms that are included in this snapshot.

Returns
String
getRecursive()method 
public function getRecursive():Boolean

Since : Reactor 1.0.0

Indicates whether the room list for this snapshot includes rooms directly qualified by the specified qualifier only, or also all rooms qualified by all child qualifiers of the specified qualifier.

Returns
Boolean
getRoomList()method 
public function getRoomList():Array

Since : Reactor 1.0.0

Returns an array of the fully qualified roomIDs of the rooms with the qualifier specified by this snapshot.

Returns
Array