Packagecom.pcbsys.nirvana.client
Classpublic class nConsumeEvent
InheritancenConsumeEvent Inheritance Object
Subclasses nProtobufEvent

This class represents a Nirvana event, which consists a tag and some data.



Public Properties
 PropertyDefined By
  attributes : nEventAttributes
Method that returns the nEventAttributes for this event
nConsumeEvent
  channelName : String
[read-only] This function will return the name of the channel that the event was delivered from.
nConsumeEvent
  dataGroupName : String
[read-only] Get the name of the nDataGroup that this event was published to
nConsumeEvent
  eventData : ByteArray
Gets the event data set for this event
nConsumeEvent
  eventID : Long
Gets the unique (for its channel) event id value
nConsumeEvent
  eventTag : String
Gets the event tag set for this event
nConsumeEvent
  isPersistent : Boolean
Returns the persistent flag.
nConsumeEvent
  isTransient : Boolean
Returns whether the event is transient.
nConsumeEvent
  properties : nEventProperties
Gets this event's properties
nConsumeEvent
  ttl : Long
Returns time to live for the event, how long will it be stored on disk in a mixed channel
nConsumeEvent
Public Methods
 MethodDefined By
  
nConsumeEvent(tag:String = null, properties:nEventProperties = null, data:ByteArray = null)
Constructs a new nConsumeEvent with the specified event properties and data.
nConsumeEvent
  
ack(ackCB:Function = null):void
Sends an ack for this event to the server
nConsumeEvent
  
hasAttributes():Boolean
Method indicating whether there is an nEventAttributes associated with this event
nConsumeEvent
  
hasData():Boolean
Checks whether the event has data
nConsumeEvent
  
hasProperties():Boolean
Checks whether the event has a dictionary
nConsumeEvent
  
rollback(rollbackCB:Function = null):void
Tells the server that it does not ack this event.
nConsumeEvent
Property Detail
attributesproperty
attributes:nEventAttributes

Method that returns the nEventAttributes for this event


Implementation
    public function get attributes():nEventAttributes
    public function set attributes(value:nEventAttributes):void
channelNameproperty 
channelName:String  [read-only]

This function will return the name of the channel that the event was delivered from.


Implementation
    public function get channelName():String
dataGroupNameproperty 
dataGroupName:String  [read-only]

Get the name of the nDataGroup that this event was published to


Implementation
    public function get dataGroupName():String
eventDataproperty 
eventData:ByteArray

Gets the event data set for this event


Implementation
    public function get eventData():ByteArray
    public function set eventData(value:ByteArray):void
eventIDproperty 
eventID:Long

Gets the unique (for its channel) event id value


Implementation
    public function get eventID():Long
    public function set eventID(value:Long):void
eventTagproperty 
eventTag:String

Gets the event tag set for this event


Implementation
    public function get eventTag():String
    public function set eventTag(value:String):void
isPersistentproperty 
isPersistent:Boolean

Returns the persistent flag. If true the event is stored to disk on the server


Implementation
    public function get isPersistent():Boolean
    public function set isPersistent(value:Boolean):void
isTransientproperty 
isTransient:Boolean

Returns whether the event is transient. If the event itself is transient, it will never be stored either in memory or on disk by the realm server, but simply discarded once it has been delivered to any consumers. This is the equivalent of publishing events on a Transient channel, however allows the transience to be specified on a per event basis.


Implementation
    public function get isTransient():Boolean
    public function set isTransient(value:Boolean):void
propertiesproperty 
properties:nEventProperties

Gets this event's properties


Implementation
    public function get properties():nEventProperties
    public function set properties(value:nEventProperties):void
ttlproperty 
ttl:Long

Returns time to live for the event, how long will it be stored on disk in a mixed channel


Implementation
    public function get ttl():Long
    public function set ttl(value:Long):void
Constructor Detail
nConsumeEvent()Constructor
public function nConsumeEvent(tag:String = null, properties:nEventProperties = null, data:ByteArray = null)

Constructs a new nConsumeEvent with the specified event properties and data. The event properties can be used to create filter rules.

Parameters
tag:String (default = null) — the event tag as a string
 
properties:nEventProperties (default = null) — the collection of key-value pairs that can be used for filter rules
 
data:ByteArray (default = null) — the event data ByteArray encoded
Method Detail
ack()method
public function ack(ackCB:Function = null):void

Sends an ack for this event to the server

Parameters
ackCB:Function (default = null) — the function to call upon finishing the ack of this message. Set this to null if you want a event to be dispatched, a listener will need to be added to the originating store, the event will be a nMessageActionEvent and the listener string is nAckedEventString


Throws
nSessionNotConnectedError — if you have been disconnected from the server
 
nSessionNotInitialisedError — if you have not initialised the session
hasAttributes()method 
public function hasAttributes():Boolean

Method indicating whether there is an nEventAttributes associated with this event

Returns
Boolean — true if nEventAttributes exists for this event
hasData()method 
public function hasData():Boolean

Checks whether the event has data

Returns
Boolean — a boolean as to whether or not there is eventData
hasProperties()method 
public function hasProperties():Boolean

Checks whether the event has a dictionary

Returns
Boolean — a boolean as to whether or not there is properties
rollback()method 
public function rollback(rollbackCB:Function = null):void

Tells the server that it does not ack this event.

Parameters
rollbackCB:Function (default = null) — the function to call upon finishing the roll back of this message. Set this to null if you want a event to be dispatched, a listener will need to be added to the originating store, the event will be a nMessageActionEvent and the listener string is nRolledBackEventString


Throws
nSessionNotConnectedError — if you have been disconnected from the server
 
nSessionNotInitialisedError — if you have not initialised the session