Packagecom.adobe.rtc.sharedManagers
Classpublic class UserManager
InheritanceUserManager Inheritance flash.events.EventDispatcher
ImplementsISessionSubscriber

UserManager is one of the "four pillars" of a room and is tasked with maintaining a list of the set of users in the room, along with their descriptors. It is also the primary class through which one publishes changes to a user role or other user information.

Each IConnectSession handles the creation and setup of its own UserManager instance. Use an IConnectSession userManager property to access it.

Building a basic roster list
  <rtc:AdobeHSAuthenticator userName="AdobeIDusername password="AdobeIDpassword" id="auth"/>
  <session:ConnectSessionContainer 
    id="cSession" 
    roomURL="http://connect.acrobat.com/fakeRoom/" 
    authenticator="{auth}">
    
      <mx:List width="300" height="600" dataProvider="{cSession.userManager.userCollection}" 
      labelField="displayName"/>
  </session:ConnectSessionContainer> 
<session:ConnectSessionContainer id="cSession" roomURL="http://connect.acrobat.com/fakeRoom/" authenticator="{auth}"> </session:ConnectSessionContainer>

See also

com.adobe.rtc.sharedManagers.descriptors.UserDescriptor
com.adobe.rtc.events.UserEvent
com.adobe.rtc.session.IConnectSession


Public Properties
 PropertyDefined by
  anonymousPresence : Boolean
Determines whether all the others users in the room be revealed.
UserManager
  audienceCollection : ArrayCollection
[Read-only] Returns a sorted collection of user descriptors with root user roles of UserRoles.VIEWER.
UserManager
  connectSession : IConnectSession
(Read Only) Specifies the IConnectSession to which this manager is assigned.
UserManager
  customFieldNames : Array
[read-only] Returns the list of all the custom fields created.
UserManager
  hostCollection : ArrayCollection
[Read-only] Returns a sorted collection of user descriptors with root user roles of UserRoles.OWNER.
UserManager
  isSynchronized : Boolean
[read-only] Specifies whether or not the UserManager has connected and has synchronized all of the user information from the service.
UserManager
  myBuddyList : Array
An array of userIDs, which represents the set of users which might be listening for the current user's updates Note, this isn't the set of users the current user is listening for, but rather the inverse.
UserManager
  myUserAffiliation : int
[read-only] Specifies the current user's affiliation.
UserManager
  myUserID : String
[read-only] The current user's userID.
UserManager
  myUserRole : int
[read-only] Specifies the current user's role.
UserManager
  participantCollection : ArrayCollection
[Read-only] Returns a sorted collection of user descriptors with root user roles of UserRoles.PUBLISHER.
UserManager
  userCollection : ArrayCollection
[Read-only] Returns a sorted collection of user descriptors.
UserManager
Public Methods
 MethodDefined by
  
UserManager
  
canUserConfigure(p_userID:String):Boolean
Determines whether or not the given user has power to make modifications to other users.
UserManager
  
deleteCustomUserField(p_fieldName:String):void
Deletes a custom field for used in the customField Object).
UserManager
  
Fetches all available details about the specified user.
UserManager
  
getUserRole(p_userID:String, p_nodeName:String = null):int
Gets the role of the specified user for a particular node.
UserManager
  
isPeerEnable():Boolean
This function checks if anyone has peer to peer disabled.
UserManager
  
registerCustomUserField(p_fieldName:String):void
Registers a custom field for use in the userDescriptor (will appear in the CustomField Object).
UserManager
  
removeUser(p_userID:String):void
Removes a specified user from the room, thereby ejecting that user.
UserManager
  
setCustomUserField(p_userID:String, p_fieldName:String, p_value:*):void
Custom User Fields are used to store extended info about a particular user (for example, phone status, "I have a question", etc).
UserManager
  
setPeer(p_userID:String, p_isPeer:Boolean):void
Modifies the isPeer property of a given user.
UserManager
  
setPingData(p_userID:String, p_latency:int, p_drops:int):void
Publishes a ping data update.
UserManager
  
setUserConnection(p_userID:String, p_conn:String, p_forceUpdate:Boolean = false):void
Sets the user's connection to one of the following:
  • RoomSettings.MODEM
  • RoomSettings.DSL
  • RoomSettings.LAN
