Packagecom.pcbsys.nirvana.client
Classpublic class nTransaction
InheritancenTransaction Inheritance flash.events.EventDispatcher

This class enables the client to perform transactional publishing, representing a nirvana transaction



Public Properties
 PropertyDefined By
  attributes : nTransactionAttributes
[read-only] Gets the transaction attributes object associated with this transaction
nTransaction
  endEID : Long
[read-only] Gets the end event id of the range to be published by this transaction
nTransaction
  StartEID : Long
[read-only] Gets the start event id of the range to be published by this transaction
nTransaction
  txId : Long
[read-only] Gets the end transaction id associated with this transaction
nTransaction
Public Methods
 MethodDefined By
  
nTransaction(attributes:nTransactionAttributes, transactionCB:Function, oldTXId:Long)
nTransaction
  
abort():void
Aborts the transaction associated with the txId and this channel.
nTransaction
  
commit(delay:Number = 0):void
Commits the transaction id associated to this channel on the server.
nTransaction
  
isAborted(isAbortedCB:Function = null):void
Checks if this transaction is aborted
nTransaction
  
isCommitted(isCommittedCB:Function = null):void
Checks if this transaction is committed
nTransaction
  
publish(eventArray:Array):void
Adds the specified nConsumeEvent to this transaction.
nTransaction
  
push(event:nConsumeEvent):void
Pushes the specified nConsumeEvent to this transaction.
nTransaction
Public Constants
 ConstantDefined By
  nTransactionAbortedEventString : String = nTransactionAbortedEventString
[static] String is used for nTransactionAbortedEvent dispatching
nTransaction
  nTransactionCommittedEventString : String = nTransactionCommittedEventString
[static] String is used for nTransactionCommittedEvent dispatching
nTransaction
  nTransactionEventString : String = nTransactionEventString
[static] String is used for nTransactionEvent dispatching
nTransaction
  nTransactionFailedEventString : String = nTransactionFailedEventString
[static] String is used for nTransactionFailedEvent dispatching
nTransaction
Property Detail
attributesproperty
attributes:nTransactionAttributes  [read-only]

Gets the transaction attributes object associated with this transaction


Implementation
    public function get attributes():nTransactionAttributes
endEIDproperty 
endEID:Long  [read-only]

Gets the end event id of the range to be published by this transaction


Implementation
    public function get endEID():Long

Throws
nTransactionNotCommittedError — is thrown if the transaction is not yet committed
StartEIDproperty 
StartEID:Long  [read-only]

Gets the start event id of the range to be published by this transaction


Implementation
    public function get StartEID():Long

Throws
nTransactionNotCommittedError — is thrown if the transaction is not yet committed
txIdproperty 
txId:Long  [read-only]

Gets the end transaction id associated with this transaction


Implementation
    public function get txId():Long
Constructor Detail
nTransaction()Constructor
public function nTransaction(attributes:nTransactionAttributes, transactionCB:Function, oldTXId:Long)



Parameters
attributes:nTransactionAttributes
 
transactionCB:Function
 
oldTXId:Long
Method Detail
abort()method
public function abort():void

Aborts the transaction associated with the txId and this channel.


Throws
nTransactionNotStartedError — The transaction has not been started
 
nTransactionNoSuchTXIDError — There is no known TXID, typically the transaction has timed out
 
nTransactionAlreadyCommittedError — The transaction has already been committed
 
nTransactionAlreadyAbortedError — The transaction has already been aborted
 
nSessionNotConnectedError — if you have been disconnected from the server
 
nSessionNotInitialisedError — if you have not initialised the session
commit()method 
public function commit(delay:Number = 0):void

Commits the transaction id associated to this channel on the server. We then wait for the server to respond. The server responds with the EID's of the events that have been put on to this channel for the supplied transaction id. Once this process is complete we remove the supplied transaction id from the list of transactions found within the controlling nSession.

Parameters
delay:Number (default = 0) — - the number of milliseconds to delay the commit for at the server


Throws
nTransactionNotStartedError — The transaction has not been started
 
nTransactionNoSuchTXIDError — There is no known txId, typically the transaction has timed out
 
nTransactionAlreadyCommittedError — The transaction has already been committed
 
nTransactionAlreadyAbortedError — The transaction has already been aborted
 
nSessionNotConnectedError — if you have been disconnected from the server
 
nSessionNotInitialisedError — if you have not initialised the session
isAborted()method 
public function isAborted(isAbortedCB:Function = null):void

Checks if this transaction is aborted

Parameters
isAbortedCB:Function (default = null) — a function callback that accepts a Boolean or Error


Throws
nTransactionIncompleteError — the transaction is invalid or incomplete. Set to null if you want a event dispatched, the event will be a nTransactionStatusEvent the listenerString will be nTransactionAbortedEventString.
 
nSessionNotConnectedError — if you have been disconnected from the server
 
nSessionNotInitialisedError — if you have not initialised the session
isCommitted()method 
public function isCommitted(isCommittedCB:Function = null):void

Checks if this transaction is committed

Parameters
isCommittedCB:Function (default = null) — a function callback that accepts a Boolean or Error


Throws
nTransactionIncompleteError — the transaction is invalid or incomplete. Set to null if you want a event dispatched, the event will be a nTransactionStatusEvent the listenerString will be nTransactionCommittedEventString.
 
nSessionNotConnectedError — if you have been disconnected from the server
 
nSessionNotInitialisedError — if you have not initialised the session
publish()method 
public function publish(eventArray:Array):void

Adds the specified nConsumeEvent to this transaction. No events will be published until this transaction is committed

Parameters
eventArray:Array — the array of nConsumeEvent objects to be added to this transaction


Throws
nTransactionAlreadyCommittedError — The transaction has already been committed
 
nTransactionAlreadyAbortedError — The transaction has already been aborted
 
Error — If a null has been passed fo eventArray
 
nSessionNotConnectedError — if you have been disconnected from the server
 
nSessionNotInitialisedError — if you have not initialised the session
push()method 
public function push(event:nConsumeEvent):void

Pushes the specified nConsumeEvent to this transaction. No events will be published until this transaction is committed

Parameters
event:nConsumeEvent — the nConsumeEvent object to be added to this transaction


Throws
nTransactionAlreadyCommittedError — is thrown if the transaction is already committed
 
nTransactionNoEventsError — is thrown if the transaction has no events pushed
 
nTransactionAlreadyAbortedError — is thrown if the transaction has been aborted.
 
nSessionNotConnectedError — if you have been disconnected from the server
 
nSessionNotInitialisedError — if you have not initialised the session
Constant Detail
nTransactionAbortedEventStringConstant
public static const nTransactionAbortedEventString:String = nTransactionAbortedEventString

String is used for nTransactionAbortedEvent dispatching

nTransactionCommittedEventStringConstant 
public static const nTransactionCommittedEventString:String = nTransactionCommittedEventString

String is used for nTransactionCommittedEvent dispatching

nTransactionEventStringConstant 
public static const nTransactionEventString:String = nTransactionEventString

String is used for nTransactionEvent dispatching

nTransactionFailedEventStringConstant 
public static const nTransactionFailedEventString:String = nTransactionFailedEventString

String is used for nTransactionFailedEvent dispatching