OSB_LIB::FileCdrStorage Class Reference

Inheritance diagram for OSB_LIB::FileCdrStorage:

Inheritance graph
[legend]
Collaboration diagram for OSB_LIB::FileCdrStorage:

Collaboration graph
[legend]
List of all members.

Detailed Description

Store regular output CDRs in a file.

Definition at line 61 of file filecdrstorage.h.

Public Member Functions

Private Member Functions

Private Attributes


Constructor & Destructor Documentation

OSB_LIB::FileCdrStorage::FileCdrStorage ( Asn1Writer writer,
const std::string &  format 
)

Constructor.

Parameters:
writer ASN.1 writer to use.
format Format of the generated stream.

OSB_LIB::FileCdrStorage::FileCdrStorage ( const FileCdrStorage  )  [private]

Prevent copying: not implemented.


Member Function Documentation

OsbError OSB_LIB::FileCdrStorage::beginStream ( const OSB_DB::Session session,
const RecordStreamInfo input 
) [virtual]

Prepare to process a new batch of CDR records.

Parameters:
session Database session to use.
input Information about the input record stream being processed.
Exceptions:
StreamPending (see StreamPending).
Returns:
An OsbError with the appropriate information.
Its boolean operator returns false (no error) in case of success.

Implements OSB_LIB::CdrStorage.

OsbError OSB_LIB::FileCdrStorage::endStream (  )  [virtual]

Finalize the processing of an input stream.

The function is called after the database transactions from storeCdrs() have been committed.

Implements OSB_LIB::CdrStorage.

FileCdrStorage& OSB_LIB::FileCdrStorage::operator= ( const FileCdrStorage  )  [private]

Prevent assignment: not implemented.

OsbError OSB_LIB::FileCdrStorage::prepareWrite ( OSB_DB::Session session  )  [virtual]

Prepare to write the CDRs into files.

Parameters:
session Database session that can be used to mark the CDR files as being changed.
Transactions must be committed.
Note:
The caller of the function should make sure that there's no pending transaction on session.

Implements OSB_LIB::CdrStorage.

bool OSB_LIB::FileCdrStorage::push ( const Cdr cdr,
OsbError error 
) [virtual]

Add a CDR to the result set.

Parameters:
cdr CDR to add.
error Gets error information.
Exceptions:
OsbException if a fatal error occurred.
Returns:
true in case of success, else false and error contains the appropriate information.

Implements OSB_LIB::CdrStorage.

void OSB_LIB::FileCdrStorage::setBaseDir ( const std::string &  baseDir  ) 

Set the CDR base directory.

OsbError OSB_LIB::FileCdrStorage::storeCdrs ( const OSB_DB::Session session,
CdrList errors 
) [virtual]

Maintain the database and rename files to final name.

Closes the output file.

Parameters:
session Database session to use.
errors List to store CDRs that can not be stored.
Returns:
An OsbError with the appropriate information.
Its boolean operator returns false (no error) in case of success.

Implements OSB_LIB::CdrStorage.

bool OSB_LIB::FileCdrStorage::undoChanges ( OSB_DB::Session session  )  [virtual]

Undo all changes on the CDR files and database.

Parameters:
session Database session to undo and commit the transactions done in prepareWrite().
Returns:
true in case of success, else false.
Before the function is called, all database transactions made in storeCdrs() have been rolled-back.

The rollback operation must proceed as much as possible!
This means the function should not throw (unless there's a real emergency), instead appropriate errors should be written to Log.

Implements OSB_LIB::CdrStorage.

OsbError OSB_LIB::FileCdrStorage::writeCdrFiles (  )  [virtual]

Write the CDRs to file(s).

Returns:
An OsbError with the appropriate information.
Its boolean operator returns false (no error) in case of success.

Implements OSB_LIB::CdrStorage.


Member Data Documentation

Asn1Writer& OSB_LIB::FileCdrStorage::asn1Writer_ [private]

ASN.1 writer to use.

Definition at line 182 of file filecdrstorage.h.

std::string OSB_LIB::FileCdrStorage::cdrBaseDir_ [private]

Base directory of CDR file.

Definition at line 193 of file filecdrstorage.h.

std::string OSB_LIB::FileCdrStorage::format_ [private]

Format of the output stream.

Definition at line 191 of file filecdrstorage.h.

RecordStreamInfo::Oid OSB_LIB::FileCdrStorage::inputId_ [private]

Id of input record stream.

Definition at line 184 of file filecdrstorage.h.

CdrOutputFile OSB_LIB::FileCdrStorage::outFile_ [private]

CDR output file.

Definition at line 188 of file filecdrstorage.h.

RecordStreamInfo OSB_LIB::FileCdrStorage::rsInfo_ [private]

Output stream information.

Definition at line 186 of file filecdrstorage.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:15:37 2006 for OSB Library by  doxygen 1.4.7