| Package | com.adobe.rtc.sharedModel |
| Class | public class Baton |
| Inheritance | Baton flash.events.EventDispatcher |
| Implements | ISessionSubscriber |
grabbable property:
grabbable, they may grab the baton as soon
as it is available (since it will then have no controller).grabbable, the owner must explicitly pass the baton
to someone else.
extendTimer.
Note that users with an owner role may adjust the roles of other users relative to the
baton using allowUserToGrab (which makes that user a publisher) and
allowUserToAdminister (which makes that user an owner).
This component also supports "piggybacking" on existing CollectionNodes through its constructor.
Developers can avoid CollectionNode proliferation in their applications by pre-supplying a
CollectionNode and a nodeName for the baton to use. If none is supplied, the
baton will create its own collection node for sending and receiving messages.
See also
| Property | Defined by | ||
|---|---|---|---|
| accessModel : int
Role value which is required for seeing the baton
| Baton | ||
| amIHolding : Boolean [read-only]
Determines whether the current user is holding the baton.
| Baton | ||
| available : Boolean [read-only]
Determines whether the baton is up for grabs because it has no current holder.
| Baton | ||
| canIAdminister : Boolean [read-only]
Determines whether the current user has permission to administer the baton
by taking it from someone or forcing them to put it down.
| Baton | ||
| canIGrab : Boolean [read-only]
Determines whether the current user has permission to grab the baton
when available.
| Baton | ||
| collectionNode : CollectionNode
Sets the Collection Node to which the shared property subscribes/publishes
| Baton | ||
| connectSession : IConnectSession
The IConnectSession with which this component is associated.
| Baton | ||
| grabbable : Boolean
Whether or not to allow users with a publisher role to grab an available baton.
| Baton | ||
| holderID : String [read-only]
Specifies the
userID of the person controlling the baton. | Baton | ||
| isSynchronized : Boolean [read-only]
Determines whether the component has connected to the server and has fully synchronized.
| Baton | ||
| nodeName : String
Sets the Node Name to which the value is published
| Baton | ||
| publishModel : int
Role Value required to grab the baton
| Baton | ||
| sharedID : String
Defines the logical location of the component on the service - typically this assigns the sharedID of the collectionNode
used by the component.
| Baton | ||
| timeOut : int
Number of seconds after which the baton times out
If 0, no timeout is used.
| Baton | ||
| Method | Defined by | ||
|---|---|---|---|
|
Baton()
Constructor.
| Baton | ||
|
canUserAdminister(p_userID:String):Boolean
Determines whether a specified user can administer the baton from others.
| Baton | ||
|
canUserGrab(p_userID:String):Boolean
Determines whether a specified user can grab the baton if it's available.
| Baton | ||
|
close():void
Cleans up all networking and event handling; recommended for garbage collection.
| Baton | ||
|
extendTimer():void
Extends the timeout if the baton has one.
| Baton | ||
|
Gets the NodeConfiguration of the Baton Node.
| Baton | ||
|
getUserRole(p_userID:String):int
Returns the role of a given user for the baton.
| Baton | ||
|
giveTo(p_userID:String):void
If the baton is grabbable, the holding user can hand the baton to a specified user.
| Baton | ||
|
grab():void
If grabbable, users with a publisher role can grab the control if it's available
by using this method.
| Baton | ||
|
putDown():void
Users with an publisher role in control can use this method to
release their control.
| Baton | ||
|
setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):void
Sets the NodeConfiguration on the baton node.
| Baton | ||
|
setUserRole(p_userID:String, p_role:Number):void
When called by an owner,
setUserRole() sets the role of the specified
user with respect to this baton. | Baton | ||
|
subscribe():void
Tells the component to begin synchronizing with the service.
| Baton | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when the baton is given to someone or put down. | Baton | |||
| Dispatched when the component has fully connected and synchronized with the service or when it loses the connection. | Baton | |||
| accessModel | property |
accessModel:int [read-write]Role value which is required for seeing the baton
Implementation public function get accessModel():int
public function set accessModel(value:int):void
| amIHolding | property |
amIHolding:Boolean [read-only]Determines whether the current user is holding the baton.
Implementation public function get amIHolding():Boolean
| available | property |
available:Boolean [read-only]Determines whether the baton is up for grabs because it has no current holder.
Implementation public function get available():Boolean
| canIAdminister | property |
canIAdminister:Boolean [read-only]Determines whether the current user has permission to administer the baton by taking it from someone or forcing them to put it down.
Implementation public function get canIAdminister():Boolean
| canIGrab | property |
canIGrab:Boolean [read-only]Determines whether the current user has permission to grab the baton when available.
Implementation public function get canIGrab():Boolean
| collectionNode | property |
collectionNode:CollectionNode [read-write]Sets the Collection Node to which the shared property subscribes/publishes
Implementation public function get collectionNode():CollectionNode
public function set collectionNode(value:CollectionNode):void
| connectSession | property |
connectSession:IConnectSession [read-write]
The IConnectSession with which this component is associated. Note that this may only be set once before subscribe
is called; re-sessioning of components is not supported. Defaults to the first IConnectSession created in the application.
public function get connectSession():IConnectSession
public function set connectSession(value:IConnectSession):void
| grabbable | property |
grabbable:Boolean [read-write]Whether or not to allow users with a publisher role to grab an available baton. When false, the baton can only be handed off by users with an owner role.
Implementation public function get grabbable():Boolean
public function set grabbable(value:Boolean):void
| holderID | property |
holderID:String [read-only]
Specifies the userID of the person controlling the baton. Returns null if
noone has the baton. For example, this function might be used to create a "controlled
by XXX" tooltip for your component.
public function get holderID():String
| isSynchronized | property |
isSynchronized:Boolean [read-only]Determines whether the component has connected to the server and has fully synchronized.
This property can be used as the source for data binding.
Implementation public function get isSynchronized():Boolean
See also
| nodeName | property |
nodeName:String [read-write]Sets the Node Name to which the value is published
Implementation public function get nodeName():String
public function set nodeName(value:String):void
| publishModel | property |
publishModel:int [read-write]Role Value required to grab the baton
Implementation public function get publishModel():int
public function set publishModel(value:int):void
| sharedID | property |
sharedID:String [read-write]
Defines the logical location of the component on the service - typically this assigns the sharedID of the collectionNode
used by the component. sharedIDs should be unique within a room (if they're expressing 2 unique locations). Note that
this can only be assigned once (before subscribe() is called). For components with an id property,
sharedID defaults to that value.
public function get sharedID():String
public function set sharedID(value:String):void
| timeOut | property |
timeOut:int [read-write]Number of seconds after which the baton times out If 0, no timeout is used.
Implementation public function get timeOut():int
public function set timeOut(value:int):void
| Baton | () | constructor |
public function Baton()Constructor.
| canUserAdminister | () | method |
public function canUserAdminister(p_userID:String):BooleanDetermines whether a specified user can administer the baton from others.
Parametersp_userID:String — The userID of the user to check if they have
adminstrator rights.
|
Boolean |
| canUserGrab | () | method |
public function canUserGrab(p_userID:String):BooleanDetermines whether a specified user can grab the baton if it's available.
Parametersp_userID:String — The userID of the user to check if they
can grab the baton.
|
Boolean |
| close | () | method |
public function close():voidCleans up all networking and event handling; recommended for garbage collection.
| extendTimer | () | method |
public function extendTimer():voidExtends the timeout if the baton has one.
| getNodeConfiguration | () | method |
public function getNodeConfiguration():NodeConfigurationGets the NodeConfiguration of the Baton Node.
ReturnsNodeConfiguration |
| getUserRole | () | method |
public function getUserRole(p_userID:String):intReturns the role of a given user for the baton.
Parametersp_userID:String — UserID of the user in question
|
int |
| giveTo | () | method |
public function giveTo(p_userID:String):voidIf the baton is grabbable, the holding user can hand the baton to a specified user. A user with an owner role can give a baton to anyone with the required permissions at any time.
Parametersp_userID:String — The userID of the user to allow to grab the baton.
|
| grab | () | method |
public function grab():voidIf grabbable, users with a publisher role can grab the control if it's available by using this method. Users with an owner role may grab the baton at any time.
| putDown | () | method |
public function putDown():voidUsers with an publisher role in control can use this method to release their control. Users with an owner role can use this method to remove the baton from a user who has it.
| setNodeConfiguration | () | method |
public function setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):voidSets the NodeConfiguration on the baton node.
Parametersp_nodeConfiguration:NodeConfiguration — The node Configuration of the baton node to be set.
|
| setUserRole | () | method |
public function setUserRole(p_userID:String, p_role:Number):void
When called by an owner, setUserRole() sets the role of the specified
user with respect to this baton. The following rules apply:
UserRoles.PUBLISHER allows the user to grab the baton. UserRoles.OWNER allows the user to administer the baton.UserRoles.VIEWER will allow neither.p_userID:String — The userID of the user to set the role for.
|
|
p_role:Number — The new role for that user.
|
| subscribe | () | method |
public function subscribe():voidTells the component to begin synchronizing with the service. For "headless" components such as this one, this method must be called explicitly.
| batonHolderChange | event |
com.adobe.rtc.events.SharedModelEvent
Dispatched when the baton is given to someone or put down.
| synchronizationChange | event |
com.adobe.rtc.events.CollectionNodeEvent
Dispatched when the component has fully connected and synchronized with the service or when it loses the connection.
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/sharedModel/Baton.html