Note: If the UserManager.anonymousPresence is set to true, then this method might fail if the user's userDescriptor has not been fetched.
UserManager
  
setUserDisplayName(p_userID:String, p_name:String):void
Modifies the displayName of a given user.
UserManager
  
setUserRole(p_userID:String, p_role:int):void
Promotes or demotes the specified user at the "root level".
UserManager
  
setUserUsericonURL(p_userID:String, p_usericonURL:String):void
Sets the URL for the user's avatar icon.
UserManager
Protected Methods
 MethodDefined by
  
UserManager
  
UserManager
  
UserManager
  
fetchUserDescriptor(p_userID:String):void
UserManager
Events
 EventSummaryDefined by
   Dispatched when anonymousPresence is set in the UserManager UserManager
   Dispatched when a custom field value for a user has changed.UserManager
   Dispatched when a custom field for a user is deleted.UserManager
   Dispatched when a custom field for a user is registered.UserManager
   Dispatched when the UserManager has received everything up to the current state of the room or has lost the connection.UserManager
   Dispatched when a user is forcibly ejected from the room.UserManager
   Dispatched when a user's connection speed has changed.UserManager
   Dispatched when a new user joins the room.UserManager
   Dispatched when the user's displayName has changed.UserManager
   Dispatched when a user's ping data has changed.UserManager
   Dispatched when a user leaves the room.UserManager
   Dispatched when the user's role has changed.UserManager
   Dispatched when a user's icon URL has changed.UserManager
Public Constants
 ConstantDefined by
  COLLECTION_NAME : String = "UserManager"
[static] The name of the collectionNode UserManager uses to build its shared model.
UserManager
Protected Constants
 ConstantDefined by
  SIMPLE_BUDDY_PRESENCE_CHANGE : String = "here"
[static]
UserManager
Property detail
anonymousPresenceproperty
anonymousPresence:Boolean  [read-write]

Determines whether all the others users in the room be revealed. Upon setting this property to true, users aren't revealed until explicitly called for. UserManager.userCollection and getUserDescriptor won't have any entry for any user (other than one's self) unless there's a specific request for that user. Any call to the getUserDescriptor will cause the UserManager to fetch that particular UserDescriptor and cache it, dispatching the usual userCreate event.

Implementation
    public function get anonymousPresence():Boolean
    public function set anonymousPresence(value:Boolean):void
audienceCollectionproperty 
public var audienceCollection:ArrayCollection

[Read-only] Returns a sorted collection of user descriptors with root user roles of UserRoles.VIEWER.

This property can be used as the source for data binding.

connectSessionproperty 
connectSession:IConnectSession  [read-write]

(Read Only) Specifies the IConnectSession to which this manager is assigned.

Implementation
    public function get connectSession():IConnectSession
    public function set connectSession(value:IConnectSession):void
customFieldNamesproperty 
customFieldNames:Array  [read-only]

Returns the list of all the custom fields created.

Implementation
    public function get customFieldNames():Array
hostCollectionproperty 
public var hostCollection:ArrayCollection

[Read-only] Returns a sorted collection of user descriptors with root user roles of UserRoles.OWNER.

This property can be used as the source for data binding.

isSynchronizedproperty 
isSynchronized:Boolean  [read-only]

Specifies whether or not the UserManager has connected and has synchronized all of the user information from the service.

Implementation
    public function get isSynchronized():Boolean
myBuddyListproperty 
myBuddyList:Array  [read-write]

An array of userIDs, which represents the set of users which might be listening for the current user's updates Note, this isn't the set of users the current user is listening for, but rather the inverse. The current user would notify users in the Array about all his activities. In other words the users in the Array users are listening to the current user even if he is not listening to them.

Implementation
    public function get myBuddyList():Array
    public function set myBuddyList(value:Array):void
myUserAffiliationproperty 
myUserAffiliation:int  [read-only]

Specifies the current user's affiliation.

Implementation
    public function get myUserAffiliation():int

See also

myUserIDproperty 
myUserID:String  [read-only]

The current user's userID.

Implementation
    public function get myUserID():String
myUserRoleproperty 
myUserRole:int  [read-only]

Specifies the current user's role.

This property can be used as the source for data binding.

Implementation
    public function get myUserRole():int
participantCollectionproperty 
public var participantCollection:ArrayCollection

[Read-only] Returns a sorted collection of user descriptors with root user roles of UserRoles.PUBLISHER.

This property can be used as the source for data binding.

userCollectionproperty 
public var userCollection:ArrayCollection

[Read-only] Returns a sorted collection of user descriptors.

This property can be used as the source for data binding.

Constructor detail
UserManager()constructor
public function UserManager()
Method detail
anonymousUserRemoved()method
protected function anonymousUserRemoved(p_evt:CollectionNodeEvent):voidParameters
p_evt:CollectionNodeEvent
canUserConfigure()method 
public function canUserConfigure(p_userID:String):Boolean

Determines whether or not the given user has power to make modifications to other users.

Parameters
p_userID:String — The ID of the user in question.

Returns
Boolean — True if the user can make modifications; false if not.
createBuddyNode()method 
protected function createBuddyNode():void
createUserManagerNodes()method 
protected function createUserManagerNodes():void
deleteCustomUserField()method 
public function deleteCustomUserField(p_fieldName:String):void

Deletes a custom field for used in the customField Object). Only hosts are allowed to create deleteFields.

