IBR-DTNSuite  0.8
dtn::storage::BundleStorage Class Reference

#include <BundleStorage.h>

Inheritance diagram for dtn::storage::BundleStorage:

List of all members.

Classes

class  BundleFilterCallback
class  BundleLoadException
class  NoBundleFoundException
class  StorageSizeExeededException

Public Member Functions

virtual ~BundleStorage ()=0
virtual void store (const dtn::data::Bundle &bundle)=0
virtual dtn::data::Bundle get (const dtn::data::BundleID &id)=0
virtual const std::list
< dtn::data::MetaBundle
get (BundleFilterCallback &cb)=0
virtual const std::set
< dtn::data::EID
getDistinctDestinations ()=0
virtual void remove (const dtn::data::BundleID &id)=0
void remove (const dtn::data::Bundle &b)
virtual dtn::data::MetaBundle remove (const ibrcommon::BloomFilter &filter)
virtual void clear ()
virtual bool empty ()
virtual unsigned int count ()
virtual void releaseCustody (const dtn::data::EID &custodian, const dtn::data::BundleID &id)=0
const dtn::data::EID acceptCustody (const dtn::data::MetaBundle &meta)
void rejectCustody (const dtn::data::MetaBundle &meta, dtn::data::CustodySignalBlock::REASON_CODE reason=dtn::data::CustodySignalBlock::NO_ADDITIONAL_INFORMATION)

Protected Member Functions

 BundleStorage ()

Detailed Description

Definition at line 25 of file BundleStorage.h.


Constructor & Destructor Documentation

destructor

Definition at line 22 of file BundleStorage.cpp.

constructor

Definition at line 18 of file BundleStorage.cpp.


Member Function Documentation

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]
Returns:
the count of bundles in the storage

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]
Returns:
True, if no bundles in the storage.

Reimplemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.

Definition at line 133 of file BundleStorage.h.

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.

Parameters:
cbThe instance of the callback filter class.
Returns:
A list of bundles.

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.

Returns:

Implemented in dtn::storage::SQLiteBundleStorage, dtn::storage::SimpleBundleStorage, and dtn::storage::MemoryBundleStorage.

Referenced by dtn::dht::DHTNameService::componentRun().

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.

Parameters:
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.

Parameters:
idThe 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().

This method deletes a specific bundle in the storage. No reports will be generated here.

Parameters:
bThe bundle to remove.

Definition at line 26 of file BundleStorage.cpp.

Remove one bundles which match this filter

Parameters:
filter
Returns:
The bundle meta data of the removed bundle.

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.

Parameters:
bundleThe 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().


The documentation for this class was generated from the following files: