The Assimilation Project  based on Assimilation version 1.1.7.1474836767
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

 tree
 
 namespace
 
 created
 
 sequence
 
 stats
 
 encryption_required
 
 post_transaction_packets
 

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.


@NOTE AND WARNING:
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 transaction.py.

Constructor & Destructor Documentation

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

Definition at line 101 of file transaction.py.

Member Function Documentation

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

Definition at line 235 of file transaction.py.

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,
  destaddr,
  action,
  frames,
  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.

Parameters
----------
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 transaction.py.

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,
  io 
)

Field Documentation

cma.transaction.Transaction.created

Definition at line 105 of file transaction.py.

cma.transaction.Transaction.encryption_required

Definition at line 108 of file transaction.py.

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

cma.transaction.Transaction.namespace

Definition at line 104 of file transaction.py.

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

cma.transaction.Transaction.post_transaction_packets

Definition at line 109 of file transaction.py.

cma.transaction.Transaction.sequence

Definition at line 106 of file transaction.py.

cma.transaction.Transaction.stats

Definition at line 107 of file transaction.py.

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


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