Parameters
p_fieldName:String — The name of the custom field to be deleted
fetchUserDescriptor()method 
protected function fetchUserDescriptor(p_userID:String):voidParameters
p_userID:String
getUserDescriptor()method 
public function getUserDescriptor(p_userID:String):UserDescriptor

Fetches all available details about the specified user. If anonymousPresence is set to true, the method migth return a null if UserDescriptor was never fetched. In such a situation we must listen to UserEvent.USER_CREATE event and update the User's UserDescriptor we wanted. Note: If the UserManager.anonymousPresence is set to true, then this method might fail if the user's userDescriptor has not been fetched. So it is adviced to call this method after the required userDescriptor's are fetched.In other words listen to UserEvent.USER_CREATE event and call this method after the required userDescriptor's are fetched.

Parameters
p_userID:String — The unique ID of the user being queried.

Returns
UserDescriptor — The UserDescriptor of the specified user.
getUserRole()method 
public function getUserRole(p_userID:String, p_nodeName:String = null):int

Gets the role of the specified user for a particular node.

Parameters
p_userID:String — The specified user's userID.
 
p_nodeName:String (default = null) — The group name on which we are getting the user roles, default is null

Returns
int — int which is the user role value
isPeerEnable()method 
public function isPeerEnable():Boolean

This function checks if anyone has peer to peer disabled. i.e. behind firewall or something...

Returns
Boolean
registerCustomUserField()method 
public function registerCustomUserField(p_fieldName:String):void

Registers a custom field for use in the userDescriptor (will appear in the CustomField Object). Only hosts are allowed to create regisfields, but users can publish them once

Parameters
p_fieldName:String — The name of the new custom field
removeUser()method 
public function removeUser(p_userID:String):void

Removes a specified user from the room, thereby ejecting that user.

Parameters
p_userID:String — the userID of the desired ejectee
setCustomUserField()method 
public function setCustomUserField(p_userID:String, p_fieldName:String, p_value:*):void

Custom User Fields are used to store extended info about a particular user (for example, phone status, "I have a question", etc). A custom field must be registered before it can be modified. Custom fields are modifiable by the given user or a host.

Parameters
p_userID:String — The user to be modified
 
p_fieldName:String — The name of the custom field to modify
 
p_value:* — The new value for the custom field (null to delete)
setPeer()method 
public function setPeer(p_userID:String, p_isPeer:Boolean):void

Modifies the isPeer property of a given user. Note that only OWNERs and the user in question are able to change the user's displayName. This shows whether an user can do p2p streaming.

Parameters
p_userID:String — The userID of the specified user
 
p_isPeer:Boolean — The new displayName to assign to that user
setPingData()method 
public function setPingData(p_userID:String, p_latency:int, p_drops:int):void

Publishes a ping data update.

Parameters
p_userID:String — The userID of the user to update.
 
p_latency:int — The new latency statistic.
 
p_drops:int — The new drops statistic.
setUserConnection()method 
public function setUserConnection(p_userID:String, p_conn:String, p_forceUpdate:Boolean = false):void

