SIPDBManager Class Reference

#include <SIPDBManager.h>

List of all members.


Detailed Description

Wrapper to the fast DB singleton.

This singleton ensures that there is only one named instance of fastDB running per process. This instance will have all the tables stored in it

Public Member Functions

virtual ~SIPDBManager ()
 Virtual Destructor.
void getAllTableProcesses (ResultSet &rResultSet) const
 dumps the IMDB meta table info
OsStatus getProcessCount (int &rProcessCount) const
 Number of Processes attached to tables (Processes * Tables).
dbDatabasegetDatabase (const UtlString &tablename) const
 Registerd the database and pid, opens the DB if necessary and returns it.
void removeDatabase (const UtlString &tablename) const
 unregisters the database from the IMDB and calls close to decrement the user count etc.
int getNumDatabaseProcesses (const UtlString &tablename) const
 counts the number of processes attached to the DB
OsStatus getDatabaseInfo (UtlString &rDatabaseInfo) const
void updateDatabaseInfo (const UtlString &tablename, const int &checksum) const
 After loading an IMDB update its checksum information.
void setDatabaseChangedFlag (const UtlString &tablename, bool changed) const
 Sets a change flag for the table indicating that there was an insert/update to it.
bool getDatabaseChangedFlag (const UtlString &tablename) const
 determines whether the database has changed or not
OsStatus pingDatabase (const int &rTransactionLockSecs=0, const UtlBoolean &rTestWriteLock=FALSE) const
 method to ping the data store and sleeps for timeoutSecs in the transaction
OsStatus preloadAllDatabase () const
 preload all database tables
OsStatus preloadDatabaseTable (const UtlString &tablename) const
 preload database table by name
OsStatus releaseAllDatabase () const
 release all database tables

Static Public Member Functions

static SIPDBManagergetInstance ()
 Singleton Accessor.
static void getFieldValue (const unsigned char *base, const dbFieldDescriptor *fd, UtlString &textValue)
 Helper Method for all IMDB tables.
static OsStatus getAttributeValue (const TiXmlNode &node, const UtlString &key, UtlString &value)
 Helper Method for all IMDB tables.

Protected Member Functions

dbDatabaseopenDatabase () const
 Registerd the database and pid, opens the DB if necessary and returns it.
 SIPDBManager ()
void setFastdbTempDir ()
 Override the default fastdb tmp dir.

Protected Attributes

UtlString m_absWorkingDirectory
UtlString m_absConfigDirectory
UtlString m_FastDbTmpDirPath

Static Protected Attributes

static SIPDBManagerspInstance = NULL
static OsMutex sLockMutex
static dbDatabasespFastDB = NULL


Constructor & Destructor Documentation

~SIPDBManager (  )  [virtual]

Virtual Destructor.

SIPDBManager (  )  [protected]


Member Function Documentation

SIPDBManager * getInstance (  )  [static]

Singleton Accessor.

Returns:

void getAllTableProcesses ( ResultSet rResultSet  )  const

dumps the IMDB meta table info

OsStatus getProcessCount ( int &  rProcessCount  )  const

Number of Processes attached to tables (Processes * Tables).

dbDatabase * getDatabase ( const UtlString tablename  )  const

Registerd the database and pid, opens the DB if necessary and returns it.

void removeDatabase ( const UtlString tablename  )  const

unregisters the database from the IMDB and calls close to decrement the user count etc.

int getNumDatabaseProcesses ( const UtlString tablename  )  const

counts the number of processes attached to the DB

OsStatus getDatabaseInfo ( UtlString rDatabaseInfo  )  const

void updateDatabaseInfo ( const UtlString tablename,
const int &  checksum 
) const

After loading an IMDB update its checksum information.

void setDatabaseChangedFlag ( const UtlString tablename,
bool  changed 
) const

Sets a change flag for the table indicating that there was an insert/update to it.

bool getDatabaseChangedFlag ( const UtlString tablename  )  const

determines whether the database has changed or not

OsStatus pingDatabase ( const int &  rTransactionLockSecs = 0,
const UtlBoolean rTestWriteLock = FALSE 
) const

method to ping the data store and sleeps for timeoutSecs in the transaction

void getFieldValue ( const unsigned char *  base,
const dbFieldDescriptor fd,
UtlString textValue 
) [static]

Helper Method for all IMDB tables.

OsStatus getAttributeValue ( const TiXmlNode node,
const UtlString key,
UtlString value 
) [static]

Helper Method for all IMDB tables.

OsStatus preloadAllDatabase (  )  const

preload all database tables

OsStatus preloadDatabaseTable ( const UtlString tablename  )  const

preload database table by name

OsStatus releaseAllDatabase (  )  const

release all database tables

dbDatabase * openDatabase (  )  const [protected]

Registerd the database and pid, opens the DB if necessary and returns it.

void setFastdbTempDir (  )  [protected]

Override the default fastdb tmp dir.


Member Data Documentation

SIPDBManager * spInstance = NULL [static, protected]

OsMutex sLockMutex [static, protected]

dbDatabase * spFastDB = NULL [static, protected]


Online Library Docs

sipXecs home page

Version 4.2.1-018930 2010-07-31T01:13:23 build16 abuild