The Assimilation Project  based on Assimilation version
cma.transaction.Transaction Class Reference
Inheritance diagram for cma.transaction.Transaction:
Collaboration diagram for cma.transaction.Transaction:

Public Member Functions

def __init__ (self, encryption_required=False)
def __str__ (self)
def add_packet (self, destaddr, action, frames, frametype=None)
 This collection of member functions accumulate work to be done for our Transaction. More...
def commit_trans (self, io)
def abort_trans (self)

Data Fields


Detailed Description

This class implements database/nanoprobe transactions.

The nanoprobe portions of the transaction support the following operations:
    Start sending heartbeats
    Stop sending heartbeats
    Start listening for heartbeats
    Stop listening for heartbeats
    Start sending/receiving heartbeats
    Stop sending/receiving heartbeats
    Start a monitoring action
    Stop a monitoring action
    Start a discovery action
    Stop a discovery action

The database portions of the transaction support the following operations:
    Insert a node possibly including a subtree to be inserted
    Replace a node possibly including owned subtrees to be replaced
    Delete a node and possible owned subtrees

The semantics of the database updates are worth describing in further detail
    An "owned" subtree means that the node in question has ownership of all nodes
        related to it by the given relationship types, and if the node is deleted
        then all the things it owns should also be deleted

    If it is replaced, then all of its nodes related to it by the given
        relationship types should be replaced by the given nodes described in
        the transaction - and no other nodes related to it by these relationship
        types should exist.  If they do, they need to be deleted.

Is this too complex?  Should the originator of the request be responsible for knowing what
        nodes he needs to delete?
        If this is eventually going to be executed by a plugin into the database engine,
        then the more work you leave to the executor of the transaction, the faster this
        code will run.  On the other hand, it delays the mess until transaction execution
        time and makes the code for creating the transaction simpler...
        I'm gonna opt for the complexity in processing of the transaction rather than
        complexity in all the places where people might add things to the transaction.

Transactions need to be somehow repeatable...  This means if this transaction
was committed, we need to <i>not</i> repeat it - or make sure it's idempotent.
Neither of those is true at the moment.

Definition at line 55 of file

Constructor & Destructor Documentation

def cma.transaction.Transaction.__init__ (   self,
  encryption_required = False 

Definition at line 101 of file

Member Function Documentation

def cma.transaction.Transaction.__str__ (   self)
def cma.transaction.Transaction.abort_trans (   self)

Definition at line 235 of file

References cma.transaction.Transaction.namespace, cma.assimjson.JSONtree.tree, and cma.transaction.Transaction.tree.

Referenced by cma.transaction.Transaction.commit_trans().

Here is the caller graph for this function:

def cma.transaction.Transaction.add_packet (   self,
  frametype = None 

This collection of member functions accumulate work to be done for our Transaction.

Append a packet to the ConfigContext object for this transaction.
In effect, this queues the packet for sending when this transaction is committed.

destaddr : pyNetAddr
    The address to send this packet to - the address that will get this packet
action : int
    What action to ask the destaddr to perform on our behalf
frames : [several possible types]
    A list of frames or (optionally) frame values
frametype: [int], optional
    If present, it is the frame type for all the frame <i>values</i> in the 'frames' array

Definition at line 121 of file

References cma.messagedispatcher.MessageDispatcher.encryption_required, cma.packetlistener.PacketListener.encryption_required, cma.transaction.Transaction.encryption_required, cma.assimjson.JSONtree.tree, and cma.transaction.Transaction.tree.

def cma.transaction.Transaction.commit_trans (   self,

Field Documentation


Definition at line 105 of file


Definition at line 108 of file

Referenced by cma.transaction.Transaction.add_packet().


Definition at line 104 of file

Referenced by cma.transaction.Transaction.abort_trans().


Definition at line 109 of file


Definition at line 106 of file


Definition at line 107 of file

Referenced by cma.transaction.Transaction.commit_trans().

The documentation for this class was generated from the following file: