#include <SQLiteBundleStorage.h>
Inherits dtn::core::BundleStorage, dtn::core::EventReceiver, and ibrcommon::JoinableThread.

Classes | |
| class | NoBundleFoundException |
| class | SQLiteQuerryException |
Public Member Functions | |
| SQLiteBundleStorage (const ibrcommon::File &dbPath, const string &dbFile, const int &size) | |
| virtual | ~SQLiteBundleStorage () |
| void | store (const dtn::data::Bundle &bundle) |
| void | storeBundleRoutingInfo (const data::BundleID &BundleID, const int &key, const string &routingInfo) |
| void | storeNodeRoutingInfo (const data::EID &nodel, const int &key, const std::string &routingInfo) |
| void | storeRoutingInfo (const int &key, const std::string &routingInfo) |
| dtn::data::Bundle | get (const dtn::data::BundleID &id) |
| const dtn::data::MetaBundle | getByDestination (const dtn::data::EID &eid, bool exact=false) |
| const dtn::data::MetaBundle | getByFilter (const ibrcommon::BloomFilter &filter) |
| std::string | getBundleRoutingInfo (const data::BundleID &bundleID, const int &key) |
| std::string | getNodeRoutingInfo (const data::EID &eid, const int &key) |
| std::string | getRoutingInfo (const int &key) |
| void | removeBundleRoutingInfo (const data::BundleID &bundleID, const int &key) |
| void | removeNodeRoutingInfo (const data::EID &eid, const int &key) |
| void | removeRoutingInfo (const int &key) |
| void | remove (const dtn::data::BundleID &id) |
| void | clear () |
| void | clearAll () |
| bool | empty () |
| unsigned int | count () |
| void | releaseCustody (dtn::data::BundleID &bundle) |
| void | setPriority (const int priority, const dtn::data::BundleID &id) |
| list< data::Bundle > | getBundleBySize (const int &limit) |
| list< data::Bundle > | getBundleByTTL (const int &limit) |
| list< data::Bundle > | getBundlesBySource (const dtn::data::EID &sourceID) |
| list< data::Bundle > | getBundlesByDestination (const dtn::data::EID &sourceID) |
| list< data::Block > | getBlock (const data::BundleID &bundleID, const char &blocktype) |
| int | occupiedSpace () |
| void | raiseEvent (const Event *evt) |
Protected Member Functions | |
| void | run (void) |
| bool | __cancellation () |
Friends | |
| class | testsuite::SQLiteBundleStorageTestSuite |
Definition at line 20 of file SQLiteBundleStorage.h.
| dtn::core::SQLiteBundleStorage::SQLiteBundleStorage | ( | const ibrcommon::File & | dbPath, | |
| const string & | dbFile, | |||
| const int & | size | |||
| ) |
Constructor
| Pfad | zum Ordner in denen die Datein gespeichert werden. | |
| Dateiname | der Datenbank | |
| maximale | Größe der Datenbank |
Definition at line 46 of file SQLiteBundleStorage.cpp.
References dtn::core::EventReceiver::bindEvent(), dtn::core::GlobalEvent::className, dtn::core::TimeEvent::className, and dtn::core::SQLiteConfigure::configure().

| dtn::core::SQLiteBundleStorage::~SQLiteBundleStorage | ( | ) | [virtual] |
destructor
Definition at line 226 of file SQLiteBundleStorage.cpp.
References dtn::core::GlobalEvent::className, dtn::core::TimeEvent::className, ibrcommon::JoinableThread::join(), and dtn::core::EventReceiver::unbindEvent().

| bool dtn::core::SQLiteBundleStorage::__cancellation | ( | ) | [protected, virtual] |
Reimplemented from ibrcommon::Thread.
Definition at line 1558 of file SQLiteBundleStorage.cpp.
References ibrcommon::Conditional::signal().

