IBR-DTNSuite  0.10
dtn::storage::BundleStorage Class Referenceabstract

#include <BundleStorage.h>

Inheritance diagram for dtn::storage::BundleStorage:
Inheritance graph
Collaboration diagram for dtn::storage::BundleStorage:
Collaboration graph

Classes

class  BundleLoadException
 
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 void get (const BundleSelector &cb, BundleResult &result)=0 throw (NoBundleFoundException, BundleSelectorException)
 
virtual const eid_set 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 dtn::data::Size count ()
 
dtn::data::Length size () const
 
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)
 
void attach (dtn::storage::BundleIndex *index)
 
void detach (dtn::storage::BundleIndex *index)
 
virtual void wait ()
 
virtual void setFaulty (bool mode)
 
- Public Member Functions inherited from dtn::storage::BundleSeeker
virtual ~BundleSeeker ()
 

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::EIDeid_set
 

Detailed Description

Definition at line 43 of file BundleStorage.h.

Constructor & Destructor Documentation

dtn::storage::BundleStorage::~BundleStorage ( )
pure virtual

destructor

Definition at line 40 of file BundleStorage.cpp.

dtn::storage::BundleStorage::BundleStorage ( const dtn::data::Length maxsize)
protected

constructor

Definition at line 35 of file BundleStorage.cpp.

Member Function Documentation

void dtn::storage::BundleStorage::allocSpace ( const dtn::data::Length size) throw (StorageSizeExeededException)
protected
void dtn::storage::BundleStorage::attach ( dtn::storage::BundleIndex index)

attach an index to this storage

Definition at line 221 of file BundleStorage.cpp.

virtual void dtn::storage::BundleStorage::clear ( )
inlinevirtual

Clears all bundles and fragments in the storage.

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

Definition at line 114 of file BundleStorage.h.

Referenced by dtn::daemon::NativeDaemon::clearStorage().

void dtn::storage::BundleStorage::clearSpace ( ) throw ()
protected

Definition at line 195 of file BundleStorage.cpp.

Referenced by dtn::storage::MemoryBundleStorage::clear().

virtual dtn::data::Size dtn::storage::BundleStorage::count ( )
inlinevirtual
Returns
the count of bundles in the storage

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

Definition at line 124 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 227 of file BundleStorage.cpp.

virtual bool dtn::storage::BundleStorage::empty ( )
inlinevirtual
Returns
True, if no bundles in the storage.

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

Definition at line 119 of file BundleStorage.h.

void dtn::storage::BundleStorage::eventBundleRemoved ( const dtn::data::BundleID id) throw ()
protected
virtual void dtn::storage::BundleStorage::get ( const BundleSelector cb,
BundleResult result 
) throw (NoBundleFoundException, BundleSelectorException)
pure virtual
See Also
BundleSeeker::get(BundleSelector &cb, BundleResult &result)

Implements dtn::storage::BundleSeeker.

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

virtual const eid_set dtn::storage::BundleStorage::getDistinctDestinations ( )
pure virtual
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.

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

Parameters
bThe bundle to remove.

Definition at line 44 of file BundleStorage.cpp.

dtn::data::MetaBundle dtn::storage::BundleStorage::remove ( const ibrcommon::BloomFilter filter)
virtual

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 49 of file BundleStorage.cpp.

References dtn::data::BundleID::toString().

Here is the call graph for this function:

virtual void dtn::storage::BundleStorage::setFaulty ( bool  mode)
inlinevirtual

Set the storage to faulty. If set to true, each try to store or retrieve a bundle will fail.

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

Definition at line 174 of file BundleStorage.h.

References _faulty.

dtn::data::Length dtn::storage::BundleStorage::size ( ) const

Get the current size

Definition at line 162 of file BundleStorage.cpp.

Referenced by dtn::daemon::NativeDaemon::getStats(), and dtn::storage::MemoryBundleStorage::store().

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::api::ExtendedApiHandler::run().

virtual void dtn::storage::BundleStorage::wait ( )
inlinevirtual

Wait until all the data has been stored and is not cached anymore

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

Definition at line 168 of file BundleStorage.h.

Member Data Documentation


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