IBR-DTN
1.0.0
|
#include <SQLiteBundleStorage.h>
Protected Member Functions | |
virtual void | componentRun () throw () |
virtual void | componentUp () throw () |
virtual void | componentDown () throw () |
void | __cancellation () throw () |
![]() | |
BundleStorage (const dtn::data::Length &maxsize) | |
void | allocSpace (const dtn::data::Length &size) throw (StorageSizeExeededException) |
void | freeSpace (const dtn::data::Length &size) throw () |
void | clearSpace () throw () |
void | eventBundleAdded (const dtn::data::MetaBundle &b) throw () |
void | eventBundleRemoved (const dtn::data::BundleID &id) throw () |
![]() | |
void | run () throw () |
Additional Inherited Members | |
![]() | |
typedef std::set< dtn::data::EID > | eid_set |
![]() | |
bool | _faulty |
Definition at line 51 of file SQLiteBundleStorage.h.
dtn::storage::SQLiteBundleStorage::SQLiteBundleStorage | ( | const ibrcommon::File & | path, |
const dtn::data::Length & | maxsize, | ||
bool | usePersistentBundleSets = false |
||
) |
Constructor
Pfad | zum Ordner in denen die Datein gespeichert werden. |
Dateiname | der Datenbank |
maximale | Größe der Datenbank |
should | bundleSets be stored persistently in database? standard: false |
Definition at line 113 of file SQLiteBundleStorage.cpp.
References dtn::storage::SQLiteDatabase::open(), and dtn::data::BundleSet::setFactory().
|
virtual |
destructor
Definition at line 146 of file SQLiteBundleStorage.cpp.
References dtn::storage::SQLiteDatabase::close(), and dtn::data::BundleSet::setFactory().
|
protectedvirtual |
This method is called after componentDown() and should should guarantee that blocking calls in componentRun() will unblock.
Implements dtn::daemon::IndependentComponent.
Definition at line 219 of file SQLiteBundleStorage.cpp.
|
virtual |
Clears all bundles and fragments in the storage. Routinginformation won't be deleted.
Reimplemented from dtn::storage::BundleStorage.
Definition at line 501 of file SQLiteBundleStorage.cpp.
References dtn::storage::SQLiteDatabase::clear(), and dtn::storage::BundleStorage::clearSpace().
|
protectedvirtual |
This method is called if the component should stop. Clean-up code should be inserted here.
Implements dtn::daemon::IndependentComponent.
Definition at line 207 of file SQLiteBundleStorage.cpp.
References dtn::core::EventDispatcher< E >::remove().
|
protectedvirtual |
This is the run method. The component should loop in there until componentDown() or __cancellation() is called.
Implements dtn::daemon::IndependentComponent.
Definition at line 161 of file SQLiteBundleStorage.cpp.
|
protectedvirtual |
Is called in preparation of the component. Before componentRun() is called.
Implements dtn::daemon::IndependentComponent.
Definition at line 191 of file SQLiteBundleStorage.cpp.
References dtn::core::EventDispatcher< E >::add(), and dtn::storage::SQLiteDatabase::iterateAll().
|
virtual |
This method returns true if the requested bundle is stored in the storage.
Implements dtn::storage::BundleStorage.
Definition at line 465 of file SQLiteBundleStorage.cpp.
References dtn::storage::SQLiteDatabase::contains().
|
virtual |
Reimplemented from dtn::storage::BundleStorage.
Definition at line 530 of file SQLiteBundleStorage.cpp.
References dtn::storage::SQLiteDatabase::count().
ibrcommon::BLOB::Reference dtn::storage::SQLiteBundleStorage::create | ( | ) |
create a new BLOB object within this storage
Definition at line 108 of file SQLiteBundleStorage.cpp.
|
virtual |
Reimplemented from dtn::storage::BundleStorage.
Definition at line 519 of file SQLiteBundleStorage.cpp.
References dtn::storage::SQLiteDatabase::empty().
|
virtual |
callbacks for the sqlite database
Implements dtn::storage::SQLiteDatabase::DatabaseListener.
Definition at line 635 of file SQLiteBundleStorage.cpp.
|
virtual |
This method returns a specific bundle which is identified by its id.
id | The ID of the bundle to return. |
Implements dtn::storage::BundleStorage.
Definition at line 241 of file SQLiteBundleStorage.cpp.
References dtn::data::AgeBlock::addSeconds(), dtn::data::PayloadBlock::BLOCK_TYPE, dtn::storage::SQLiteDatabase::get(), dtn::data::Bundle::push_back(), and dtn::data::SeparateDeserializer::readBlock().
|
virtual |
Implements dtn::storage::BundleStorage.
Definition at line 235 of file SQLiteBundleStorage.cpp.
|
virtual |
Implements dtn::storage::BundleStorage.
Definition at line 224 of file SQLiteBundleStorage.cpp.
References dtn::storage::SQLiteDatabase::getDistinctDestinations().
|
virtual |
Get meta data about a specific bundle ID
Implements dtn::storage::BundleStorage.
Definition at line 475 of file SQLiteBundleStorage.cpp.
References dtn::storage::SQLiteDatabase::get().
|
virtual |
Implements dtn::storage::SQLiteDatabase::DatabaseListener.
Definition at line 626 of file SQLiteBundleStorage.cpp.
References dtn::storage::BundleStorage::allocSpace(), and dtn::storage::BundleStorage::eventBundleAdded().
|
virtual |
This method is used to receive events.
evt |
Implements dtn::core::EventReceiver< dtn::core::TimeEvent >.
Definition at line 541 of file SQLiteBundleStorage.cpp.
References dtn::core::TIME_SECOND_TICK.
|
virtual |
Implements dtn::core::EventReceiver< dtn::core::GlobalEvent >.
Definition at line 549 of file SQLiteBundleStorage.cpp.
References dtn::core::GlobalEvent::GLOBAL_BUSY, and dtn::core::GlobalEvent::GLOBAL_IDLE.
|
virtual |
Implements dtn::storage::BundleStorage.
Definition at line 612 of file SQLiteBundleStorage.cpp.
References dtn::storage::SQLiteDatabase::update(), and dtn::storage::SQLiteDatabase::UPDATE_CUSTODIAN.
|
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::storage::BundleStorage.
Definition at line 487 of file SQLiteBundleStorage.cpp.
References dtn::storage::BundleStorage::eventBundleRemoved(), dtn::storage::BundleStorage::freeSpace(), and dtn::storage::SQLiteDatabase::remove().
|
virtual |
Set the storage to faulty. If set to true, each try to store or retrieve a bundle will fail.
Reimplemented from dtn::storage::BundleStorage.
Definition at line 649 of file SQLiteBundleStorage.cpp.
References dtn::storage::BundleStorage::_faulty, and dtn::storage::SQLiteDatabase::setFaulty().
|
virtual |
Stores a bundle in the storage.
bundle | The bundle to store. |
Implements dtn::storage::BundleStorage.
Definition at line 340 of file SQLiteBundleStorage.cpp.
References dtn::storage::BundleStorage::acceptCustody(), dtn::storage::BundleStorage::allocSpace(), dtn::data::Bundle::begin(), dtn::data::PayloadBlock::BLOCK_TYPE, dtn::storage::SQLiteDatabase::commit(), dtn::data::MetaBundle::create(), dtn::data::Bundle::end(), dtn::storage::BundleStorage::eventBundleAdded(), dtn::storage::BundleStorage::freeSpace(), dtn::data::PayloadBlock::getBLOB(), dtn::data::DefaultSerializer::getLength(), dtn::data::Block::getType(), dtn::storage::SQLiteDatabase::rollback(), dtn::storage::BundleStorage::size(), dtn::storage::SQLiteDatabase::store(), dtn::data::BundleID::toString(), dtn::storage::SQLiteDatabase::transaction(), dtn::storage::SQLiteDatabase::update(), and dtn::storage::SQLiteDatabase::UPDATE_CUSTODIAN.
|
virtual |
Wait until all the data has been stored to the disk
Reimplemented from dtn::storage::BundleStorage.
Definition at line 644 of file SQLiteBundleStorage.cpp.