OSB_LIB::ErrRecordFile Class Reference

Collaboration diagram for OSB_LIB::ErrRecordFile:

Collaboration graph
[legend]
List of all members.

Detailed Description

Store CDRs with errors in a file.

Definition at line 61 of file errrecordfile.h.

Public Member Functions

Private Member Functions

Private Attributes


Constructor & Destructor Documentation

OSB_LIB::ErrRecordFile::ErrRecordFile ( Asn1Writer writer,
const std::string &  format,
RecordStream::Type  type,
const size_t  blockSize = 0,
const char  filler = 0x00 
)

Constructor with format and stream type.

Parameters:
writer ASN.1 writer to use.
format Format of the output file.
type Type of the record stream: it should be RecordStream::stError or RecordStream::stFilter.
blockSize Set the size of the ASN.1 block.
filler Character used to fill up the ASN.1 block.
Remarks:
Parameter blockSize and filler are only applicable when writing an ASN.1 data using write(const Asn1Data&, OsbError&) member function.

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

Prevent copying: not implemented.


Member Function Documentation

OsbError OSB_LIB::ErrRecordFile::beginStream ( const OSB_DB::Session session,
const RecordStreamInfo input 
)

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:
OsbException if processing of a stream is currently ongoing.
Returns:
An OsbError with the appropriate information.
Its boolean operator returns false (no error) in case of success.

OsbError OSB_LIB::ErrRecordFile::closeFile (  ) 

Flush and close the output file.

Returns:
An OsbError with the appropriate information.
Its boolean operator returns false (no error) in case of success.
Note:
A warning is written to Log if flushing is successful but the closing of the file fails.

OsbError OSB_LIB::ErrRecordFile::endStream (  ) 

Finalize the processing of an input stream.

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

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

Prevent assignment: not implemented.

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

Set the CDR base directory.

OsbError OSB_LIB::ErrRecordFile::storeCdrs ( const OSB_DB::Session session,
const RecordStreamInfo input 
)

Maintain the database and rename file to final name.

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

bool OSB_LIB::ErrRecordFile::undoChanges ( OSB_DB::Session session  ) 

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.

bool OSB_LIB::ErrRecordFile::write ( const Asn1Data asn1,
OsbError error 
)

Write binary ASN.1 data to the file.

Parameters:
asn1 ASN.1 data to write to add.
error Gets error information.
Returns:
true in case of success, else false and error contains the appropriate information.

bool OSB_LIB::ErrRecordFile::write ( const std::string &  record,
const DateTime timeStamp,
OsbError error 
)

Add an erroneous network CDR to the file.

Parameters:
record CDR as coming from the network or element.
timeStamp Timestamp of the CDR,
it is not set if not available.
error Gets error information.
Returns:
true in case of success, else false and error contains the appropriate information.

bool OSB_LIB::ErrRecordFile::write ( const Cdr cdr,
OsbError error 
)

Add a CDR to the result set.

Parameters:
cdr CDR to add.
error Gets error information.
Returns:
true in case of success, else false and error contains the appropriate information.


Member Data Documentation

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

ASN.1 writer to use.

Definition at line 211 of file errrecordfile.h.

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

Base directory of CDR file.

Definition at line 225 of file errrecordfile.h.

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

Format of the output stream.

Definition at line 221 of file errrecordfile.h.

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

Id of input record stream.

Definition at line 214 of file errrecordfile.h.

CdrOutputFile OSB_LIB::ErrRecordFile::outFile_ [private]

CDR output file.

Definition at line 218 of file errrecordfile.h.

RecordStreamInfo OSB_LIB::ErrRecordFile::rsInfo_ [private]

Output stream information.

Definition at line 216 of file errrecordfile.h.

RecordStream::Type OSB_LIB::ErrRecordFile::streamType_ [private]

Type of the output stream.

Definition at line 223 of file errrecordfile.h.


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