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

Classes | |
| class | AutoResetLock |
| class | BlockingTask |
| class | SQLBundleQuery |
| class | SQLiteQueryException |
| class | Task |
| class | TaskExpire |
| class | TaskIdle |
| class | TaskRemove |
Public Member Functions | |
| SQLiteBundleStorage (const ibrcommon::File &path, const size_t &size) | |
| virtual | ~SQLiteBundleStorage () |
| void | openDatabase (const ibrcommon::File &path) |
| void | store (const dtn::data::Bundle &bundle) |
| dtn::data::Bundle | get (const dtn::data::BundleID &id) |
| const std::list < dtn::data::MetaBundle > | get (BundleFilterCallback &cb) |
| void | remove (const dtn::data::BundleID &id) |
| void | clear () |
| void | clearAll () |
| bool | empty () |
| unsigned int | count () |
| void | releaseCustody (const dtn::data::EID &custodian, const dtn::data::BundleID &id) |
| void | raiseEvent (const Event *evt) |
| dtn::data::MetaBundle | remove (const ibrcommon::BloomFilter &) |
| virtual void | trylock () throw (ibrcommon::MutexException) |
| virtual void | enter () throw (ibrcommon::MutexException) |
| virtual void | leave () throw (ibrcommon::MutexException) |
Protected Member Functions | |
| virtual void | componentRun () |
| virtual void | componentUp () |
| virtual void | componentDown () |
| bool | __cancellation () |
Friends | |
| class | ::SQLiteBundleStorageTest |
Definition at line 37 of file SQLiteBundleStorage.h.
| dtn::core::SQLiteBundleStorage::SQLiteBundleStorage | ( | const ibrcommon::File & | path, | |
| const size_t & | size | |||
| ) |
Constructor
| Pfad | zum Ordner in denen die Datein gespeichert werden. | |
| Dateiname | der Datenbank | |
| maximale | Größe der Datenbank |
Definition at line 146 of file SQLiteBundleStorage.cpp.
References dtn::core::SQLiteConfigure::configure(), and IBRCOMMON_LOGGER.

| dtn::core::SQLiteBundleStorage::~SQLiteBundleStorage | ( | ) | [virtual] |
destructor
Definition at line 160 of file SQLiteBundleStorage.cpp.
References IBRCOMMON_LOGGER, ibrcommon::JoinableThread::join(), dtn::core::SQLiteConfigure::shutdown(), and ibrcommon::JoinableThread::stop().

| bool dtn::core::SQLiteBundleStorage::__cancellation | ( | ) | [protected] |
Definition at line 291 of file SQLiteBundleStorage.cpp.
References ibrcommon::Queue< T >::abort().

| void dtn::core::SQLiteBundleStorage::clear | ( | ) |
Clears all bundles and fragments in the storage. Routinginformation won't be deleted.
Definition at line 992 of file SQLiteBundleStorage.cpp.
References ibrcommon::File::createDirectory(), and ibrcommon::File::remove().
Referenced by clearAll().

| void dtn::core::SQLiteBundleStorage::clearAll | ( | ) |
Clears the hole database.
Definition at line 980 of file SQLiteBundleStorage.cpp.
References clear().

| void dtn::core::SQLiteBundleStorage::componentDown | ( | ) | [protected, virtual] |
Definition at line 284 of file SQLiteBundleStorage.cpp.
References dtn::core::GlobalEvent::className, dtn::core::TimeEvent::className, and dtn::core::EventReceiver::unbindEvent().

| void dtn::core::SQLiteBundleStorage::componentRun | ( | ) | [protected, virtual] |
Definition at line 238 of file SQLiteBundleStorage.cpp.
References ibrcommon::Queue< T >::getnpop().

| void dtn::core::SQLiteBundleStorage::componentUp | ( | ) | [protected, virtual] |
Definition at line 268 of file SQLiteBundleStorage.cpp.
References dtn::core::EventReceiver::bindEvent(), dtn::core::GlobalEvent::className, dtn::core::TimeEvent::className, and openDatabase().