| void dtn::core::SQLiteBundleStorage::clear | ( | ) |
Clears all bundles and fragments in the storage. Routinginformation won't be deleted.
Definition at line 1134 of file SQLiteBundleStorage.cpp.
| void dtn::core::SQLiteBundleStorage::clearAll | ( | ) |
Clears the hole database.
Definition at line 1097 of file SQLiteBundleStorage.cpp.
| unsigned int dtn::core::SQLiteBundleStorage::count | ( | ) |
Definition at line 1181 of file SQLiteBundleStorage.cpp.
| bool dtn::core::SQLiteBundleStorage::empty | ( | ) |
Definition at line 1169 of file SQLiteBundleStorage.cpp.
| dtn::data::Bundle dtn::core::SQLiteBundleStorage::get | ( | const dtn::data::BundleID & | id | ) |
This method returns a specific bundle which is identified by its id.
| id | The ID of the bundle to return. |
Definition at line 451 of file SQLiteBundleStorage.cpp.
References dtn::data::PrimaryBlock::_appdatalength, dtn::data::PrimaryBlock::_custodian, dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_fragmentoffset, dtn::data::PrimaryBlock::_lifetime, dtn::data::PrimaryBlock::_procflags, dtn::data::PrimaryBlock::_reportto, dtn::data::PrimaryBlock::_sequencenumber, dtn::data::PrimaryBlock::_source, dtn::data::PrimaryBlock::_timestamp, dtn::data::PrimaryBlock::FRAGMENT, and dtn::data::Bundle::toString().

| list< data::Block > dtn::core::SQLiteBundleStorage::getBlock | ( | const data::BundleID & | bundleID, | |
| const char & | blocktype | |||
| ) |
Gets the Block by its type of a specific Bundle
| BundleID | ||
| Blocktype |
Definition at line 1807 of file SQLiteBundleStorage.cpp.
References dtn::data::BundleID::toString().

| list< data::Bundle > dtn::core::SQLiteBundleStorage::getBundleBySize | ( | const int & | limit | ) |
returns the first 'limit' biggest Bundles
| number | of bundles to return |
Definition at line 729 of file SQLiteBundleStorage.cpp.
References dtn::data::PrimaryBlock::_appdatalength, dtn::data::PrimaryBlock::_custodian, dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_fragmentoffset, dtn::data::PrimaryBlock::_lifetime, dtn::data::PrimaryBlock::_procflags, dtn::data::PrimaryBlock::_reportto, dtn::data::PrimaryBlock::_sequencenumber, dtn::data::PrimaryBlock::_source, dtn::data::PrimaryBlock::_timestamp, and dtn::data::PrimaryBlock::FRAGMENT.
| list< data::Bundle > dtn::core::SQLiteBundleStorage::getBundleByTTL | ( | const int & | limit | ) |
returns the first 'limit' bundles with the lowest expiring time
| number | of bundles to return |
Definition at line 572 of file SQLiteBundleStorage.cpp.
References dtn::data::PrimaryBlock::_appdatalength, dtn::data::PrimaryBlock::_custodian, dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_fragmentoffset, dtn::data::PrimaryBlock::_lifetime, dtn::data::PrimaryBlock::_procflags, dtn::data::PrimaryBlock::_reportto, dtn::data::PrimaryBlock::_sequencenumber, dtn::data::PrimaryBlock::_source, dtn::data::PrimaryBlock::_timestamp, and dtn::data::PrimaryBlock::FRAGMENT.
| std::string dtn::core::SQLiteBundleStorage::getBundleRoutingInfo | ( | const data::BundleID & | bundleID, | |
| const int & | key | |||
| ) |
Returns the routinginformation stored for a specific Bundle.
| ID | to the Bundle |
Definition at line 783 of file SQLiteBundleStorage.cpp.
References dtn::data::BundleID::toString().

| list< data::Bundle > dtn::core::SQLiteBundleStorage::getBundlesByDestination | ( | const dtn::data::EID & | sourceID | ) |
Gets a list of Bundles which all have the specifierd DestinationEID.
| SourceEID |
Definition at line 677 of file SQLiteBundleStorage.cpp.
References dtn::data::PrimaryBlock::_appdatalength, dtn::data::PrimaryBlock::_custodian, dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_fragmentoffset, dtn::data::PrimaryBlock::_lifetime, dtn::data::PrimaryBlock::_procflags, dtn::data::PrimaryBlock::_reportto, dtn::data::PrimaryBlock::_sequencenumber, dtn::data::PrimaryBlock::_source, dtn::data::PrimaryBlock::_timestamp, dtn::data::PrimaryBlock::FRAGMENT, and dtn::data::EID::getString().

