|
IBR-DTNSuite 0.6
|
#include <SQLiteBundleStorage.h>


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) |
| 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 147 of file SQLiteBundleStorage.cpp.
References dtn::core::SQLiteConfigure::configure(), IBRCOMMON_LOGGER, and IBRCOMMON_LOGGER_ENDL.

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

| bool dtn::core::SQLiteBundleStorage::__cancellation | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 292 of file SQLiteBundleStorage.cpp.
References ibrcommon::Queue< T >::abort().

| void dtn::core::SQLiteBundleStorage::clear | ( | ) | [virtual] |
Clears all bundles and fragments in the storage. Routinginformation won't be deleted.
Reimplemented from dtn::core::BundleStorage.
Definition at line 1022 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 1010 of file SQLiteBundleStorage.cpp.
References clear().

| void dtn::core::SQLiteBundleStorage::componentDown | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 285 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] |
Implements dtn::daemon::IndependentComponent.
Definition at line 239 of file SQLiteBundleStorage.cpp.
References ibrcommon::Queue< T >::getnpop().

| void dtn::core::SQLiteBundleStorage::componentUp | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 269 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 | ( | ) | [virtual] |
Reimplemented from dtn::core::BundleStorage.
Definition at line 1062 of file SQLiteBundleStorage.cpp.
References IBRCOMMON_LOGGER, and IBRCOMMON_LOGGER_ENDL.
| bool dtn::core::SQLiteBundleStorage::empty | ( | ) | [virtual] |
Reimplemented from dtn::core::BundleStorage.
Definition at line 1048 of file SQLiteBundleStorage.cpp.
| void dtn::core::SQLiteBundleStorage::enter | ( | ) | throw (ibrcommon::MutexException) [virtual] |
Locks everything in the database.
Implements ibrcommon::MutexInterface.
Definition at line 1685 of file SQLiteBundleStorage.cpp.
References ibrcommon::Mutex::enter().

| const std::list< dtn::data::MetaBundle > dtn::core::SQLiteBundleStorage::get | ( | BundleFilterCallback & | cb | ) | [virtual] |
Implements dtn::core::BundleStorage.
Definition at line 518 of file SQLiteBundleStorage.cpp.
References dtn::core::SQLiteBundleStorage::SQLBundleQuery::_statement, dtn::core::SQLiteBundleStorage::SQLBundleQuery::bind(), dtn::core::SQLiteBundleStorage::SQLBundleQuery::getWhere(), IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, dtn::core::BundleStorage::BundleFilterCallback::limit(), and dtn::core::BundleStorage::BundleFilterCallback::shouldAdd().

| dtn::data::Bundle dtn::core::SQLiteBundleStorage::get | ( | const dtn::data::BundleID & | id | ) | [virtual] |
This method returns a specific bundle which is identified by its id.
| id | The ID of the bundle to return. |
Implements dtn::core::BundleStorage.
Definition at line 619 of file SQLiteBundleStorage.cpp.
References IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, and ibrcommon::Exception::what().

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

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

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

| void dtn::core::SQLiteBundleStorage::releaseCustody | ( | const dtn::data::EID & | custodian, |
| const dtn::data::BundleID & | id | ||
| ) | [virtual] |
Implements dtn::core::BundleStorage.
Definition at line 1632 of file SQLiteBundleStorage.cpp.
| void dtn::core::SQLiteBundleStorage::remove | ( | const dtn::data::BundleID & | id | ) | [virtual] |
This method deletes a specific bundle in the storage. No reports will be generated here.
| id | The ID of the bundle to remove. |
Implements dtn::core::BundleStorage.
Definition at line 793 of file SQLiteBundleStorage.cpp.
References ibrcommon::Queue< T >::push().

| void dtn::core::SQLiteBundleStorage::store | ( | const dtn::data::Bundle & | bundle | ) | [virtual] |
Stores a bundle in the storage.
| bundle | The bundle to store. |
Implements dtn::core::BundleStorage.
Definition at line 703 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::DESTINATION_IS_SINGLETON, dtn::data::PrimaryBlock::FRAGMENT, dtn::data::PrimaryBlock::get(), dtn::data::EID::getString(), IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, 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 1679 of file SQLiteBundleStorage.cpp.
friend class ::SQLiteBundleStorageTest [friend] |
Definition at line 110 of file SQLiteBundleStorage.h.