Packagecom.adobe.rtc.sharedModel
Classpublic class BatonProperty
InheritanceBatonProperty Inheritance SharedProperty Inheritance flash.events.EventDispatcher
ImplementsISessionSubscriber

BatonProperty is a model component which manages a property of any type that only one user can edit at a time. It exposes a standard Baton component to manage this workflow.

This component 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 BatonProperty to use. If none is supplied, the BatonProperty will create its own CollectionNode for sending and receiving messages.

See also

com.adobe.rtc.sharedModel.Baton
com.adobe.rtc.sharedModel.CollectionNode


Public Properties
 PropertyDefined by
  accessModel : int
Role value which is required for accessing the property value
BatonProperty
  baton : Baton
[read-only] Returns a reference to the Baton used by this BatonProperty.
BatonProperty
 InheritedcanIEdit : Boolean
Determines whether the current user can edit the property.
SharedProperty
  collectionNode : CollectionNode
Sets the CollectionNode to be used in setting up the property and baton nodes, when used in "piggybacking"
BatonProperty
 InheritedconnectSession : IConnectSession
The IConnectSession with which this component is associated.
SharedProperty
 InheritedisSessionDependent : Boolean
Sets true or false whether the it should depend on the session, default is false
SharedProperty
 InheritedisSynchronized : Boolean
Determines whether the SharedProperty is connected and fully synchronized with the service.
SharedProperty
 InheritednodeName : String
Sets the Node Name to which the value is published
SharedProperty
  nodeNameBaton : String
When used with "piggybacking" on an existing CollectionNode, specifies the node name for the baton
BatonProperty
  publishModel : int
Role Value required to publish on the property
BatonProperty
  sharedID : String
Gets the sharedId
BatonProperty
 InheritedupdateInterval : uint
Sets the update Interval(in milliseconds) , defaults to 0.
SharedProperty
  value : *
The value of the BatonProperty which a user can only set it if the user is in control of it.
BatonProperty
Public Methods
 MethodDefined by
  
Constructor.
BatonProperty
  
allowUserToEdit(p_userID:String):void
Allows the current user with an owner role to grant the specified user the ability to edit the property.
BatonProperty
  
canUserEdit(p_userID:String):Boolean
Determines whether the specified user can edit the property.
BatonProperty
  
close():void
Cleans up all listeners and network connections: recommended for garbage collection.
BatonProperty
 Inherited
getAsBoolean():Boolean
Returns value as a Boolean.
SharedProperty
 Inherited
getAsNumber():Number
Returns value as a Number.
SharedProperty
 Inherited
getAsString():String
Returns value as a String.
SharedProperty
 Inherited
Gets the NodeConfiguration of the SharedProperty Node.
SharedProperty
  
getUserRole(p_userID:String):int
Returns the role of a given user for the property.
BatonProperty
 Inherited
setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):void
Sets the NodeConfiguration on the SharedProperty node.
SharedProperty
  
setUserRole(p_userID:String, p_userRole:int):void
Sets the role of a given user for the property.
BatonProperty
  
subscribe():void
Tells the component to begin synchronizing with the service.
BatonProperty
Events
 EventSummaryDefined by
   Dispatched when the baton holder for the string is assigned or when the string becomes available.BatonProperty
 Inherited Dispatched when the value of the property is changed: it is subject to round tripping to the service.SharedProperty
 Inherited Dispatched when the user's role with respect to this SharedProperty changes.SharedProperty
 Inherited Dispatched when the SharedProperty goes in and out of sync.SharedProperty
Property detail
accessModelproperty
accessModel:int  [read-write]

Role value which is required for accessing the property value

Implementation
    public function get accessModel():int
    public function set accessModel(value:int):void
batonproperty 
baton:Baton  [read-only]

Returns a reference to the Baton used by this BatonProperty.

Implementation
    public function get baton():Baton
collectionNodeproperty 
collectionNode:CollectionNode  [read-write]

Sets the CollectionNode to be used in setting up the property and baton nodes, when used in "piggybacking"

Implementation
    public function get collectionNode():CollectionNode
    public function set collectionNode(value:CollectionNode):void
nodeNameBatonproperty 
nodeNameBaton:String  [read-write]

When used with "piggybacking" on an existing CollectionNode, specifies the node name for the baton

Implementation
    public function get nodeNameBaton():String
    public function set nodeNameBaton(value:String):void
publishModelproperty 
publishModel:int  [read-write]

Role Value required to publish on the property

Implementation
    public function get publishModel():int
    public function set publishModel(value:int):void
sharedIDproperty 
sharedID:String  [read-write]

Gets the sharedId

Implementation
    public function get sharedID():String
    public function set sharedID(value:String):void
valueproperty 
value:*  [read-write]

The value of the BatonProperty which a user can only set it if the user is in control of it.

If the BatonProperty is not yet synchrnonized, the value will be cached and sent when the BatonProperty is back in sync.

If the BatonProperty is available, setting the value will also try to grab control of the BatonProperty before setting the text. Implementation
    public function get value():*
    public function set value(value:*):void

Constructor detail
BatonProperty()constructor
public function BatonProperty()

Constructor.

Method detail
allowUserToEdit()method
public override function allowUserToEdit(p_userID:String):void

Allows the current user with an owner role to grant the specified user the ability to edit the property.

Parameters
p_userID:String — The userID of the user being granted editing privileges.
canUserEdit()method 
public override function canUserEdit(p_userID:String):Boolean

Determines whether the specified user can edit the property.

Parameters
p_userID:String — The user to query regarding whether they can edit.

Returns
Boolean
close()method 
public override function close():void

Cleans up all listeners and network connections: recommended for garbage collection.

getUserRole()method 
public override function getUserRole(p_userID:String):int

Returns the role of a given user for the property.

Parameters
p_userID:String — UserID of the user in question

Returns
int
setUserRole()method 
public override function setUserRole(p_userID:String, p_userRole:int):void

Sets the role of a given user for the property.

Parameters
p_userID:String — UserID of the user whose role we are setting
 
p_userRole:int — Role value we are setting
subscribe()method 
public override function subscribe():void

Tells the component to begin synchronizing with the service. For "headless" components such as this one, this method must be called explicitly.

Event detail
batonHolderChangeevent 
Event object type: com.adobe.rtc.events.SharedModelEvent

Dispatched when the baton holder for the string is assigned or when the string becomes available.





 

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/BatonProperty.html