CallerAliasDB::CallerAliasDB( const UtlString& name ) : mDatabaseName( name ) , mTableLoaded ( true ) { // Access the shared table databse SIPDBManager* pSIPDBManager = SIPDBManager::getInstance(); mpFastDB = pSIPDBManager->getDatabase(name); // If we are the first process to attach // then we need to load the DB int users = pSIPDBManager->getNumDatabaseProcesses(name); OsSysLog::add(FAC_SUPERVISOR, PRI_DEBUG, "CallerAliasDB::_ users = %d, mTableLoaded = %d", users, mTableLoaded); if ( users == 1 || ( users > 1 && mTableLoaded == false ) ) { OsSysLog::add(FAC_DB, PRI_DEBUG, "CallerAliasDB::_ about to load"); mTableLoaded = false; // Load the file implicitly if (this->load() == OS_SUCCESS) { mTableLoaded = true; OsSysLog::add(FAC_DB, PRI_DEBUG, "CallerAliasDB::_ table successfully loaded"); } } OsSysLog::add(FAC_SUPERVISOR, PRI_DEBUG, "CallerAliasDB::_ rows in table = %d", getRowCount()); }
DialByNameDB::DialByNameDB( const UtlString& name ) : mDatabaseName( name ) { // Access the shared table databse SIPDBManager* pSIPDBManager = SIPDBManager::getInstance(); m_pFastDB = pSIPDBManager->getDatabase(name); // If we are the first process to attach // then we need to load the DB int users = pSIPDBManager->getNumDatabaseProcesses(name); if ( users == 1 || ( users > 1 && mTableLoaded == false ) ) { mTableLoaded = false; // Load the file implicitly if (this->load() == OS_SUCCESS) { mTableLoaded = true; } } }
/* *Function Name: RegistrationDB Constructor * *Parameters: * *Description: This is a protected method as this is a singleton * *Returns: * */ RegistrationDB::RegistrationDB( const UtlString& name ) : mDatabaseName( name ) { // Access the shared table databse SIPDBManager* pSIPDBManager = SIPDBManager::getInstance(); m_pFastDB = pSIPDBManager->getDatabase(name); // If we are the first process to attach // then we need to load the DB int users = pSIPDBManager->getNumDatabaseProcesses(name); if ( users == 1 || ( users > 1 && mTableLoaded == false ) ) { OsSysLog::add(FAC_SUPERVISOR, PRI_DEBUG, "About to try to load registration db"); mTableLoaded = false; // Load the file implicitly this->load(); // the RegistrationDB is not replicated from sipXconfig, as // a result, make this table appear as being loaded regardless // of the load() result. mTableLoaded = true; } }
CredentialDB::CredentialDB ( const UtlString& name ) : mDatabaseName( name ) , mTableLoaded ( false ) { // Access the shared table database SIPDBManager* pSIPDBManager = SIPDBManager::getInstance(); m_pFastDB = pSIPDBManager->getDatabase( name ); // If we are the first process to attach // then we need to load the DB int numusers = pSIPDBManager->getNumDatabaseProcesses (name); if ( numusers == 1 || ( numusers > 1 && mTableLoaded == false ) ) { OsSysLog::add(FAC_DB, PRI_DEBUG, "CredentialDB::CredentialDB() about to load"); mTableLoaded = false; // Load the file implicitly if (this->load() == OS_SUCCESS) { mTableLoaded = true; OsSysLog::add(FAC_DB, PRI_DEBUG, "CredentialDB::CredentialDB() table successfully loaded"); } } }