Classes | Public Member Functions | Protected Member Functions | Protected Attributes

dtn::core::BundleStorage Class Reference

#include <BundleStorage.h>

Inherited by dtn::core::SimpleBundleStorage, and dtn::core::SQLiteBundleStorage.

List of all members.

Classes

class  NoBundleFoundException
class  StorageSizeExeededException

Public Member Functions

virtual ~BundleStorage ()=0
void addToFilter (const dtn::data::EID &eid)
virtual void store (const dtn::data::Bundle &bundle)=0
virtual dtn::data::Bundle get (const dtn::data::BundleID &id)=0
virtual const dtn::data::MetaBundle getByDestination (const dtn::data::EID &eid, bool exact=false)=0
virtual const dtn::data::MetaBundle getByFilter (const ibrcommon::BloomFilter &filter)=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)=0
virtual void clear ()
virtual bool empty ()
virtual unsigned int count ()
virtual void releaseCustody (dtn::data::BundleID &bundle)=0
void acceptCustody (dtn::data::Bundle &bundle)
void rejectCustody (const dtn::data::Bundle &bundle)

Protected Member Functions

 BundleStorage ()

Protected Attributes

std::set< dtn::data::EID_destination_filter

Detailed Description

Definition at line 24 of file BundleStorage.h.


Constructor & Destructor Documentation

dtn::core::BundleStorage::~BundleStorage (  )  [pure virtual]

destructor

Definition at line 23 of file BundleStorage.cpp.

dtn::core::BundleStorage::BundleStorage (  )  [protected]

constructor

Definition at line 18 of file BundleStorage.cpp.

References _destination_filter, and dtn::core::BundleCore::local.


Member Function Documentation

void dtn::core::BundleStorage::acceptCustody ( dtn::data::Bundle bundle  ) 

Accept custody for a given bundle. The bundle is modified by this method and contains us as future custodian. The previous custodian gets notified with a custody accept message.

Parameters:
bundle 

Definition at line 37 of file BundleStorage.cpp.

References dtn::data::PrimaryBlock::_custodian, dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_procflags, dtn::data::PrimaryBlock::_source, dtn::data::CustodySignalBlock::_status, dtn::core::CUSTODY_ACCEPT, dtn::data::PrimaryBlock::CUSTODY_REQUESTED, dtn::core::BundleCore::local, dtn::data::Bundle::push_back(), dtn::core::CustodyEvent::raise(), dtn::core::BundleGeneratedEvent::raise(), and dtn::data::CustodySignalBlock::setMatch().

Here is the call graph for this function:

void dtn::core::BundleStorage::addToFilter ( const dtn::data::EID eid  ) 

Add a EID to the destination filter of the storage. This prevents search methods like getByFilter to return a bundle with an destination EID added to the filter.

Parameters:
eid 

Definition at line 27 of file BundleStorage.cpp.

References _destination_filter.

Referenced by dtn::routing::EpidemicRoutingExtension::EpidemicRoutingExtension().

virtual void dtn::core::BundleStorage::clear (  )  [inline, virtual]

Clears all bundles and fragments in the storage.

Definition at line 108 of file BundleStorage.h.

virtual unsigned int dtn::core::BundleStorage::count (  )  [inline, virtual]
Returns:
the count of bundles in the storage

Definition at line 118 of file BundleStorage.h.

virtual bool dtn::core::BundleStorage::empty (  )  [inline, virtual]
Returns:
True, if no bundles in the storage.

Definition at line 113 of file BundleStorage.h.

virtual dtn::data::Bundle dtn::core::BundleStorage::get ( const dtn::data::BundleID id  )  [pure virtual]

This method returns a specific bundle which is identified by its id.

Parameters:
id The ID of the bundle to return.
Returns:
A bundle object.

Referenced by dtn::routing::BaseRouter::getBundle(), dtn::net::UDPConvergenceLayer::queue(), dtn::net::LOWPANConvergenceLayer::queue(), dtn::net::HTTPConvergenceLayer::queue(), dtn::core::BundleCore::raiseEvent(), and dtn::routing::EpidemicRoutingExtension::run().

virtual const dtn::data::MetaBundle dtn::core::BundleStorage::getByDestination ( const dtn::data::EID eid,
bool  exact = false 
) [pure virtual]

Query for a bundle with a specific destination. Set exact to true, if the application part should be compared too.

Parameters:
eid 
exact 
Returns:

Referenced by dtn::routing::EpidemicRoutingExtension::run().

virtual const dtn::data::MetaBundle dtn::core::BundleStorage::getByFilter ( const ibrcommon::BloomFilter filter  )  [pure virtual]

Returns a bundle ID which is not in the bloomfilter, but in the storage

Parameters:
filter 
Returns:

Referenced by dtn::routing::FloodRoutingExtension::run(), and dtn::routing::EpidemicRoutingExtension::run().

void dtn::core::BundleStorage::rejectCustody ( const dtn::data::Bundle bundle  ) 
virtual void dtn::core::BundleStorage::releaseCustody ( dtn::data::BundleID bundle  )  [pure virtual]

This method is called if another node accepts custody for a bundle of us.

Parameters:
bundle 

Referenced by dtn::core::BundleCore::raiseEvent().

virtual dtn::data::MetaBundle dtn::core::BundleStorage::remove ( const ibrcommon::BloomFilter filter  )  [pure virtual]

Remove one bundles which match this filter

Parameters:
filter 
Returns:
The bundle meta data of the removed bundle.
void dtn::core::BundleStorage::remove ( const dtn::data::Bundle b  ) 

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

Parameters:
b The bundle to remove.

Definition at line 32 of file BundleStorage.cpp.

virtual void dtn::core::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:
id The ID of the bundle to remove.

Referenced by dtn::routing::StaticRoutingExtension::notify(), dtn::routing::FloodRoutingExtension::notify(), dtn::routing::EpidemicRoutingExtension::notify(), dtn::core::BundleCore::raiseEvent(), and dtn::routing::EpidemicRoutingExtension::run().

virtual void dtn::core::BundleStorage::store ( const dtn::data::Bundle bundle  )  [pure virtual]

Stores a bundle in the storage.

Parameters:
bundle The bundle to store.

Referenced by dtn::routing::BaseRouter::raiseEvent().


Member Data Documentation

the destination query filter stores EID which are not returned by search methods like getByFilter()

Definition at line 152 of file BundleStorage.h.

Referenced by addToFilter(), BundleStorage(), and dtn::core::SimpleBundleStorage::getByFilter().


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