Sets the user's connection to one of the following:

Note: If the UserManager.anonymousPresence is set to true, then this method might fail if the user's userDescriptor has not been fetched. So it is adviced to call this method after the required userDescriptor's are fetched.In other words listen to UserEvent.USER_CREATE event and call this method after the required userDescriptor's are fetched.

Parameters
p_userID:String — The userID of the user the change.
 
p_conn:String — The new connection speed value which is one of the RoomSetting constants.
 
p_forceUpdate:Boolean (default = false) — Whether or not the update should be forced; the default is false.
setUserDisplayName()method 
public function setUserDisplayName(p_userID:String, p_name:String):void

Modifies the displayName of a given user. Note that only OWNERs and the user in question are able to change the user's displayName. Note: If the UserManager.anonymousPresence is set to true, then this method might fail if the user's userDescriptor has not been fetched. So it is adviced to call this method after the required userDescriptor's are fetched.In other words listen to UserEvent.USER_CREATE event and call this method after the required userDescriptor's are fetched.

Parameters
p_userID:String — The userID of the specified user
 
p_name:String — The new displayName to assign to that user
setUserRole()method 
public function setUserRole(p_userID:String, p_role:int):void

Promotes or demotes the specified user at the "root level". This is the primary way to change a user's role (although it's also possible to change a user's role relative to a specific CollectionNode within the application). Note that only users with an owner role at the root level may call this method.

Parameters
p_userID:String — The unique ID of the user to affect
 
p_role:int — The new role for the user

See also

setUserUsericonURL()method 
public function setUserUsericonURL(p_userID:String, p_usericonURL:String):void

Sets the URL for the user's avatar icon. Note: If the UserManager.anonymousPresence is set to true, then this method might fail if the user's userDescriptor has not been fetched. So it is adviced to call this method after the required userDescriptor's are fetched.In other words listen to UserEvent.USER_CREATE event and call this method after the required userDescriptor's are fetched.

Parameters
p_userID:String — The userID of the user specified.
 
p_usericonURL:String — the URL of the icon desired.
Event detail
anonymousPresenceChangeevent 
Event object type: com.adobe.rtc.events.UserEvent

Dispatched when anonymousPresence is set in the UserManager

customFieldChangeevent  
Event object type: com.adobe.rtc.events.UserEvent

Dispatched when a custom field value for a user has changed.

customFieldDeleteevent  
Event object type: com.adobe.rtc.events.UserEvent

Dispatched when a custom field for a user is deleted.

customFieldRegisterevent  
Event object type: com.adobe.rtc.events.UserEvent

Dispatched when a custom field for a user is registered.

synchronizationChangeevent  
Event object type: com.adobe.rtc.events.UserEvent

Dispatched when the UserManager has received everything up to the current state of the room or has lost the connection.

userBootedevent  
Event object type: com.adobe.rtc.events.UserEvent

Dispatched when a user is forcibly ejected from the room.

userConnectionChangeevent  
Event object type: com.adobe.rtc.events.UserEvent

Dispatched when a user's connection speed has changed.

userCreateevent  
Event object type: com.adobe.rtc.events.UserEvent

Dispatched when a new user joins the room.

userNameChangeevent  
Event object type: com.adobe.rtc.events.UserEvent

Dispatched when the user's displayName has changed.

userPingDataChangeevent  
Event object type: com.adobe.rtc.events.UserEvent

Dispatched when a user's ping data has changed.

userRemoveevent  
Event object type: com.adobe.rtc.events.UserEvent

Dispatched when a user leaves the room.

userRoleChangeevent  
Event object type: com.adobe.rtc.events.UserEvent

Dispatched when the user's role has changed.

userUsericonURLChangeevent  
Event object type: com.adobe.rtc.events.UserEvent

Dispatched when a user's icon URL has changed.

Constant detail
COLLECTION_NAMEconstant
public static const COLLECTION_NAME:String = "UserManager"

The name of the collectionNode UserManager uses to build its shared model.

SIMPLE_BUDDY_PRESENCE_CHANGEconstant 
protected static const SIMPLE_BUDDY_PRESENCE_CHANGE:String = "here"




 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/labs/acrobatcom/com/adobe/rtc/sharedManagers/UserManager.html