Definition at line 195 of file recordstream.h.
Default constructor with optional object id.
It default initializes all POD data members and sets
OSB_LIB::RecordStreamInfo::RecordStreamInfo | ( | const RecordSource::Oid & | rsId, | |
RecordStream::Type | type, | |||
RecordStream::Media | media, | |||
const std::string & | filename = "" | |||
) |
Constructor with record source id.
rsId | Record source of the stream. | |
type | Type of the stream. | |
media | Media of the stream. | |
filename | Filename of the stream. |
OsbException | if filename is too long (see database table definition for maximum length). |
If the filename is not supplied it will be generated during insertion to the database.
OSB_LIB::RecordStreamInfo::RecordStreamInfo | ( | const std::string & | format, | |
ModuleId | generator, | |||
RecordStream::Type | type, | |||
RecordStream::Media | media, | |||
const std::string & | filename = "" | |||
) |
Constructor with record source info.
format | Format of the output generated. | |
generator | Generator of record streams of this source. | |
type | Type of the stream. | |
media | Media of the stream. | |
filename | Filename of the stream. |
OsbException | if filename is too long (see database table definition for maximum length). |
If the filename is not supplied it will be generated during insertion to the database.
ObjectStatus OSB_LIB::RecordStreamInfo::checkObjVs | ( | const OSB_DB::Session & | session, | |
bool | doThrow = false | |||
) | const |
Check if the record stream was modified in the database.
session | Database session to use. | |
doThrow | Throw if the stream was modified or deleted from the database since it was read last time. |
void OSB_LIB::RecordStreamInfo::clear | ( | ) |
Clear the record stream information.
After the fuction returns, the status of the record stream information is as if constructed with source id, type and media.
long OSB_LIB::RecordStreamInfo::curRecords | ( | ) | const [inline] |
Returns the number of current records to be processing.
Definition at line 307 of file recordstream.h.
References curRecords_.
long OSB_LIB::RecordStreamInfo::errorRecords | ( | ) | const [inline] |
Returns the number of error records.
Definition at line 311 of file recordstream.h.
References errorRecords_.
const std::string& OSB_LIB::RecordStreamInfo::filename | ( | ) | const [inline] |
Returns the filename where the record streams are stored.
Definition at line 293 of file recordstream.h.
References filename_.
long OSB_LIB::RecordStreamInfo::filteredRecords | ( | ) | const [inline] |
Returns the number of filtered records.
Definition at line 309 of file recordstream.h.
References filteredRecords_.
const DateTime& OSB_LIB::RecordStreamInfo::firstRecord | ( | ) | const [inline] |
Returns the timestamp of the first record.
Definition at line 297 of file recordstream.h.
References firstRecord_.
bool OSB_LIB::RecordStreamInfo::getNext | ( | const OSB_DB::Session & | session, | |
const ModuleId | processor, | |||
const std::string & | format = std::string("") , |
|||
RecordStream::Status | status = RecordStream::rsReady | |||
) |
Read the next record stream based on record source format.
This will read the next record stream from the database based on record source format, module and record stream status. If there is no records it will return as false.
session | Database session to use. | |
format | Record source format to use. | |
processor | Module which is going to process the record stream. | |
status | Status for the record stream requested. |
bool OSB_LIB::RecordStreamInfo::getNext | ( | const OSB_DB::Session & | session, | |
const ModuleId | processor, | |||
const RecordSource::Oid & | srcId, | |||
RecordStream::Status | status = RecordStream::rsReady | |||
) |
Read the next record stream based on record source id.
This will read the next record stream from the database based on record source id, module and record stream status. If there is no records it will return as false.
session | Database session to use. | |
processor | Module which is going to process the stream. | |
srcId | Record source id, if not set all streams for processor are taken into consideration. | |
status | Status for the record stream requested. |
bool OSB_LIB::RecordStreamInfo::insert | ( | const OSB_DB::Session & | session | ) |
Insert the record stream object into the database.
Insert the record stream into the database. In case of success the function sets oid_, seqNo_ and -if empty- filename_.
session | Database session to use. |
OsbException | in case of a database error. | |
InvalidSource |
const DateTime& OSB_LIB::RecordStreamInfo::lastRecord | ( | ) | const [inline] |
Returns the timestamp of the last record.
Definition at line 299 of file recordstream.h.
References lastRecord_.
void OSB_LIB::RecordStreamInfo::lock | ( | const OSB_DB::Session & | session | ) | [private] |
Lock the record stream in the database.
session | Database session to use. |
ObjectModified | ||
ObjectDeleted |
long OSB_LIB::RecordStreamInfo::noRecords | ( | ) | const [inline] |
Returns number of records in the stream.
Definition at line 295 of file recordstream.h.
References noRecords_.
const Oid& OSB_LIB::RecordStreamInfo::oid | ( | ) | const [inline] |
Returns the unique object identifier of the record stream.
Definition at line 289 of file recordstream.h.
References oid_.
void OSB_LIB::RecordStreamInfo::onErrorRecord | ( | ) |
Count the number of error records in the record stream.
void OSB_LIB::RecordStreamInfo::onFilteredRecord | ( | ) |
Count the number of filtered records in the record stream.
void OSB_LIB::RecordStreamInfo::onNewRecord | ( | const DateTime & | ts | ) |
Set the first and/or last record.
Increments noRecords_ and curRecords_ and adjusts the time-stamp of the stream's first and last record.
ts | Timestamp of the new record, ignored if not set. |
const Oid& OSB_LIB::RecordStreamInfo::originStreamId | ( | ) | const [inline] |
Returns the origin stream id.
Definition at line 301 of file recordstream.h.
References originStreamId_.
bool OSB_LIB::RecordStreamInfo::read | ( | const OSB_DB::Session & | session | ) |
Read the record stream from the database.
session | Database session to use. |
const RecordSource& OSB_LIB::RecordStreamInfo::recordSource | ( | ) | const [inline] |
Returns the record source id for this record stream.
Definition at line 315 of file recordstream.h.
References source_.
bool OSB_LIB::RecordStreamInfo::remove | ( | const OSB_DB::Session & | session | ) |
Remove the record stream object from the database.
This will remove the record stream from the database. Before calling this function the object id should be assigned to identify the object from the database.
session | Database session to use. |
OsbException | if the stream can not be locked in database (see lock()). |
void OSB_LIB::RecordStreamInfo::resetTimeStamps | ( | ) |
bool OSB_LIB::RecordStreamInfo::save | ( | const OSB_DB::Session & | session | ) |
Save the record stream object into the database.
Inserts a new record stream into the database if origin stream of current record stream is not of error type, else re-uses origin stream and update origin stream in the database.
session | Database session to use. |
OsbException |
|
long OSB_LIB::RecordStreamInfo::seqNo | ( | ) | const [inline] |
Returns the sequence for the record source for this stream.
Definition at line 291 of file recordstream.h.
References seqNo_.
void OSB_LIB::RecordStreamInfo::setCurRecords | ( | long | curRecords | ) |
Set the number of current records to be processed.
void OSB_LIB::RecordStreamInfo::setErrorRecords | ( | long | errorRecords | ) |
Set the number of error records.
void OSB_LIB::RecordStreamInfo::setFilteredRecords | ( | long | filteredRecords | ) |
Set the number of filtered records.
void OSB_LIB::RecordStreamInfo::setNoRecords | ( | long | noRecords | ) |
Set the number of records in the stream.
void OSB_LIB::RecordStreamInfo::setObjVs | ( | const RecordStreamInfo & | rhs | ) |
Get the object version from another record stream.
rhs | Record stream who's information must be overwritten in the database. |
InvalidOid | if the object id is not set or not the same for both streams. |
void OSB_LIB::RecordStreamInfo::setOriginStreamId | ( | const Oid & | orgStreamId | ) |
Set the origin stream id for this record stream.
bool OSB_LIB::RecordStreamInfo::setProcessing | ( | const OSB_DB::Session & | session | ) |
Mark the record stream as currenctly being processed.
To change the status of the record stream its status in the database must be rsReady.
If the function returns true, the status in the database and status_ is rsProcessing.
session | Database session to use. |
OsbException | if the stream can not be locked in database (see lock()). |
void OSB_LIB::RecordStreamInfo::setStatus | ( | RecordStream::Status | status | ) |
Set the status for this record stream.
RecordStream::Status OSB_LIB::RecordStreamInfo::status | ( | ) | const [inline] |
Returns the status of this record stream.
Definition at line 313 of file recordstream.h.
References status_.
RecordStream::Media OSB_LIB::RecordStreamInfo::streamMedia | ( | ) | const [inline] |
RecordStream::Type OSB_LIB::RecordStreamInfo::streamType | ( | ) | const [inline] |
bool OSB_LIB::RecordStreamInfo::update | ( | const OSB_DB::Session & | session | ) |
Update the record stream object in the database.
This will update the record stream in the database. Before calling this function all the attributes and object id should be set.
session | Database session to use. |
OsbException |
bool OSB_LIB::RecordStreamInfo::updateStatus | ( | const OSB_DB::Session & | session | ) |
Update the status of the record stream in the database.
session | Database session to use. |
OsbException |
friend struct OSB_DB::RecordStreamGw [friend] |
long OSB_LIB::RecordStreamInfo::curRecords_ [private] |
Number of records to be processing.
Definition at line 584 of file recordstream.h.
Referenced by curRecords().
long OSB_LIB::RecordStreamInfo::errorRecords_ [private] |
Number of error records.
Definition at line 588 of file recordstream.h.
Referenced by errorRecords().
std::string OSB_LIB::RecordStreamInfo::filename_ [private] |
Filename of the record stream.
The suggested format is BASENAMEiii.ssssss, where iii is the record source id and ssssss is the sequence number.
Definition at line 570 of file recordstream.h.
Referenced by filename().
Number of records to be filtered.
Definition at line 586 of file recordstream.h.
Referenced by filteredRecords().
Timestamp of the first record.
Definition at line 574 of file recordstream.h.
Referenced by firstRecord().
Timestamp of the last record.
Definition at line 576 of file recordstream.h.
Referenced by lastRecord().
Media of the stream (e.g. file,tcpip sockets).
Definition at line 582 of file recordstream.h.
Referenced by streamMedia().
long OSB_LIB::RecordStreamInfo::noRecords_ [private] |
Number of records in the record stream.
Definition at line 572 of file recordstream.h.
Referenced by noRecords().
long OSB_LIB::RecordStreamInfo::objVs_ [private] |
Oid OSB_LIB::RecordStreamInfo::oid_ [private] |
Unique object identifier for the record stream.
Definition at line 558 of file recordstream.h.
Referenced by oid().
Record stream id of the origin stream.
Definition at line 578 of file recordstream.h.
Referenced by originStreamId().
long OSB_LIB::RecordStreamInfo::seqNo_ [private] |
Running sequence number for the record source.
Definition at line 562 of file recordstream.h.
Referenced by seqNo().
Record source informations.
Definition at line 592 of file recordstream.h.
Referenced by recordSource().
Type of stream (e.g. incoming, regular, error, filter).
Definition at line 580 of file recordstream.h.
Referenced by streamType().