IBR-DTNSuite
0.8
|
#include <BundleStorage.h>
Definition at line 25 of file BundleStorage.h.
dtn::storage::BundleStorage::~BundleStorage | ( | ) | [pure virtual] |
destructor
Definition at line 22 of file BundleStorage.cpp.
dtn::storage::BundleStorage::BundleStorage | ( | ) | [protected] |
constructor
Definition at line 18 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 36 of file BundleStorage.cpp.
References dtn::data::CustodySignalBlock::_custody_accepted, dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_source, dtn::data::MetaBundle::custodian, dtn::core::CUSTODY_ACCEPT, 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(), and dtn::data::CustodySignalBlock::setMatch().
Referenced by dtn::storage::SimpleBundleStorage::store(), and dtn::storage::SQLiteBundleStorage::store().
virtual void dtn::storage::BundleStorage::clear | ( | ) | [inline, virtual] |
Clears all bundles and fragments in the storage.
Reimplemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Definition at line 128 of file BundleStorage.h.
virtual unsigned int dtn::storage::BundleStorage::count | ( | ) | [inline, virtual] |
Reimplemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Definition at line 138 of file BundleStorage.h.
virtual bool dtn::storage::BundleStorage::empty | ( | ) | [inline, virtual] |
Reimplemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Definition at line 133 of file BundleStorage.h.
virtual dtn::data::Bundle dtn::storage::BundleStorage::get | ( | const dtn::data::BundleID & | id | ) | [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::core::FragmentManager::componentRun(), dtn::net::FileConvergenceLayer::componentRun(), dtn::routing::BaseRouter::getBundle(), dtn::routing::ProphetRoutingExtension::processHandshake(), dtn::net::UDPConvergenceLayer::queue(), dtn::net::HTTPConvergenceLayer::queue(), dtn::core::BundleCore::raiseEvent(), dtn::routing::BaseRouter::raiseEvent(), dtn::api::Registration::receive(), dtn::net::LOWPANConnectionSender::run(), dtn::routing::NeighborRoutingExtension::run(), dtn::api::ExtendedApiHandler::run(), dtn::routing::FloodRoutingExtension::run(), dtn::routing::StaticRoutingExtension::run(), dtn::routing::EpidemicRoutingExtension::run(), dtn::core::FragmentManager::setOffset(), dtn::api::BundleStreamBuf::underflow(), and dtn::api::Registration::underflow().
virtual const std::list<dtn::data::MetaBundle> dtn::storage::BundleStorage::get | ( | BundleFilterCallback & | cb | ) | [pure virtual] |
Query the database for a number of bundles. The bundles are selected with the BundleFilterCallback class which is to implement by the user of this method.
cb | The instance of the callback filter class. |
Implemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
virtual const std::set<dtn::data::EID> dtn::storage::BundleStorage::getDistinctDestinations | ( | ) | [pure virtual] |
Return a set of distinct destinations for all bundles in the storage.
Implemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Referenced by dtn::dht::DHTNameService::componentRun().
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 73 of file BundleStorage.cpp.
References dtn::data::PrimaryBlock::_destination, dtn::data::CustodySignalBlock::_reason, dtn::data::PrimaryBlock::_source, dtn::data::MetaBundle::custodian, dtn::core::CUSTODY_REJECT, dtn::data::MetaBundle::get(), dtn::core::BundleCore::local, dtn::data::Bundle::push_back(), dtn::core::BundleGeneratedEvent::raise(), dtn::core::CustodyEvent::raise(), and dtn::data::CustodySignalBlock::setMatch().
virtual void dtn::storage::BundleStorage::releaseCustody | ( | const dtn::data::EID & | custodian, |
const dtn::data::BundleID & | id | ||
) | [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.
Referenced by dtn::core::BundleCore::raiseEvent().
virtual void dtn::storage::BundleStorage::remove | ( | const dtn::data::BundleID & | id | ) | [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::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 26 of file BundleStorage.cpp.
dtn::data::MetaBundle dtn::storage::BundleStorage::remove | ( | const ibrcommon::BloomFilter & | filter | ) | [virtual] |
Remove one bundles which match this filter
filter |
Reimplemented in dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.
Definition at line 31 of file BundleStorage.cpp.
virtual void dtn::storage::BundleStorage::store | ( | const dtn::data::Bundle & | bundle | ) | [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::routing::BaseRouter::raiseEvent(), and dtn::api::ExtendedApiHandler::run().