reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::InMemorySyncRegDb Class Reference

Implementation of a persistence manager. More...

#include <InMemorySyncRegDb.hxx>

Inheritance diagram for resip::InMemorySyncRegDb:
[legend]

Public Member Functions

 InMemorySyncRegDb (unsigned int removeLingerSecs=0)
 
virtual ~InMemorySyncRegDb ()
 
virtual void addHandler (InMemorySyncRegDbHandler *handler)
 
virtual void removeHandler (InMemorySyncRegDbHandler *handler)
 
virtual void initialSync (unsigned int connectionId)
 
virtual void addAor (const Uri &aor, const ContactList &contacts)
 
virtual void removeAor (const Uri &aor)
 
virtual bool aorIsRegistered (const Uri &aor)
 
virtual bool aorIsRegistered (const Uri &aor, uint64_t *maxExpires)
 
virtual void lockRecord (const Uri &aor)
 
virtual void unlockRecord (const Uri &aor)
 
virtual update_status_t updateContact (const resip::Uri &aor, const ContactInstanceRecord &rec)
 
virtual void removeContact (const Uri &aor, const ContactInstanceRecord &rec)
 
virtual void getContacts (const Uri &aor, ContactList &container)
 
virtual void getContactsFull (const Uri &aor, ContactList &container)
 
virtual void getAors (UriList &container)
 return all the AOR in the DB
 
- Public Member Functions inherited from resip::RegistrationPersistenceManager
 RegistrationPersistenceManager ()
 
virtual ~RegistrationPersistenceManager ()
 

Protected Types

typedef std::map< Uri, ContactList * > database_map_t
 
typedef std::list< InMemorySyncRegDbHandler * > HandlerList
 

Protected Member Functions

void invokeOnAorModified (bool sync, const resip::Uri &aor, const ContactList &contacts)
 
void invokeOnInitialSyncAor (unsigned int connectionId, const resip::Uri &aor, const ContactList &contacts)
 

Protected Attributes

database_map_t mDatabase
 
Mutex mDatabaseMutex
 
std::set< Uri > mLockedRecords
 
Mutex mLockedRecordsMutex
 
Condition mRecordUnlocked
 
unsigned int mRemoveLingerSecs
 
HandlerList mHandlers
 
Mutex mHandlerMutex
 

Additional Inherited Members

- Public Types inherited from resip::RegistrationPersistenceManager
enum  update_status_t { CONTACT_CREATED , CONTACT_UPDATED }
 
typedef std::list< Uri > UriList
 

Detailed Description

Implementation of a persistence manager.

This class keeps all registrations in memory, and is used for remote replication.

Removed contact bindings are kept in memory with a RegExpires time of 0. This is required in order to properly syncronize removed contact bindings with a peer instance. Contacts are not deleted from memory until they have been removed for "removeLingerSecs". The removeLingerSecs parameter is passed into the contructor. If removeLingerSecs is set to 0, then contacts are removed from memory immediately and this class behaves very similar to the InMemoryRegistrationDatabase class.

The InMemorySyncRegDbHandler can be used by an external mechanism to transport registration bindings to a remote peer for replication. See the RegSyncClient and RegSyncServer implementations in the repro project.

Definition at line 52 of file InMemorySyncRegDb.hxx.

Member Typedef Documentation

◆ database_map_t

Definition at line 84 of file InMemorySyncRegDb.hxx.

◆ HandlerList

Definition at line 95 of file InMemorySyncRegDb.hxx.

Constructor & Destructor Documentation

◆ InMemorySyncRegDb()

InMemorySyncRegDb::InMemorySyncRegDb ( unsigned int  removeLingerSecs = 0)

Definition at line 56 of file InMemorySyncRegDb.cxx.

◆ ~InMemorySyncRegDb()

InMemorySyncRegDb::~InMemorySyncRegDb ( )
virtual

Definition at line 61 of file InMemorySyncRegDb.cxx.

Member Function Documentation

◆ addAor()

void InMemorySyncRegDb::addAor ( const Uri &  aor,
const ContactList &  contacts 
)
virtual

Implements resip::RegistrationPersistenceManager.

Definition at line 140 of file InMemorySyncRegDb.cxx.

◆ addHandler()

void InMemorySyncRegDb::addHandler ( InMemorySyncRegDbHandler *  handler)
virtual

Definition at line 72 of file InMemorySyncRegDb.cxx.

◆ aorIsRegistered() [1/2]

bool InMemorySyncRegDb::aorIsRegistered ( const Uri &  aor)
virtual

Implements resip::RegistrationPersistenceManager.

Definition at line 212 of file InMemorySyncRegDb.cxx.

