This class provides functions to handle storing a list of cdrs to the corresponding balance sheets and to the file system.
Definition at line 75 of file bsstorage.h.
typedef std::map<Contract::Oid, BsCdrs> OSB_LIB::BsStorage::BsMap [private] |
OSB_LIB::BsStorage::BsStorage | ( | ) | [inline] |
void OSB_LIB::BsStorage::addCdr | ( | const Cdr & | cdr | ) |
Add rated CDR to container.
cdr | CDR to add. |
void OSB_LIB::BsStorage::assignCdrs | ( | const OSB_DB::Session & | session | ) |
Assign CDRs to balance sheets.
session | Database session used by the balance sheets to create new pages if needed. |
void OSB_LIB::BsStorage::clearRecoveryId | ( | const OSB_DB::Session & | session | ) |
Unset the recovery id in all balance sheets.
session | Database session to use. |
OsbException | from BalanceSheet::clearRecoveryId(). |
void OSB_LIB::BsStorage::commitCdrs | ( | ) |
Commit CDR changes to the file system.
Clean-up any files needed for recovery that have been created during writeCdrs().
OsbException | from BalanceSheet::commitCdrs(). |
ContainerIter OSB_LIB::BsStorage::containerBegin | ( | ) |
ContainerIter OSB_LIB::BsStorage::containerEnd | ( | ) |
void OSB_LIB::BsStorage::eraseBs | ( | const Contract::Oid & | coId | ) |
Remove a balance sheet from bsMap_.
coId | Contract id of the balance sheet. |
OsbException | if the balance sheet exists in bsMap_ and is locked. |
BalanceSheet& OSB_LIB::BsStorage::getBs | ( | const Contract::Oid & | coId | ) |
Get a balance sheet from bsMap_.
coId | Contract id of the balance sheet. |
OsbException | if the balance sheet for the contract does not exist in bsMap_. |
void OSB_LIB::BsStorage::insertBs | ( | const Contract::Oid & | coId | ) |
Insert an empty balance sheet into bsMap_.
coId | Contract id of the balance sheet. |
OsbException | if the balance sheet for the contract already exists in bsMap_. |
void OSB_LIB::BsStorage::lockBs | ( | const OSB_DB::Session & | session | ) |
Lock all balance sheets.
session | Database session to use. |
long OSB_LIB::BsStorage::numBs | ( | ) | const |
Number of BalanceSheet in bsMap_.
long OSB_LIB::BsStorage::numCdrs | ( | ) | const [inline] |
Return the number of cdrs that are stored.
A count done on the number of cdrs before they are saved to the corresponding balance sheets.
Definition at line 247 of file bsstorage.h.
References numCdrs_.
void OSB_LIB::BsStorage::reset | ( | ) |
bool OSB_LIB::BsStorage::restoreCdrs | ( | OSB_DB::Session & | session | ) |
Restore CDRs after a failure.
session | Database session to unset and commit the recovery id to the database. |
void OSB_LIB::BsStorage::setUnlocked | ( | ) |
Unlocked balance sheets.
void OSB_LIB::BsStorage::updateBs | ( | const OSB_DB::Session & | session | ) |
Update the usage charges of the balance sheets in the database.
session | Database session to use. |
void OSB_LIB::BsStorage::writeCdrs | ( | long | recoveryId, | |
OSB_DB::Session & | session, | |||
Asn1Writer & | writer | |||
) |
Write the CDRs to the file system.
recoveryId | Recovery mark to write to the CDR file. | |
session | Session used to update and commit the recovery id in the database. | |
writer | ASN.1 writer to use. |
friend class ContainerIter [friend] |
The CDR list iterator class must know how the CDR containers are organized.
Definition at line 78 of file bsstorage.h.
BsMap OSB_LIB::BsStorage::bsMap_ [private] |
Container with modified balance sheets and related CDRs.
bsMap_ should contain only balance sheets that are modified during the rating process. This is to avoid unnecessary locking of balance sheets.
Definition at line 266 of file bsstorage.h.
long OSB_LIB::BsStorage::numCdrs_ [private] |