| Package | com.adobe.rtc.sharedModel |
| Class | public class SharedProperty |
| Inheritance | SharedProperty flash.events.EventDispatcher |
| Implements | ISessionSubscriber |
| Subclasses | BatonProperty |
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
| Property | Defined 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 | ||
| value : *
The value of the SharedProperty which users can only set if
canUserEdit
is true. | SharedProperty | ||
| Method | Defined 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 | ||
| Event | Summary | Defined 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 | |||
| accessModel | property |
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
| canIEdit | property |
canIEdit:Boolean [read-only]Determines whether the current user can edit the property.
Implementation public function get canIEdit():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
| isSessionDependent | property |
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
| isSynchronized | property |
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
| 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 publish on the property
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
| value | property |
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.
public function get value():*
public function set value(value:*):void
| SharedProperty | () | constructor |
public function SharedProperty()Constructor.
| allowUserToEdit | () | method |
public function allowUserToEdit(p_userID:String):voidAllows the current user with an owner role to grant the specified user the ability to edit the property.
Parametersp_userID:String — The userID of the user being granted editing privileges.
|
| canUserEdit | () | method |
public function canUserEdit(p_userID:String):BooleanDetermines whether the specified user can edit the property.
Parametersp_userID:String — The user to query regarding whether they can edit.
|
Boolean |
| close | () | method |
public function close():voidCleans up all networking and event handling; it is recommended for garbage collection.
| getAsBoolean | () | method |
public function getAsBoolean():BooleanReturns value as a Boolean.
ReturnsBoolean |
| getAsNumber | () | method |
public function getAsNumber():NumberReturns value as a Number.
ReturnsNumber |
| getAsString | () | method |
public function getAsString():StringReturns value as a String.
ReturnsString |
| getNodeConfiguration | () | method |
public function getNodeConfiguration():NodeConfigurationGets the NodeConfiguration of the SharedProperty Node.
ReturnsNodeConfiguration |
| getUserRole | () | method |
public function getUserRole(p_userID:String):intReturns the role of a given user for the property.
Parametersp_userID:String — UserID of the user in question
|
int |
| setNodeConfiguration | () | method |
public function setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):voidSets the NodeConfiguration on the SharedProperty node.
Parametersp_nodeConfiguration:NodeConfiguration — The node Configuration of the shared property node to be set.
|
| setUserRole | () | method |
public function setUserRole(p_userID:String, p_userRole:int):voidSets the role of a given user for the property.
Parametersp_userID:String — UserID of the user whose role we are setting
|
|
p_userRole:int — Role value we are setting
|
| 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.
| change | event |
com.adobe.rtc.events.SharedPropertyEvent
Dispatched when the value of the property is changed: it is subject to round tripping to the service.
| myRoleChange | event |
com.adobe.rtc.events.CollectionNodeEvent
Dispatched when the user's role with respect to this SharedProperty changes.
| synchronizationChange | event |
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