Packagecom.adobe.rtc.sharedModel
Classpublic class SharedProperty
InheritanceSharedProperty Inheritance flash.events.EventDispatcher
ImplementsISessionSubscriber
SubclassesBatonProperty

SharedProperty is a model (and ui-less component) that manages a variable of any type and which is shared amongst all users connected to the room.

Note that 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 SharedProperty to use. If none is supplied, the SharedProperty will create its own collectionNode for sending and receiving messages.

See also

com.adobe.rtc.sharedModel.CollectionNode


Public Properties
 PropertyDefined by
  accessModel : int
Role value which is required for access the property
SharedProperty
  canIEdit : Boolean
[read-only] Determines whether the current user can edit the property.
SharedProperty
  collectionNode : CollectionNode
Sets the Collection Node to which the shared property subscribes/publishes
SharedProperty
  connectSession : IConnectSession
The IConnectSession with which this component is associated.
SharedProperty
  isSessionDependent : Boolean
Sets true or false whether the it should depend on the session, default is false
SharedProperty
  isSynchronized : Boolean
[read-only] Determines whether the SharedProperty is connected and fully synchronized with the service.
SharedProperty
  nodeName : String
Sets the Node Name to which the value is published
SharedProperty
  publishModel : int
Role Value required to publish on the property
SharedProperty
  sharedID : String
Defines the logical location of the component on the service - typically this assigns the sharedID of the collectionNode used by the component.
SharedProperty
  updateInterval : uint
Sets the update Interval(in milliseconds) , defaults to 0.
SharedProperty
  value : *
The value of the SharedProperty which users can only set if canUserEdit is true.
SharedProperty
Public Methods
 MethodDefined by
  
Constructor.
SharedProperty
  
allowUserToEdit(p_userID:String):void
Allows the current user with an owner role to grant the specified user the ability to edit the property.
SharedProperty
  
canUserEdit(p_userID:String):Boolean
Determines whether the specified user can edit the property.
SharedProperty
  
close():void
Cleans up all networking and event handling; it is recommended for garbage collection.
SharedProperty
  
getAsBoolean():Boolean
Returns value as a Boolean.
SharedProperty
  
getAsNumber():Number
Returns value as a Number.
SharedProperty
  
getAsString():String
Returns value as a String.
SharedProperty
  
Gets the NodeConfiguration of the SharedProperty Node.
SharedProperty
  
getUserRole(p_userID:String):int
Returns the role of a given user for the property.
SharedProperty
  
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.
SharedProperty
  
subscribe():void
Tells the component to begin synchronizing with the service.
SharedProperty
Events
 EventSummaryDefined by
   Dispatched when the value of the property is changed: it is subject to round tripping to the service.SharedProperty
   Dispatched when the user's role with respect to this SharedProperty changes.SharedProperty
   Dispatched when the SharedProperty goes in and out of sync.SharedProperty
Property detail
accessModelproperty
accessModel:int  [read-write]

Role value which is required for access the property

Implementation
    public function get accessModel():int
    public function set accessModel(value:int):void
canIEditproperty 
canIEdit:Boolean  [read-only]

Determines whether the current user can edit the property.

Implementation
    public function get canIEdit():Boolean
collectionNodeproperty 
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
connectSessionproperty 
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.

Implementation
    public function get connectSession():IConnectSession
    public function set connectSession(value:IConnectSession):void
isSessionDependentproperty 
isSessionDependent:Boolean  [read-write]

Sets true or false whether the it should depend on the session, default is false

Implementation
    public function get isSessionDependent():Boolean
    public function set isSessionDependent(value:Boolean):void
isSynchronizedproperty 
isSynchronized:Boolean  [read-only]

Determines whether the SharedProperty is connected and fully synchronized with the service.

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

Implementation
    public function get isSynchronized():Boolean
nodeNameproperty 
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
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]

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.

Implementation
    public function get sharedID():String
    public function set sharedID(value:String):void
updateIntervalproperty 
updateInterval:uint  [read-write]

Sets the update Interval(in milliseconds) , defaults to 0. The Messages will get transmitted after that interval everytime if it is set.

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

The value of the SharedProperty which users can only set if canUserEdit is true. If the SharedProperty is not yet synchronized, the value will be cached and sent when the SharedProperty is back in sync.

Implementation
    public function get value():*
    public function set value(value:*):void
Constructor detail
SharedProperty()constructor
public function SharedProperty()

Constructor.

Method detail
allowUserToEdit()method
public 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 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 function close():void

Cleans up all networking and event handling; it is recommended for garbage collection.

getAsBoolean()method 
public function getAsBoolean():Boolean

Returns value as a Boolean.

Returns
Boolean
getAsNumber()method 
public function getAsNumber():Number

Returns value as a Number.

Returns
Number
getAsString()method 
public function getAsString():String

Returns value as a String.

Returns
String
getNodeConfiguration()method 
public function getNodeConfiguration():NodeConfiguration

Gets the NodeConfiguration of the SharedProperty Node.

Returns
NodeConfiguration
getUserRole()method 
public 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
setNodeConfiguration()method 
public function setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):void

Sets the NodeConfiguration on the SharedProperty node.

Parameters
p_nodeConfiguration:NodeConfiguration — The node Configuration of the shared property node to be set.
setUserRole()method 
public 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 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
changeevent 
Event object type: com.adobe.rtc.events.SharedPropertyEvent

Dispatched when the value of the property is changed: it is subject to round tripping to the service.

myRoleChangeevent  
Event object type: com.adobe.rtc.events.CollectionNodeEvent

Dispatched when the user's role with respect to this SharedProperty changes.

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

Dispatched when the SharedProperty goes in and out of sync.





 

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