|
IBR-DTN
1.0.0
|
#include <SimpleBundleStorage.h>


Protected Member Functions | |
| virtual void | componentUp () throw () |
| virtual void | componentDown () throw () |
| virtual void | eventBundleExpired (const dtn::data::MetaBundle &b) throw () |
Protected Member Functions inherited from dtn::storage::BundleStorage | |
| 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 () |
Additional Inherited Members | |
Public Types inherited from dtn::storage::BundleSeeker | |
| typedef std::set< dtn::data::EID > | eid_set |
Protected Attributes inherited from dtn::storage::BundleStorage | |
| bool | _faulty |
This storage holds all bundles and fragments in the system memory.
Definition at line 54 of file SimpleBundleStorage.h.
| dtn::storage::SimpleBundleStorage::SimpleBundleStorage | ( | const ibrcommon::File & | workdir, |
| const dtn::data::Length | maxsize = 0, |
||
| const unsigned int | buffer_limit = 0 |
||
| ) |
Constructor
Definition at line 48 of file SimpleBundleStorage.cpp.
|
virtual |
Destructor
Definition at line 53 of file SimpleBundleStorage.cpp.
|
virtual |
Reimplemented from dtn::storage::BundleStorage.
Definition at line 451 of file SimpleBundleStorage.cpp.
References dtn::storage::MetaStorage::begin(), dtn::storage::MetaStorage::end(), and dtn::storage::DataStorage::remove().

|
protectedvirtual | |||||||||||||
Implements dtn::daemon::IntegratedComponent.
Definition at line 191 of file SimpleBundleStorage.cpp.
References dtn::storage::MetaStorage::clear(), dtn::storage::BundleStorage::clearSpace(), dtn::core::EventDispatcher< E >::remove(), dtn::storage::DataStorage::reset(), and dtn::storage::DataStorage::wait().

|
protectedvirtual | |||||||||||||
Implements dtn::daemon::IntegratedComponent.
Definition at line 169 of file SimpleBundleStorage.cpp.
References dtn::core::EventDispatcher< E >::add(), info(), dtn::storage::DataStorage::iterateAll(), and dtn::storage::MetaStorage::size().

|
virtual |
This method returns true if the requested bundle is stored in the storage.
Implements dtn::storage::BundleStorage.
Definition at line 380 of file SimpleBundleStorage.cpp.
References dtn::storage::MetaStorage::contains().

|
virtual |
Reimplemented from dtn::storage::BundleStorage.
Definition at line 239 of file SimpleBundleStorage.cpp.
References dtn::storage::MetaStorage::size().

|
virtual |
Reimplemented from dtn::storage::BundleStorage.
Definition at line 227 of file SimpleBundleStorage.cpp.
References dtn::storage::MetaStorage::empty().

|
protectedvirtual | ||||||||||||||
Implements dtn::data::BundleList::Listener.
Definition at line 468 of file SimpleBundleStorage.cpp.
References dtn::core::BUNDLE_DELETED, dtn::data::StatusReportBlock::LIFETIME_EXPIRED, dtn::core::BundleExpiredEvent::raise(), and dtn::core::BundleEvent::raise().

|
virtual |
Implements dtn::storage::DataStorage::Callback.
Definition at line 92 of file SimpleBundleStorage.cpp.
References dtn::storage::MetaStorage::begin(), dtn::storage::MetaStorage::end(), dtn::storage::BundleStorage::freeSpace(), dtn::storage::MetaStorage::remove(), and dtn::storage::DataStorage::Hash::value.
Referenced by eventDataStorageRemoveFailed().

|
virtual |
Implements dtn::storage::DataStorage::Callback.
Definition at line 113 of file SimpleBundleStorage.cpp.
References eventDataStorageRemoved(), and dtn::storage::DataStorage::Hash::value.

|
virtual |
Implements dtn::storage::DataStorage::Callback.
Definition at line 57 of file SimpleBundleStorage.cpp.
References dtn::storage::DataStorage::Hash::value.
|
virtual |
Implements dtn::storage::DataStorage::Callback.
Definition at line 65 of file SimpleBundleStorage.cpp.
References dtn::data::MetaBundle::create(), dtn::storage::BundleStorage::freeSpace(), dtn::storage::MetaStorage::remove(), and dtn::storage::DataStorage::Hash::value.

|
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 276 of file SimpleBundleStorage.cpp.
References dtn::storage::BundleStorage::_faulty, dtn::data::AgeBlock::addSeconds(), dtn::data::MetaBundle::create(), dtn::storage::MetaStorage::find(), dtn::data::Bundle::find(), and dtn::storage::DataStorage::retrieve().

|
virtual | ||||||||||||||||||||||||
Implements dtn::storage::BundleStorage.
Definition at line 256 of file SimpleBundleStorage.cpp.
References dtn::utils::Clock::isExpired().

|
virtual |
Implements dtn::storage::BundleStorage.
Definition at line 343 of file SimpleBundleStorage.cpp.
References dtn::storage::MetaStorage::getDistinctDestinations().

|
virtual |
Implements dtn::daemon::Component.
Definition at line 222 of file SimpleBundleStorage.cpp.
|
virtual |
Get meta data about a specific bundle ID
Implements dtn::storage::BundleStorage.
Definition at line 388 of file SimpleBundleStorage.cpp.
References dtn::data::MetaBundle::create(), and dtn::storage::MetaStorage::find().
Referenced by componentUp().

|
virtual |
Implements dtn::storage::DataStorage::Callback.
Definition at line 121 of file SimpleBundleStorage.cpp.
References dtn::storage::BundleStorage::allocSpace(), dtn::data::MetaBundle::create(), dtn::storage::BundleStorage::eventBundleAdded(), dtn::storage::DataStorage::remove(), store(), dtn::storage::MetaStorage::store(), and dtn::storage::DataStorage::Hash::value.

|
virtual | ||||||||||||||
This method is used to receive events.
| evt |
Implements dtn::core::EventReceiver< dtn::core::TimeEvent >.
Definition at line 213 of file SimpleBundleStorage.cpp.
References dtn::core::TIME_SECOND_TICK.
|
virtual |
Implements dtn::storage::BundleStorage.
Definition at line 233 of file SimpleBundleStorage.cpp.
|
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 396 of file SimpleBundleStorage.cpp.
References dtn::data::MetaBundle::create(), dtn::storage::BundleStorage::eventBundleRemoved(), dtn::storage::MetaStorage::find(), dtn::storage::MetaStorage::isRemoved(), dtn::storage::MetaStorage::markRemoved(), and dtn::storage::DataStorage::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 250 of file SimpleBundleStorage.cpp.
References dtn::storage::BundleStorage::_faulty, and dtn::storage::DataStorage::setFaulty().

|
virtual |
Stores a bundle in the storage.
| bundle | The bundle to store. |
Implements dtn::storage::BundleStorage.
Definition at line 349 of file SimpleBundleStorage.cpp.
References dtn::storage::BundleStorage::acceptCustody(), dtn::storage::BundleStorage::allocSpace(), dtn::data::MetaBundle::create(), dtn::data::PrimaryBlock::custodian, and dtn::data::DefaultSerializer::getLength().
Referenced by iterateDataStorage().

|
virtual |
Wait until all the data has been stored to the disk
Reimplemented from dtn::storage::BundleStorage.
Definition at line 245 of file SimpleBundleStorage.cpp.
References dtn::storage::DataStorage::wait().