| list< data::Bundle > dtn::core::SQLiteBundleStorage::getBundlesBySource | ( | const dtn::data::EID & | sourceID | ) |
Gets a list of Bundles which all have the specifierd SourceEID.
| SourceEID |
Definition at line 625 of file SQLiteBundleStorage.cpp.
References dtn::data::PrimaryBlock::_appdatalength, dtn::data::PrimaryBlock::_custodian, dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_fragmentoffset, dtn::data::PrimaryBlock::_lifetime, dtn::data::PrimaryBlock::_procflags, dtn::data::PrimaryBlock::_reportto, dtn::data::PrimaryBlock::_sequencenumber, dtn::data::PrimaryBlock::_source, dtn::data::PrimaryBlock::_timestamp, dtn::data::PrimaryBlock::FRAGMENT, and dtn::data::EID::getString().

| const dtn::data::MetaBundle dtn::core::SQLiteBundleStorage::getByDestination | ( | const dtn::data::EID & | eid, | |
| bool | exact = false | |||
| ) |
Query for a bundle with a specific destination. Set exact to true, if the application part should be compared too.
| eid | ||
| exact |
Definition at line 512 of file SQLiteBundleStorage.cpp.
References dtn::data::MetaBundle::appdatalength, dtn::data::MetaBundle::custodian, dtn::data::MetaBundle::destination, dtn::data::BundleID::fragment, dtn::data::PrimaryBlock::FRAGMENT, dtn::data::EID::getString(), dtn::data::MetaBundle::lifetime, dtn::data::BundleID::offset, dtn::data::MetaBundle::procflags, dtn::data::MetaBundle::received, dtn::data::MetaBundle::reportto, dtn::data::BundleID::sequencenumber, dtn::data::BundleID::source, and dtn::data::BundleID::timestamp.

| const dtn::data::MetaBundle dtn::core::SQLiteBundleStorage::getByFilter | ( | const ibrcommon::BloomFilter & | filter | ) |
Returns a bundle ID which is not in the bloomfilter, but in the storage
| filter |
Definition at line 566 of file SQLiteBundleStorage.cpp.
| std::string dtn::core::SQLiteBundleStorage::getNodeRoutingInfo | ( | const data::EID & | eid, | |
| const int & | key | |||
| ) |
Returns the routinginformation stored for a specific Node.
| ID | to the Bundle |
Definition at line 805 of file SQLiteBundleStorage.cpp.
References dtn::data::EID::getString().

| std::string dtn::core::SQLiteBundleStorage::getRoutingInfo | ( | const int & | key | ) |
Gets Routinginformation storen refered by Key.
| the | key referring to der routinginformation |
Definition at line 827 of file SQLiteBundleStorage.cpp.
| int dtn::core::SQLiteBundleStorage::occupiedSpace | ( | ) |
Returns the ammount of occupied storage space
Definition at line 1198 of file SQLiteBundleStorage.cpp.
| void dtn::core::SQLiteBundleStorage::raiseEvent | ( | const Event * | evt | ) |
This method is used to receive events.
| evt |
Definition at line 1508 of file SQLiteBundleStorage.cpp.
References dtn::core::GlobalEvent::getAction(), dtn::core::TimeEvent::getAction(), dtn::core::TimeEvent::getTimestamp(), and ibrcommon::Conditional::signal().

| void dtn::core::SQLiteBundleStorage::releaseCustody | ( | dtn::data::BundleID & | bundle | ) |
Definition at line 1856 of file SQLiteBundleStorage.cpp.
| void dtn::core::SQLiteBundleStorage::remove | ( | const dtn::data::BundleID & | id | ) |
This method deletes a specific bundle in the storage. No reports will be generated here.
| id | The ID of the bundle to remove. |
Definition at line 1004 of file SQLiteBundleStorage.cpp.
| void dtn::core::SQLiteBundleStorage::removeBundleRoutingInfo | ( | const data::BundleID & | bundleID, | |
| const int & | key | |||
| ) |
Deletes the Routinginformation of a Bundle
| BundleID |
Definition at line 1053 of file SQLiteBundleStorage.cpp.
References dtn::data::BundleID::toString().

