#include <RegistrationDB.h>
Public Member Functions | |
| UtlBoolean | isOutOfSequence (const Url &uri, const UtlString &callid, const int &cseq) const |
| Queries. | |
| int | getRowCount () const |
| Count rows in table. | |
| void | getAllRows (ResultSet &rResultSet) const |
| Utility method for dumping all rows. | |
| Int64 | getMaxUpdateNumberForRegistrar (const UtlString &primaryRegistrar) const |
| Return the max update number for primaryRegistrar, or zero if there are no such updates. | |
| Int64 | getNextUpdateNumberForRegistrar (const UtlString &primaryRegistrar, Int64 updateNumber) const |
| Return the next updateNumber for the primaryRegistrar after the specified updateNumber. | |
| int | getNextUpdateForRegistrar (const UtlString &primaryRegistrar, Int64 updateNumber, UtlSList &bindings) const |
| Get the next update for primaryRegistrar with an update number > updateNumber. | |
| int | getNewUpdatesForRegistrar (const UtlString &primaryRegistrar, Int64 updateNumber, UtlSList &bindings) const |
| Get all updates for primaryRegistrar with an update number > updateNumber. | |
| void | getUnexpiredContactsUser (const Url &uri, const int &timeNow, ResultSet &rResultSet) const |
| Return all contacts for 'uri' whose expirations are >= 'timeNow'. | |
| void | getUnexpiredContactsInstrument (const char *instrument, const int &timeNow, ResultSet &rResultSet) const |
| Return all contacts for 'instrument' whose expirations are >= 'timeNow'. | |
| void | getUnexpiredContactsUserInstrument (const Url &uri, const char *instrument, const int &timeNow, ResultSet &rResultSet) const |
| Return all contacts for 'uri' and 'instrument' whose expirations are >= 'timeNow'. | |
| void | getUnexpiredContactsFieldsContaining (UtlString &substringToMatch, const int &timeNow, UtlSList &matchingContactFields) const |
| Return a list of contact fields that are unexpired and contain a specified substring. The caller is responsible for de-allocating the memory for the entries contained in the list. | |
| void | updateBinding (const RegistrationBinding &) |
| update the binding of uri to contact: does insert or update as needed | |
| void | updateBinding (const Url &uri, const UtlString &contact, const UtlString &qvalue, const UtlString &callid, const int &cseq, const int &expires, const UtlString &instance_id, const UtlString &gruu, const UtlString &path, const UtlString &primary, const Int64 &update_number, const UtlString &instrument) |
| update the binding of uri to contact: does insert or update as needed | |
| void | expireAllBindings (const Url &uri, const UtlString &callid, const int &cseq, const int &timeNow, const UtlString &primary, const Int64 &update_number) |
| expireAllBindings for this URI as of 1 second before timeNow | |
| void | expireOldBindings (const Url &uri, const UtlString &callid, const int &cseq, const int &timeNow, const UtlString &primary, const Int64 &update_number) |
| expireOldBindings for this callid and older cseq values. | |
| void | getAllOldBindings (int newerThanTime, UtlSList &rAors) const |
| Get all bindings expiring before newerThanTime. | |
| void | removeAllRows () |
| OsStatus | cleanAndPersist (int newerThanTime) |
| Garbage collect and persist database. | |
| void | insertRow (const UtlHashMap &nvPairs) |
| bool | isLoaded () |
Static Public Member Functions | |
| static RegistrationDB * | getInstance (const UtlString &name="registration") |
| static void | releaseInstance () |
| releaseInstance - cleans up the singleton (for use at exit) | |
Static Public Attributes | |
| static const UtlString | gIdentityKey |
| static const UtlString | gUriKey |
| static const UtlString | gCallidKey |
| static const UtlString | gContactKey |
| static const UtlString | gQvalueKey |
| static const UtlString | gInstanceIdKey |
| static const UtlString | gGruuKey |
| static const UtlString | gPathKey |
| static const UtlString | gCseqKey |
| static const UtlString | gExpiresKey |
| static const UtlString | gPrimaryKey |
| static const UtlString | gUpdateNumberKey |
| static const UtlString | gInstrumentKey |
| static const UtlString | sType |
| static const UtlString | sXmlNamespace |
Protected Member Functions | |
| OsStatus | load () |
| RegistrationDB (const UtlString &name) | |
| RegistrationBinding * | copyRowToRegistrationBinding (dbCursor< RegistrationRow > &cursor) const |
| int | getUpdatesForRegistrar (dbQuery &query, UtlSList &bindings) const |
Protected Attributes | |
| dbDatabase * | m_pFastDB |
| UtlString | mDatabaseName |
| bool | mTableLoaded |
Static Protected Attributes | |
| static RegistrationDB * | spInstance = NULL |
| static dbDatabase * | spDBInstance |
| static OsMutex | sLockMutex |
Private Member Functions | |
| ~RegistrationDB () | |
| No destructor, no no no. | |
Static Private Attributes | |
| static const UtlString | nullString |
| static const UtlString | percent |
| RegistrationDB | ( | const UtlString & | name | ) | [protected] |
| ~RegistrationDB | ( | ) | [private] |
No destructor, no no no.
| RegistrationDB * getInstance | ( | const UtlString & | name = "registration" |
) | [static] |
| void releaseInstance | ( | ) | [static] |
releaseInstance - cleans up the singleton (for use at exit)
| UtlBoolean isOutOfSequence | ( | const Url & | uri, | |
| const UtlString & | callid, | |||
| const int & | cseq | |||
| ) | const |
Queries.
| int getRowCount | ( | ) | const |
Count rows in table.
| void getAllRows | ( | ResultSet & | rResultSet | ) | const |
Utility method for dumping all rows.
Return the max update number for primaryRegistrar, or zero if there are no such updates.
| Int64 getNextUpdateNumberForRegistrar | ( | const UtlString & | primaryRegistrar, | |
| Int64 | updateNumber | |||
| ) | const |
Return the next updateNumber for the primaryRegistrar after the specified updateNumber.
If there are no such updates, then return 0
| int getNextUpdateForRegistrar | ( | const UtlString & | primaryRegistrar, | |
| Int64 | updateNumber, | |||
| UtlSList & | bindings | |||
| ) | const |
Get the next update for primaryRegistrar with an update number > updateNumber.
Fill in the bindings arg with the bindings, objects of type RegistrationBinding. (A single update may include multiple bindings.) Return the number of bindings (the length of the list).
| int getNewUpdatesForRegistrar | ( | const UtlString & | primaryRegistrar, | |
| Int64 | updateNumber, | |||
| UtlSList & | bindings | |||
| ) | const |
Get all updates for primaryRegistrar with an update number > updateNumber.
Fill in the bindings arg with the bindings, objects of type RegistrationBinding. Return the number of bindings (the length of the list).
| void getUnexpiredContactsUser | ( | const Url & | uri, | |
| const int & | timeNow, | |||
| ResultSet & | rResultSet | |||
| ) | const |
Return all contacts for 'uri' whose expirations are >= 'timeNow'.
| void getUnexpiredContactsInstrument | ( | const char * | instrument, | |
| const int & | timeNow, | |||
| ResultSet & | rResultSet | |||
| ) | const |
Return all contacts for 'instrument' whose expirations are >= 'timeNow'.
| void getUnexpiredContactsUserInstrument | ( | const Url & | uri, | |
| const char * | instrument, | |||
| const int & | timeNow, | |||
| ResultSet & | rResultSet | |||
| ) | const |
Return all contacts for 'uri' and 'instrument' whose expirations are >= 'timeNow'.
| void getUnexpiredContactsFieldsContaining | ( | UtlString & | substringToMatch, | |
| const int & | timeNow, | |||
| UtlSList & | matchingContactFields | |||
| ) | const |
Return a list of contact fields that are unexpired and contain a specified substring. The caller is responsible for de-allocating the memory for the entries contained in the list.
| void updateBinding | ( | const RegistrationBinding & | reg | ) |
update the binding of uri to contact: does insert or update as needed
| void updateBinding | ( | const Url & | uri, | |
| const UtlString & | contact, | |||
| const UtlString & | qvalue, | |||
| const UtlString & | callid, | |||
| const int & | cseq, | |||
| const int & | expires, | |||
| const UtlString & | instance_id, | |||
| const UtlString & | gruu, | |||
| const UtlString & | path, | |||
| const UtlString & | primary, | |||
| const Int64 & | update_number, | |||
| const UtlString & | instrument | |||
| ) |
update the binding of uri to contact: does insert or update as needed
| void expireAllBindings | ( | const Url & | uri, | |
| const UtlString & | callid, | |||
| const int & | cseq, | |||
| const int & | timeNow, | |||
| const UtlString & | primary, | |||
| const Int64 & | update_number | |||
| ) |
expireAllBindings for this URI as of 1 second before timeNow
| void expireOldBindings | ( | const Url & | uri, | |
| const UtlString & | callid, | |||
| const int & | cseq, | |||
| const int & | timeNow, | |||
| const UtlString & | primary, | |||
| const Int64 & | update_number | |||
| ) |
expireOldBindings for this callid and older cseq values.
clean out any bindings for this callid and older cseq values.
| void getAllOldBindings | ( | int | newerThanTime, | |
| UtlSList & | rAors | |||
| ) | const |
Get all bindings expiring before newerThanTime.
| newerThanTime | Get bindings expiring before newerThanTime |
| rAors | Return their AORs (as name-addr UtlString's) and their instrument values (as UtlString's) as pairs of elements in a list. The UtlString's are owned by rAors. |
| void removeAllRows | ( | ) |
| OsStatus cleanAndPersist | ( | int | newerThanTime | ) |
Garbage collect and persist database.
Garbage collect - delete all rows older than the specified time, and then write all remaining entries to the persistent data store (xml file).
Garbage collect - delete all rows older than the specified time, and then write all remaining entries to the persistent data store (xml file).
| void insertRow | ( | const UtlHashMap & | nvPairs | ) |
| bool isLoaded | ( | ) |
| OsStatus load | ( | ) | [protected] |
| RegistrationBinding * copyRowToRegistrationBinding | ( | dbCursor< RegistrationRow > & | cursor | ) | const [protected] |
const UtlString gIdentityKey [static] |
const UtlString gCallidKey [static] |
const UtlString gContactKey [static] |
const UtlString gQvalueKey [static] |
const UtlString gInstanceIdKey [static] |
const UtlString gExpiresKey [static] |
const UtlString gPrimaryKey [static] |
const UtlString gUpdateNumberKey [static] |
const UtlString gInstrumentKey [static] |
const UtlString sXmlNamespace [static] |
RegistrationDB * spInstance = NULL [static, protected] |
dbDatabase* spDBInstance [static, protected] |
OsMutex sLockMutex [static, protected] |
dbDatabase* m_pFastDB [protected] |
UtlString mDatabaseName [protected] |
bool mTableLoaded [protected] |
const UtlString nullString [static, private] |