| unsigned int dtn::core::SQLiteBundleStorage::count | ( | ) |
Definition at line 1032 of file SQLiteBundleStorage.cpp.
References IBRCOMMON_LOGGER.
| bool dtn::core::SQLiteBundleStorage::empty | ( | ) |
Definition at line 1018 of file SQLiteBundleStorage.cpp.
| void dtn::core::SQLiteBundleStorage::enter | ( | ) | throw (ibrcommon::MutexException) [virtual] |
Locks everything in the database.
Implements ibrcommon::MutexInterface.
Definition at line 1652 of file SQLiteBundleStorage.cpp.
References ibrcommon::Mutex::enter().

| 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 589 of file SQLiteBundleStorage.cpp.
References IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_DEBUG, and ibrcommon::Exception::what().

| const std::list< dtn::data::MetaBundle > dtn::core::SQLiteBundleStorage::get | ( | BundleFilterCallback & | cb | ) |
Definition at line 515 of file SQLiteBundleStorage.cpp.
References dtn::core::SQLiteBundleStorage::SQLBundleQuery::_statement, dtn::core::SQLiteBundleStorage::SQLBundleQuery::bind(), dtn::core::SQLiteBundleStorage::SQLBundleQuery::getWhere(), and IBRCOMMON_LOGGER_DEBUG.

| void dtn::core::SQLiteBundleStorage::leave | ( | ) | throw (ibrcommon::MutexException) [virtual] |
Unlocks everything in the database.
Implements ibrcommon::MutexInterface.
Definition at line 1662 of file SQLiteBundleStorage.cpp.
References ibrcommon::Mutex::leave().

| void dtn::core::SQLiteBundleStorage::openDatabase | ( | const ibrcommon::File & | path | ) |
open the database
Definition at line 184 of file SQLiteBundleStorage.cpp.
References ibrcommon::File::createDirectory(), ibrcommon::File::get(), ibrcommon::File::getPath(), IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_LEVEL, and dtn::core::sql_tracer().
Referenced by componentUp().

| void dtn::core::SQLiteBundleStorage::raiseEvent | ( | const Event * | evt | ) |
This method is used to receive events.
| evt |
Definition at line 1338 of file SQLiteBundleStorage.cpp.
References dtn::core::GlobalEvent::getAction(), dtn::core::TimeEvent::getAction(), dtn::core::TimeEvent::getTimestamp(), and ibrcommon::Queue< T >::push().

| void dtn::core::SQLiteBundleStorage::releaseCustody | ( | const dtn::data::EID & | custodian, | |
| const dtn::data::BundleID & | id | |||
| ) |
Definition at line 1599 of file SQLiteBundleStorage.cpp.
| dtn::data::MetaBundle dtn::core::SQLiteBundleStorage::remove | ( | const ibrcommon::BloomFilter & | ) | [inline] |
Remove all bundles which match this filter
| filter |
Definition at line 312 of file SQLiteBundleStorage.h.
| 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 763 of file SQLiteBundleStorage.cpp.
References ibrcommon::Queue< T >::push().

| void dtn::core::SQLiteBundleStorage::store | ( | const dtn::data::Bundle & | bundle | ) |
Stores a bundle in the storage.
| bundle | The bundle to store. |
Definition at line 673 of file SQLiteBundleStorage.cpp.
References dtn::data::PrimaryBlock::_appdatalength, dtn::data::PrimaryBlock::_custodian, dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_lifetime, dtn::data::PrimaryBlock::_procflags, dtn::data::PrimaryBlock::_reportto, dtn::data::PrimaryBlock::_source, dtn::data::PrimaryBlock::_timestamp, dtn::core::BundleStorage::acceptCustody(), dtn::data::PrimaryBlock::FRAGMENT, dtn::data::PrimaryBlock::get(), dtn::data::EID::getString(), IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_DEBUG, dtn::core::BundleCore::local, dtn::data::EID::sameHost(), and dtn::data::Bundle::toString().

| void dtn::core::SQLiteBundleStorage::trylock | ( | ) | throw (ibrcommon::MutexException) [virtual] |
Try to lock everything in the database.
Implements ibrcommon::MutexInterface.
Definition at line 1646 of file SQLiteBundleStorage.cpp.
friend class ::SQLiteBundleStorageTest [friend] |
Definition at line 110 of file SQLiteBundleStorage.h.
1.7.1