ActivitiesInterface Class Reference

Collaboration diagram for ActivitiesInterface:

Collaboration graph
[legend]
List of all members.

Public Member Functions

def __init__
def __del__
def initialize
 Initialize the object.
def connect
 connect to the database
def newActivity
 Create a new activity in the activities database.
def setState
 Set the state of a run in the database.
def getState
 Retrieve the state of a run from the database.
def getRunsByState
 Get a set of runIDs which are in a particular state.
def setTime
 Set a time tag row.
def getTime
def setLdfFileName
 set the output LDF/LSF format data file name for a run
def getLdfFileName
 Retrieve the full path to the LDF file from the db.
def setScriptOutput
 Set the script output blob.
def getScriptOutput
 Retrieve the script output.
def setJobCompleteList
 Set the job complete list.
def getJobCompleteList
 Retrieve the job complete list.
def lockRow
def unlockRow
def stateStr
 Convert an enumerated state to a string for printing.
def getRunID_fk
 Retreive the runID_fk from the database for speed.
def __selectSQL
def __updateSQL
def __pull
def __pullBlob
def __push

Static Public Attributes

string TableStates = "LICOS_states"
 Allowed tables.
string TableActivities = "LICOS_activities"
string TableReport = "elogreport"
string CommandingState = "CommandingState_FK"
 State categories.
string DataState = "DataState_FK"
string AnalysisState = "AnalysisState_FK"
string DataStart = "DataStart"
 Time rows.
string DataStop = "DataStop"
string SuiteIdentifier = "SuiteIdentifier"
 Suite id.
string LDFname = "LdfFileName"
 LDF file name.
string ScriptOutput = "ScriptOutput"
 script Output
string JobComplete = "JobCompleteList"
 Job complete list.
string PrimaryKey = "RunID_FK"
 Primary key.

Private Attributes

 __db
 __dbName
 __dbUser
 __dbPass
 __dbPort
 __stateKeys

Static Private Attributes

string __stdDbName = "elogbook"
string __stdDbUser = "elogbook"
string __stdDbPass = "elogbook"
int __stdDbPort = 3306
list __states

Detailed Description

Definition at line 34 of file rcActivitiesInterface.py.


Member Function Documentation

def __del__   self  ) 
 

Reimplementation of the destructor to make bloody well sure
that the table ends up in an unlocked state...

Definition at line 99 of file rcActivitiesInterface.py.

def __init__   self,
  dbName = __stdDbName,
  dbUser = __stdDbUser,
  dbPass = __stdDbPass,
  dbPort = __stdDbPort
 

Definition at line 82 of file rcActivitiesInterface.py.

def __pull   self,
  sql
 

Definition at line 427 of file rcActivitiesInterface.py.

def __pullBlob   self,
  sql
 

Definition at line 448 of file rcActivitiesInterface.py.

def __push   self,
  sql
 

Definition at line 456 of file rcActivitiesInterface.py.

def __selectSQL   self,
  table,
  column,
  constraint
 

Definition at line 418 of file rcActivitiesInterface.py.

def __updateSQL   self,
  table,
  column,
  value,
  constraint
 

Definition at line 421 of file rcActivitiesInterface.py.

def connect   self  ) 
 

connect to the database

Definition at line 122 of file rcActivitiesInterface.py.

def getJobCompleteList   self,
  runID
 

Retrieve the job complete list.

Parameters:
runID Integer run ID
Returns:
a string (possibly empty) denoting which jobs are complete.

Definition at line 354 of file rcActivitiesInterface.py.

def getLdfFileName   self,
  runID
 

Retrieve the full path to the LDF file from the db.

Parameters:
runID Integer Run ID

Definition at line 282 of file rcActivitiesInterface.py.

def getRunID_fk   self,
  runID
 

Retreive the runID_fk from the database for speed.

Parameters:
runID integer Run ID
Returns:
the FK (or None if run is nonexistent)

Definition at line 401 of file rcActivitiesInterface.py.

def getRunsByState   self,
  category,
  state
 

Get a set of runIDs which are in a particular state.

Parameters:
category One of the State categories
state One of the possible states
Returns:
A collection of runIDs which are in the state requested.

Definition at line 209 of file rcActivitiesInterface.py.

def getScriptOutput   self,
  runID
 

Retrieve the script output.

Parameters:
runID Integer run ID
Returns:
blob an arbitrary byte stream representation of the script output

Definition at line 318 of file rcActivitiesInterface.py.

def getState   self,
  runID,
  category
 

Retrieve the state of a run from the database.

Parameters:
runID integer Run ID
category One of the possible state categories

Definition at line 192 of file rcActivitiesInterface.py.

def getTime   self,
  runID,
  timeColumn
 

Definition at line 244 of file rcActivitiesInterface.py.

def initialize   self  ) 
 

Initialize the object.

Do a database connect, etc.

Definition at line 108 of file rcActivitiesInterface.py.

def lockRow   self,
  runID_fk
 

