IBR-DTNSuite
0.12
|
#include <BundleStorage.h>
Classes | |
class | BundleLoadException |
class | StorageSizeExeededException |
Protected Member Functions | |
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 () |
Protected Attributes | |
bool | _faulty |
Additional Inherited Members | |
Public Types inherited from dtn::storage::BundleSeeker | |
typedef std::set< dtn::data::EID > | eid_set |
Definition at line 44 of file BundleStorage.h.
|
pure virtual |
destructor
Definition at line 40 of file BundleStorage.cpp.
|
protected |
constructor
Definition at line 35 of file BundleStorage.cpp.
const dtn::data::EID dtn::storage::BundleStorage::acceptCustody | ( | const dtn::data::MetaBundle & | meta) |
Accept custody for a given bundle. The previous custodian gets notified with a custody accept message.
bundle |
Definition at line 49 of file BundleStorage.cpp.
References dtn::data::PrimaryBlock::APPDATA_IS_ADMRECORD, dtn::data::MetaBundle::custodian, dtn::core::CUSTODY_ACCEPT, dtn::data::CustodySignalBlock::custody_accepted, dtn::data::PrimaryBlock::destination, dtn::data::PrimaryBlock::DESTINATION_IS_SINGLETON, dtn::data::MetaBundle::get(), dtn::core::BundleCore::local, dtn::data::PrimaryBlock::PRIORITY_BIT1, dtn::data::PrimaryBlock::PRIORITY_BIT2, dtn::data::Bundle::push_back(), dtn::core::BundleGeneratedEvent::raise(), dtn::core::CustodyEvent::raise(), dtn::data::PrimaryBlock::set(), dtn::data::CustodySignalBlock::setMatch(), dtn::data::BundleID::source, and dtn::data::CustodySignalBlock::write().
Referenced by dtn::storage::SimpleBundleStorage::store(), and dtn::storage::SQLiteBundleStorage::store().
|
protected |
Definition at line 131 of file BundleStorage.cpp.
Referenced by dtn::storage::SQLiteBundleStorage::iterateDatabase(), dtn::storage::SimpleBundleStorage::iterateDataStorage(), dtn::storage::MemoryBundleStorage::store(), dtn::storage::SimpleBundleStorage::store(), and dtn::storage::SQLiteBundleStorage::store().
void dtn::storage::BundleStorage::attach | ( | dtn::storage::BundleIndex * | index) |
attach an index to this storage
Definition at line 185 of file BundleStorage.cpp.
|
inlinevirtual |
Clears all bundles and fragments in the storage.
Reimplemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Definition at line 119 of file BundleStorage.h.
Referenced by dtn::daemon::NativeDaemon::clearStorage().
|
protected |
Definition at line 159 of file BundleStorage.cpp.
Referenced by dtn::storage::MemoryBundleStorage::clear(), dtn::storage::SQLiteBundleStorage::clear(), and dtn::storage::SimpleBundleStorage::componentDown().
|
pure virtual |
This method returns true if the requested bundle is stored in the storage.
Implemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Referenced by dtn::core::FragmentManager::componentRun(), and dtn::net::EMailSmtpService::run().
|
inlinevirtual |
Reimplemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Definition at line 129 of file BundleStorage.h.
Referenced by dtn::daemon::NativeDaemon::getStats().
void dtn::storage::BundleStorage::detach | ( | dtn::storage::BundleIndex * | index) |
detach a specific bundle index
Definition at line 191 of file BundleStorage.cpp.
|
inlinevirtual |
Reimplemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Definition at line 124 of file BundleStorage.h.
|
protected |
Definition at line 165 of file BundleStorage.cpp.
References dtn::storage::BundleIndex::add(), IBRCOMMON_LOGGER_DEBUG_TAG, and IBRCOMMON_LOGGER_ENDL.
Referenced by dtn::storage::SQLiteBundleStorage::iterateDatabase(), dtn::storage::SimpleBundleStorage::iterateDataStorage(), dtn::storage::MemoryBundleStorage::store(), and dtn::storage::SQLiteBundleStorage::store().
|
protected |
Definition at line 175 of file BundleStorage.cpp.
References IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, and dtn::storage::BundleIndex::remove().
Referenced by dtn::storage::MemoryBundleStorage::clear(), dtn::storage::MemoryBundleStorage::remove(), dtn::storage::SimpleBundleStorage::remove(), and dtn::storage::SQLiteBundleStorage::remove().
|
protected |
Definition at line 145 of file BundleStorage.cpp.
References ibrcommon::LogLevel::critical, IBRCOMMON_LOGGER_ENDL, and IBRCOMMON_LOGGER_TAG.
Referenced by dtn::storage::SimpleBundleStorage::eventDataStorageRemoved(), dtn::storage::SimpleBundleStorage::eventDataStorageStoreFailed(), dtn::storage::SQLiteBundleStorage::remove(), dtn::storage::MemoryBundleStorage::store(), and dtn::storage::SQLiteBundleStorage::store().
|
pure virtual |
This method returns a specific bundle which is identified by its id.
id | The ID of the bundle to return. |
Implemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Referenced by dtn::net::FileConvergenceLayer::componentRun(), dtn::core::FragmentManager::componentRun(), dtn::api::NativeSession::load(), dtn::routing::NodeHandshakeExtension::processHandshake(), dtn::routing::ProphetRoutingExtension::processHandshake(), dtn::net::UDPConvergenceLayer::queue(), dtn::net::HTTPConvergenceLayer::queue(), dtn::api::Registration::receive(), dtn::net::LOWPANConnectionSender::run(), dtn::api::ExtendedApiHandler::run(), dtn::core::FragmentManager::setOffset(), and dtn::api::BundleStreamBuf::underflow().
|
pure virtual |
Implements dtn::storage::BundleSeeker.
Implemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
|
pure virtual |
Implements dtn::storage::BundleSeeker.
Implemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Referenced by dtn::dht::DHTNameService::componentRun().
|
pure virtual |
Get meta data about a specific bundle ID
Implemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Referenced by dtn::api::NativeSession::delivered(), and dtn::routing::RetransmissionExtension::raiseEvent().
void dtn::storage::BundleStorage::rejectCustody | ( | const dtn::data::MetaBundle & | meta, |
dtn::data::CustodySignalBlock::REASON_CODE | reason = dtn::data::CustodySignalBlock::NO_ADDITIONAL_INFORMATION |
||
) |
Reject custody for a given bundle. The custodian of this bundle gets notified with a custody reject message.
bundle |
Definition at line 91 of file BundleStorage.cpp.
References dtn::data::PrimaryBlock::APPDATA_IS_ADMRECORD, dtn::data::MetaBundle::create(), dtn::data::MetaBundle::custodian, dtn::core::CUSTODY_REJECT, dtn::data::PrimaryBlock::destination, dtn::data::MetaBundle::get(), dtn::core::BundleCore::local, dtn::data::Bundle::push_back(), dtn::core::BundleGeneratedEvent::raise(), dtn::core::CustodyEvent::raise(), dtn::data::CustodySignalBlock::reason, dtn::data::PrimaryBlock::set(), dtn::data::CustodySignalBlock::setMatch(), dtn::data::BundleID::source, and dtn::data::CustodySignalBlock::write().
|
pure virtual |
This method is called if another node accepts custody for a bundle of us.
bundle |
Implemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
|
pure virtual |
This method deletes a specific bundle in the storage. No reports will be generated here.
id | The ID of the bundle to remove. |
Implemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Referenced by dtn::api::NativeSession::free(), dtn::routing::NodeHandshakeExtension::processHandshake(), dtn::core::BundleCore::raiseEvent(), and dtn::api::ExtendedApiHandler::run().
void dtn::storage::BundleStorage::remove | ( | const dtn::data::Bundle & | b) |
This method deletes a specific bundle in the storage. No reports will be generated here.
b | The bundle to remove. |
Definition at line 44 of file BundleStorage.cpp.
|
inlinevirtual |
Set the storage to faulty. If set to true, each try to store or retrieve a bundle will fail.
Reimplemented in dtn::storage::SQLiteBundleStorage, and dtn::storage::SimpleBundleStorage.
Definition at line 179 of file BundleStorage.h.
References _faulty.
dtn::data::Length dtn::storage::BundleStorage::size | ( | ) | const |
Get the current size
Definition at line 126 of file BundleStorage.cpp.
Referenced by dtn::daemon::NativeDaemon::getStats(), dtn::storage::MemoryBundleStorage::store(), and dtn::storage::SQLiteBundleStorage::store().
|
pure virtual |
Stores a bundle in the storage.
bundle | The bundle to store. |
Implemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Referenced by dtn::api::ExtendedApiHandler::run().
|
inlinevirtual |
Wait until all the data has been stored and is not cached anymore
Reimplemented in dtn::storage::SQLiteBundleStorage, and dtn::storage::SimpleBundleStorage.
Definition at line 173 of file BundleStorage.h.
|
protected |
Definition at line 196 of file BundleStorage.h.
Referenced by dtn::storage::MemoryBundleStorage::get(), dtn::storage::SimpleBundleStorage::get(), dtn::storage::SimpleBundleStorage::setFaulty(), dtn::storage::SQLiteBundleStorage::setFaulty(), setFaulty(), and dtn::storage::MemoryBundleStorage::store().