| void dtn::core::SQLiteBundleStorage::removeNodeRoutingInfo | ( | const data::EID & | eid, | |
| const int & | key | |||
| ) |
Deletes Routinginformation of a node
| The | EID of the Node |
Definition at line 1068 of file SQLiteBundleStorage.cpp.
References dtn::data::EID::getString().

| void dtn::core::SQLiteBundleStorage::removeRoutingInfo | ( | const int & | key | ) |
deletes a Routinginformation specified by a key
| key | specifieing the information to be deleted |
Definition at line 1083 of file SQLiteBundleStorage.cpp.
| void dtn::core::SQLiteBundleStorage::run | ( | void | ) | [protected, virtual] |
Abstract interface for thread context run method.
Implements ibrcommon::Thread.
Definition at line 1547 of file SQLiteBundleStorage.cpp.
References ibrcommon::Conditional::wait().

| void dtn::core::SQLiteBundleStorage::setPriority | ( | const int | priority, | |
| const dtn::data::BundleID & | id | |||
| ) |
Sets the priority of the Bundle.
| The | Priority Value between 0 and 3. | |
| BundleId | where the priority should be set. |
Definition at line 848 of file SQLiteBundleStorage.cpp.
References dtn::data::PrimaryBlock::PRIORITY_BIT1, and dtn::data::PrimaryBlock::PRIORITY_BIT2.
| void dtn::core::SQLiteBundleStorage::store | ( | const dtn::data::Bundle & | bundle | ) |
Stores a bundle in the storage.
| bundle | The bundle to store. |
Definition at line 888 of file SQLiteBundleStorage.cpp.
References dtn::data::PrimaryBlock::_appdatalength, dtn::data::PrimaryBlock::_custodian, dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_fragmentoffset, dtn::data::PrimaryBlock::_lifetime, dtn::data::PrimaryBlock::_procflags, dtn::data::PrimaryBlock::_reportto, dtn::data::PrimaryBlock::_sequencenumber, dtn::data::PrimaryBlock::_source, dtn::data::PrimaryBlock::_timestamp, dtn::data::PrimaryBlock::FRAGMENT, dtn::data::EID::getNodeEID(), dtn::data::EID::getString(), and dtn::core::BundleCore::local.

| void dtn::core::SQLiteBundleStorage::storeBundleRoutingInfo | ( | const data::BundleID & | BundleID, | |
| const int & | key, | |||
| const string & | routingInfo | |||
| ) |
store routinginformation referring to a Bundle
| ID | of the Bundle to which the routinginformation is referring | |
| string | containing the routinginformation |
Definition at line 945 of file SQLiteBundleStorage.cpp.
References dtn::data::BundleID::toString().

| void dtn::core::SQLiteBundleStorage::storeNodeRoutingInfo | ( | const data::EID & | nodel, | |
| const int & | key, | |||
| const std::string & | routingInfo | |||
| ) |
store routinginformation reffering to a Node.
| EID | of the Node | |
| A | string routinginformation |
Definition at line 965 of file SQLiteBundleStorage.cpp.
References dtn::data::EID::getString().

| void dtn::core::SQLiteBundleStorage::storeRoutingInfo | ( | const int & | key, | |
| const std::string & | routingInfo | |||
| ) |
store Routinginformation
| Key | which refers to the Routinginformation | |
| string | containing Routinginformation |
Definition at line 985 of file SQLiteBundleStorage.cpp.
friend class testsuite::SQLiteBundleStorageTestSuite [friend] |
Definition at line 36 of file SQLiteBundleStorage.h.
Referenced by dtn::core::SQLiteBundleStorage::NoBundleFoundException::NoBundleFoundException().
1.7.1