Definition at line 371 of file rcActivitiesInterface.py.

def newActivity   self,
  runID,
  suiteID = None
 

Create a new activity in the activities database.

Parameters:
runID run identifier
suiteID Suite linkage identifier Note: no check is made to see whether the suite exists.

Definition at line 145 of file rcActivitiesInterface.py.

def setJobCompleteList   self,
  runID,
  jobListString
 

Set the job complete list.

Parameters:
runID Integer run ID
jobListString String representing the list of completed jobs

Definition at line 335 of file rcActivitiesInterface.py.

def setLdfFileName   self,
  runID,
  ldfFileName
 

set the output LDF/LSF format data file name for a run

Parameters:
runID integer Run ID
ldfFileName Fully qualified path name. Variables will be expanded before insertion.

Definition at line 262 of file rcActivitiesInterface.py.

def setScriptOutput   self,
  runID,
  blob
 

Set the script output blob.

Parameters:
runID Integer run ID
blob An arbitrary byte stream representation of the script output

Definition at line 298 of file rcActivitiesInterface.py.

def setState   self,
  runID,
  category,
  newState
 

Set the state of a run in the database.

Parameters:
runID integer Run ID
category One of the possible state categories
newState New state

Definition at line 173 of file rcActivitiesInterface.py.

def setTime   self,
  runID,
  timeColumn,
  theTime
 

Set a time tag row.

Parameters:
runID integer Run ID
timeColumn Tag for the column. e.g., DataStart, DataStop
theTime Unix timestamp

Definition at line 223 of file rcActivitiesInterface.py.

def stateStr   self,
  state
 

Convert an enumerated state to a string for printing.

Parameters:
state an integer state
Returns:
State string

Definition at line 390 of file rcActivitiesInterface.py.

def unlockRow   self  ) 
 

Definition at line 384 of file rcActivitiesInterface.py.


Member Data Documentation

__db [private]
 

Definition at line 84 of file rcActivitiesInterface.py.

__dbName [private]
 

Definition at line 85 of file rcActivitiesInterface.py.

__dbPass [private]
 

Definition at line 87 of file rcActivitiesInterface.py.

__dbPort [private]
 

Definition at line 88 of file rcActivitiesInterface.py.

__dbUser [private]
 

Definition at line 86 of file rcActivitiesInterface.py.

__stateKeys [private]
 

Definition at line 89 of file rcActivitiesInterface.py.

list __states [static, private]
 

Initial value:

[ "ActivityCreated",
                  "CommandingStarted",
                  "CommandingComplete",
                  "NoData",
                  "DataStarted",
                  "DataComplete",
                  "NoAnalysis",
                  "AnalysisStarted",
                  "AnalysisComplete", ]

Definition at line 71 of file rcActivitiesInterface.py.

string __stdDbName = "elogbook" [static, private]
 

Definition at line 35 of file rcActivitiesInterface.py.

string __stdDbPass = "elogbook" [static, private]
 

Definition at line 37 of file rcActivitiesInterface.py.

int __stdDbPort = 3306 [static, private]
 

Definition at line 38 of file rcActivitiesInterface.py.

string __stdDbUser = "elogbook" [static, private]
 

Definition at line 36 of file rcActivitiesInterface.py.

string AnalysisState = "AnalysisState_FK" [static]
 

Definition at line 48 of file rcActivitiesInterface.py.

string CommandingState = "CommandingState_FK" [static]
 

State categories.

Definition at line 46 of file rcActivitiesInterface.py.

string DataStart = "DataStart" [static]
 

Time rows.

Definition at line 51 of file rcActivitiesInterface.py.

string DataState = "DataState_FK" [static]
 

Definition at line 47 of file rcActivitiesInterface.py.

string DataStop = "DataStop" [static]
 

Definition at line 52 of file rcActivitiesInterface.py.

string JobComplete = "JobCompleteList" [static]
 

Job complete list.

Definition at line 64 of file rcActivitiesInterface.py.

string LDFname = "LdfFileName" [static]
 

LDF file name.

Definition at line 58 of file rcActivitiesInterface.py.

string PrimaryKey = "RunID_FK" [static]
 

Primary key.

Definition at line 67 of file rcActivitiesInterface.py.

string ScriptOutput = "ScriptOutput" [static]
 

script Output

Definition at line 61 of file rcActivitiesInterface.py.

string SuiteIdentifier = "SuiteIdentifier" [static]
 

Suite id.

Definition at line 55 of file rcActivitiesInterface.py.

string TableActivities = "LICOS_activities" [static]
 

Definition at line 42 of file rcActivitiesInterface.py.

string TableReport = "elogreport" [static]
 

Definition at line 43 of file rcActivitiesInterface.py.

string TableStates = "LICOS_states" [static]
 

Allowed tables.

Definition at line 41 of file rcActivitiesInterface.py.


The documentation for this class was generated from the following file:
Generated on Thu Apr 27 20:53:22 2006 for LICOS L02-01-00 by doxygen 1.4.6-NO