reSIProcate/repro  9694
Public Member Functions | Private Member Functions | Private Attributes
repro::MySqlDb Class Reference

#include <MySqlDb.hxx>

Inheritance diagram for repro::MySqlDb:
Inheritance graph
[legend]
Collaboration diagram for repro::MySqlDb:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MySqlDb (const resip::Data &dbServer, const resip::Data &user, const resip::Data &password, const resip::Data &databaseName, unsigned int port, const resip::Data &customUserAuthQuery)
virtual ~MySqlDb ()
virtual bool isSane ()
virtual bool addUser (const Key &key, const UserRecord &rec)
virtual void eraseUser (const Key &key)
virtual UserRecord getUser (const Key &key) const
virtual resip::Data getUserAuthInfo (const Key &key) const
virtual Key firstUserKey ()
virtual Key nextUserKey ()
virtual int singleResultQuery (const resip::Data &queryCommand, std::vector< resip::Data > &fields) const

Private Member Functions

virtual bool dbWriteRecord (const Table table, const resip::Data &key, const resip::Data &data)
virtual bool dbReadRecord (const Table table, const resip::Data &key, resip::Data &data) const
 return false if not found
virtual void dbEraseRecord (const Table table, const resip::Data &key, bool isSecondaryKey=false)
virtual resip::Data dbNextKey (const Table table, bool first=true)
virtual bool dbNextRecord (const Table table, const resip::Data &key, resip::Data &data, bool forUpdate, bool first=false)
virtual bool dbBeginTransaction (const Table table)
virtual bool dbCommitTransaction (const Table table)
virtual bool dbRollbackTransaction (const Table table)
void initialize () const
void disconnectFromDatabase () const
int connectToDatabase () const
int query (const resip::Data &queryCommand, MYSQL_RES **result) const
resip::DataescapeString (const resip::Data &str, resip::Data &escapedStr) const
const char * tableName (Table table) const
void userWhereClauseToDataStream (const Key &key, resip::DataStream &ds) const
void getUserAndDomainFromKey (const AbstractDb::Key &key, resip::Data &user, resip::Data &domain) const

Private Attributes

resip::Data mDBServer
resip::Data mDBUser
resip::Data mDBPassword
resip::Data mDBName
unsigned int mDBPort
resip::Data mCustomUserAuthQuery
MYSQL * mConn
MYSQL_RES * mResult [MaxTable]
volatile bool mConnected
resip::Mutex mMutex

Detailed Description

Definition at line 21 of file MySqlDb.hxx.


Constructor & Destructor Documentation

repro::MySqlDb::MySqlDb ( const resip::Data dbServer,
const resip::Data user,
const resip::Data password,
const resip::Data databaseName,
unsigned int  port,
const resip::Data customUserAuthQuery 
)
virtual repro::MySqlDb::~MySqlDb ( ) [virtual]

Member Function Documentation

virtual bool repro::MySqlDb::addUser ( const Key key,
const UserRecord rec 
) [virtual]

Reimplemented from repro::AbstractDb.

int repro::MySqlDb::connectToDatabase ( ) const [private]
virtual bool repro::MySqlDb::dbBeginTransaction ( const Table  table) [private, virtual]

Implements repro::AbstractDb.

virtual bool repro::MySqlDb::dbCommitTransaction ( const Table  table) [private, virtual]

Implements repro::AbstractDb.

virtual void repro::MySqlDb::dbEraseRecord ( const Table  table,
const resip::Data key,
bool  isSecondaryKey = false 
) [private, virtual]

Implements repro::AbstractDb.

virtual resip::Data repro::MySqlDb::dbNextKey ( const Table  table,
bool  first = true 
) [private, virtual]

Implements repro::AbstractDb.

virtual bool repro::MySqlDb::dbNextRecord ( const Table  table,
const resip::Data key,
resip::Data data,
bool  forUpdate,
bool  first = false 
) [private, virtual]

Implements repro::AbstractDb.

virtual bool repro::MySqlDb::dbReadRecord ( const Table  table,
const resip::Data key,
resip::Data data 
) const [private, virtual]

return false if not found

Implements repro::AbstractDb.

virtual bool repro::MySqlDb::dbRollbackTransaction ( const Table  table) [private, virtual]

Implements repro::AbstractDb.

virtual bool repro::MySqlDb::dbWriteRecord ( const Table  table,
const resip::Data key,
const resip::Data data 
) [private, virtual]

Implements repro::AbstractDb.

void repro::MySqlDb::disconnectFromDatabase ( ) const [private]
virtual void repro::MySqlDb::eraseUser ( const Key key) [virtual]

Reimplemented from repro::AbstractDb.

resip::Data& repro::MySqlDb::escapeString ( const resip::Data str,
resip::Data escapedStr 
) const [private]
virtual Key repro::MySqlDb::firstUserKey ( ) [virtual]

Reimplemented from repro::AbstractDb.

virtual UserRecord repro::MySqlDb::getUser ( const Key key) const [virtual]

Reimplemented from repro::AbstractDb.

void repro::MySqlDb::getUserAndDomainFromKey ( const AbstractDb::Key key,
resip::Data user,
resip::Data domain 
) const [private]
virtual resip::Data repro::MySqlDb::getUserAuthInfo ( const Key key) const [virtual]

Reimplemented from repro::AbstractDb.

void repro::MySqlDb::initialize ( ) const [private]
virtual bool repro::MySqlDb::isSane ( ) [inline, virtual]

Implements repro::AbstractDb.

Definition at line 33 of file MySqlDb.hxx.

{return mConnected;}
virtual Key repro::MySqlDb::nextUserKey ( ) [virtual]

Reimplemented from repro::AbstractDb.

int repro::MySqlDb::query ( const resip::Data queryCommand,
MYSQL_RES **  result 
) const [private]
virtual int repro::MySqlDb::singleResultQuery ( const resip::Data queryCommand,
std::vector< resip::Data > &  fields 
) const [virtual]
const char* repro::MySqlDb::tableName ( Table  table) const [private]
void repro::MySqlDb::userWhereClauseToDataStream ( const Key key,
resip::DataStream ds 
) const [private]

Member Data Documentation

MYSQL* repro::MySqlDb::mConn [mutable, private]

Definition at line 80 of file MySqlDb.hxx.

volatile bool repro::MySqlDb::mConnected [mutable, private]

Definition at line 82 of file MySqlDb.hxx.

Definition at line 78 of file MySqlDb.hxx.

Definition at line 76 of file MySqlDb.hxx.

Definition at line 75 of file MySqlDb.hxx.

unsigned int repro::MySqlDb::mDBPort [private]

Definition at line 77 of file MySqlDb.hxx.

Definition at line 73 of file MySqlDb.hxx.

Definition at line 74 of file MySqlDb.hxx.

Definition at line 86 of file MySqlDb.hxx.

MYSQL_RES* repro::MySqlDb::mResult[MaxTable] [mutable, private]

Definition at line 81 of file MySqlDb.hxx.


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