◆ aorIsRegistered() [2/2]

bool InMemorySyncRegDb::aorIsRegistered ( const Uri &  aor,
uint64_t *  maxExpires 
)
virtual

Definition at line 218 of file InMemorySyncRegDb.cxx.

◆ getAors()

void InMemorySyncRegDb::getAors ( InMemorySyncRegDb::UriList &  container)
virtual

return all the AOR in the DB

Implements resip::RegistrationPersistenceManager.

Definition at line 200 of file InMemorySyncRegDb.cxx.

◆ getContacts()

void InMemorySyncRegDb::getContacts ( const Uri &  aor,
ContactList &  container 
)
virtual

Implements resip::RegistrationPersistenceManager.

Definition at line 403 of file InMemorySyncRegDb.cxx.

◆ getContactsFull()

void InMemorySyncRegDb::getContactsFull ( const Uri &  aor,
ContactList &  container 
)
virtual

Definition at line 433 of file InMemorySyncRegDb.cxx.

◆ initialSync()

void InMemorySyncRegDb::initialSync ( unsigned int  connectionId)
virtual

Definition at line 121 of file InMemorySyncRegDb.cxx.

◆ invokeOnAorModified()

void InMemorySyncRegDb::invokeOnAorModified ( bool  sync,
const resip::Uri &  aor,
const ContactList &  contacts 
)
protected

Definition at line 93 of file InMemorySyncRegDb.cxx.

◆ invokeOnInitialSyncAor()

void InMemorySyncRegDb::invokeOnInitialSyncAor ( unsigned int  connectionId,
const resip::Uri &  aor,
const ContactList &  contacts 
)
protected

Definition at line 108 of file InMemorySyncRegDb.cxx.

◆ lockRecord()

void InMemorySyncRegDb::lockRecord ( const Uri &  aor)
virtual

Implements resip::RegistrationPersistenceManager.

Definition at line 255 of file InMemorySyncRegDb.cxx.

◆ removeAor()

void InMemorySyncRegDb::removeAor ( const Uri &  aor)
virtual

Implements resip::RegistrationPersistenceManager.

Definition at line 164 of file InMemorySyncRegDb.cxx.

◆ removeContact()

void InMemorySyncRegDb::removeContact ( const Uri &  aor,
const ContactInstanceRecord &  rec 
)
virtual

Implements resip::RegistrationPersistenceManager.

Definition at line 353 of file InMemorySyncRegDb.cxx.

◆ removeHandler()

void InMemorySyncRegDb::removeHandler ( InMemorySyncRegDbHandler *  handler)
virtual

Definition at line 79 of file InMemorySyncRegDb.cxx.

◆ unlockRecord()

void InMemorySyncRegDb::unlockRecord ( const Uri &  aor)
virtual

Implements resip::RegistrationPersistenceManager.

Definition at line 275 of file InMemorySyncRegDb.cxx.

◆ updateContact()

RegistrationPersistenceManager::update_status_t InMemorySyncRegDb::updateContact ( const resip::Uri &  aor,
const ContactInstanceRecord &  rec 
)
virtual

Implements resip::RegistrationPersistenceManager.

Definition at line 299 of file InMemorySyncRegDb.cxx.

Member Data Documentation

◆ mDatabase

database_map_t resip::InMemorySyncRegDb::mDatabase
protected

Definition at line 85 of file InMemorySyncRegDb.hxx.

◆ mDatabaseMutex

Mutex resip::InMemorySyncRegDb::mDatabaseMutex
protected

Definition at line 86 of file InMemorySyncRegDb.hxx.

◆ mHandlerMutex

Mutex resip::InMemorySyncRegDb::mHandlerMutex
protected

Definition at line 97 of file InMemorySyncRegDb.hxx.

◆ mHandlers

HandlerList resip::InMemorySyncRegDb::mHandlers
protected

Definition at line 96 of file InMemorySyncRegDb.hxx.

◆ mLockedRecords

std::set<Uri> resip::InMemorySyncRegDb::mLockedRecords
protected

Definition at line 88 of file InMemorySyncRegDb.hxx.

◆ mLockedRecordsMutex

Mutex resip::InMemorySyncRegDb::mLockedRecordsMutex
protected

Definition at line 89 of file InMemorySyncRegDb.hxx.

◆ mRecordUnlocked

Condition resip::InMemorySyncRegDb::mRecordUnlocked
protected

Definition at line 90 of file InMemorySyncRegDb.hxx.

◆ mRemoveLingerSecs

unsigned int resip::InMemorySyncRegDb::mRemoveLingerSecs
protected

Definition at line 94 of file InMemorySyncRegDb.hxx.


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