Packagecom.pcbsys.nirvana.client
Classpublic class nRegisteredEvent
InheritancenRegisteredEvent Inheritance Object

This class enables a client to maintain a copy of an event, make changes to the properties and then when commit is called only the changes are published to the server. This enables a mechanism whereby only changes are published and not full events



Public Properties
 PropertyDefined By
  changeSize : int
[read-only] Returns the number of changes made since the last commitChanges was called
nRegisteredEvent
  data : ByteArray
Returns the byte[] data payload of the event
nRegisteredEvent
  primaryKeyName : String
[read-only] Retrieves the name of the primary key name used for this event.
nRegisteredEvent
  primaryKeyValue : Object
[read-only] Retrieves the unique value for the primary key used for this event
nRegisteredEvent
  properties : nEventProperties
[read-only] Retrieves the properties for the event.
nRegisteredEvent
  tag : String
Returns the string tag of the event
nRegisteredEvent
Public Methods
 MethodDefined By
  
commitChanges(transactionalCommittedCB:Function = null, replace:Boolean = false):void
Writes all changes to the server and resets any internal counts, timers and copies
nRegisteredEvent
  
Returns the time in milliseconds since the last change was made to the event.
nRegisteredEvent
Property Detail
changeSizeproperty
changeSize:int  [read-only]

Returns the number of changes made since the last commitChanges was called


Implementation
    public function get changeSize():int
dataproperty 
data:ByteArray

Returns the byte[] data payload of the event


Implementation
    public function get data():ByteArray
    public function set data(value:ByteArray):void
primaryKeyNameproperty 
primaryKeyName:String  [read-only]

Retrieves the name of the primary key name used for this event. This key name is setup during channel construction using the publish key API


Implementation
    public function get primaryKeyName():String
primaryKeyValueproperty 
primaryKeyValue:Object  [read-only]

Retrieves the unique value for the primary key used for this event


Implementation
    public function get primaryKeyValue():Object
propertiesproperty 
properties:nEventProperties  [read-only]

Retrieves the properties for the event. The client can then change the key/value pairs in the properties. When the commitChanges() is called all changes will be sent to the server


Implementation
    public function get properties():nEventProperties
tagproperty 
tag:String

Returns the string tag of the event


Implementation
    public function get tag():String
    public function set tag(value:String):void
Method Detail
commitChanges()method
public function commitChanges(transactionalCommittedCB:Function = null, replace:Boolean = false):void

Writes all changes to the server and resets any internal counts, timers and copies

Parameters
transactionalCommittedCB:Function (default = null) — This is called if the isTransactional flag is set to true on completion on the commit
 
replace:Boolean (default = false) — if true the server will replace the referenced event with a complete copy of this event and will not merge any data from previous events.


Throws
nIllegalArgumentError — Illegal parameter, check the message for more information
 
nTransactionError — thrown if any transactional errors occur
timeSinceLastChange()method 
public function timeSinceLastChange():Number

Returns the time in milliseconds since the last change was made to the event. If no change then the function will return 0

Returns
Number — time in milliseconds since the last change