objects.storage.storageManager.storageManager Class Reference

The storageManager class is responsible for somehow storing a copy of all the captured TCP/IP data into the application's SQLite database. More...

Inherits objects::logic::common::observerInterface::observerInterface.

List of all members.

Public Member Functions

def __init__
def update
 implementation of observer method.
def initializeStorage
 Initialized the internal storage file.
def deleteStorage
 Deletes the internal storage file.
def startupStorage
 Starts the storage threads.
def shutdownStorage
 Stops the storage threads.
def processPacket
 Processes a new packed.

Public Attributes

 storageImpl
 decoder
 saveStorage
 maxSize
 lck
 writer
 monitor
 packetList
 timeToCommit
 cnt


Detailed Description

The storageManager class is responsible for somehow storing a copy of all the captured TCP/IP data into the application's SQLite database.

This class also deals with other details, such as limiting the database file size to a user defined value, and perform periodic commits.

Definition at line 143 of file storageManager.py.


Member Function Documentation

def objects.storage.storageManager.storageManager.__init__ (   self,
  saveStorage,
  maxSize 
)

Definition at line 145 of file storageManager.py.

00145                                             :        
00146         self.storageImpl = sqlite3Impl(globalStrings.traceStoragePath)
00147         
00148         self.decoder = packetDecoder()
00149         self.decoder.setDefaultReader()
00150         
00151         self.saveStorage = saveStorage
00152         self.maxSize     = maxSize
00153         self.lck = RLock()
00154         
00155         
00156         self.writer = storageWriterThread(self)
00157         self.monitor = storageMonitorThread(self, self.writer)
00158         
00159         self.packetList = []
00160         
00161         self.timeToCommit = False
00162         
00163         self.cnt = 0
00164 
00165 

def objects.storage.storageManager.storageManager.deleteStorage (   self  ) 

Deletes the internal storage file.

Definition at line 190 of file storageManager.py.

00190                            :
00191         self.storageImpl.deleteStorage()
00192     
00193     
00194     
    ## Starts the storage threads.

def objects.storage.storageManager.storageManager.initializeStorage (   self  ) 

Initialized the internal storage file.

Definition at line 184 of file storageManager.py.

00184                                :
00185         self.storageImpl.createStorage()
00186         self.storageImpl.clear()
00187     
00188     
    ## Deletes the internal storage file.

def objects.storage.storageManager.storageManager.processPacket (   self,
  header,
  data 
)

Processes a new packed.

Simply adds the (header, data) tuple to a list which is dequeued by the storageWriterThread class.

Parameters:
header Raw DataLink header
data Raw DataLink frame

Definition at line 213 of file storageManager.py.

00213                                          :
00214         
00215         if self.writer.getKillSignal() or self.monitor.getKillSignal():
00216             return
00217         
00218         try:
00219             self.packetList.append((header, data))
00220         finally:
00221             pass
00222     
00223     
00224     
    ## Helper function used to start worker threads.

def objects.storage.storageManager.storageManager.shutdownStorage (   self  ) 

Stops the storage threads.

Definition at line 203 of file storageManager.py.

00203                              :
00204         if self.storageImpl.successful == True and self.saveStorage == True:
00205             self.__stopThreads()            
00206             
00207     
00208     
    ## Processes a new packed. Simply adds the (header, data) tuple to a

def objects.storage.storageManager.storageManager.startupStorage (   self  ) 

Starts the storage threads.

Definition at line 196 of file storageManager.py.

00196                             :
00197         if self.storageImpl.successful == True and self.saveStorage == True:
00198             self.__startThreads()
00199     
00200     
00201     
    ## Stops the storage threads

def objects.storage.storageManager.storageManager.update (   self,
  header,
  data 
)

implementation of observer method.

This class is an observer of the networkMonitor Class.

Parameters:
header Raw DataLink header
data Raw DataLink frame

Reimplemented from objects.logic.common.observerInterface.observerInterface.

Definition at line 170 of file storageManager.py.

00170                                   :        
00171         
00172         #self.cnt += 1
00173         #print "%d" % (self.cnt)
00174         
00175         try:
00176             self.processPacket(header, data)
00177         except exception, ex:
00178             logger.log(__name__ + ": Could add packet onto storage queue")
00179             logger.log(ex)
00180                    
00181                    
00182                    


Member Data Documentation

Definition at line 163 of file storageManager.py.

Definition at line 148 of file storageManager.py.

Definition at line 153 of file storageManager.py.

Definition at line 152 of file storageManager.py.

Definition at line 157 of file storageManager.py.

Definition at line 159 of file storageManager.py.

Definition at line 151 of file storageManager.py.

Definition at line 146 of file storageManager.py.

Definition at line 161 of file storageManager.py.

Definition at line 156 of file storageManager.py.


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

Generated on Mon Mar 30 00:26:48 2009 for EyeSpy by  doxygen 1.5.8