IBR-DTNSuite  0.10
dtn::storage::SimpleBundleStorage Class Reference

#include <SimpleBundleStorage.h>

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

Public Member Functions

 SimpleBundleStorage (const ibrcommon::File &workdir, const dtn::data::Length maxsize=0, const unsigned int buffer_limit=0)
 
virtual ~SimpleBundleStorage ()
 
virtual void store (const dtn::data::Bundle &bundle)
 
virtual dtn::data::Bundle get (const dtn::data::BundleID &id)
 
virtual void get (const BundleSelector &cb, BundleResult &result) throw (NoBundleFoundException, BundleSelectorException)
 
virtual const eid_set getDistinctDestinations ()
 
void remove (const dtn::data::BundleID &id)
 
dtn::data::MetaBundle remove (const ibrcommon::BloomFilter &filter)
 
void clear ()
 
bool empty ()
 
dtn::data::Size count ()
 
void releaseCustody (const dtn::data::EID &custodian, const dtn::data::BundleID &id)
 
void raiseEvent (const dtn::core::Event *evt) throw ()
 
virtual const std::string getName () const
 
virtual void eventDataStorageStored (const dtn::storage::DataStorage::Hash &hash)
 
virtual void eventDataStorageStoreFailed (const dtn::storage::DataStorage::Hash &hash, const ibrcommon::Exception &)
 
virtual void eventDataStorageRemoved (const dtn::storage::DataStorage::Hash &hash)
 
virtual void eventDataStorageRemoveFailed (const dtn::storage::DataStorage::Hash &hash, const ibrcommon::Exception &)
 
virtual void iterateDataStorage (const dtn::storage::DataStorage::Hash &hash, dtn::storage::DataStorage::istream &stream)
 
virtual void wait ()
 
virtual void setFaulty (bool mode)
 
- Public Member Functions inherited from dtn::storage::BundleStorage
virtual ~BundleStorage ()=0
 
void remove (const dtn::data::Bundle &b)
 
dtn::data::Length size () const
 
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)
 
- Public Member Functions inherited from dtn::storage::BundleSeeker
virtual ~BundleSeeker ()
 
- Public Member Functions inherited from dtn::core::EventReceiver
virtual ~EventReceiver ()=0
 
- Public Member Functions inherited from dtn::daemon::IntegratedComponent
 IntegratedComponent ()
 
virtual ~IntegratedComponent ()
 
virtual void initialize () throw ()
 
virtual void startup () throw ()
 
virtual void terminate () throw ()
 
- Public Member Functions inherited from dtn::daemon::Component
virtual ~Component ()=0
 
- Public Member Functions inherited from dtn::data::BundleList::Listener
virtual ~Listener ()=0
 

Protected Member Functions

virtual void componentUp () throw ()
 
virtual void componentDown () throw ()
 
virtual void eventBundleExpired (const dtn::data::MetaBundle &b) throw ()
 
- Protected Member Functions inherited from dtn::storage::BundleStorage
 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 ()
 

Additional Inherited Members

- Public Types inherited from dtn::storage::BundleSeeker
typedef std::set< dtn::data::EIDeid_set
 
- Protected Attributes inherited from dtn::storage::BundleStorage
bool _faulty
 

Detailed Description

This storage holds all bundles and fragments in the system memory.

Definition at line 53 of file SimpleBundleStorage.h.

Constructor & Destructor Documentation

dtn::storage::SimpleBundleStorage::SimpleBundleStorage ( const ibrcommon::File workdir,
const dtn::data::Length  maxsize = 0,
const unsigned int  buffer_limit = 0 
)

Constructor

Definition at line 49 of file SimpleBundleStorage.cpp.

dtn::storage::SimpleBundleStorage::~SimpleBundleStorage ( )
virtual

Destructor

Definition at line 54 of file SimpleBundleStorage.cpp.

Member Function Documentation

void dtn::storage::SimpleBundleStorage::clear ( )
virtual
dtn::data::Size dtn::storage::SimpleBundleStorage::count ( )
virtual
See Also
BundleStorage::count()

Reimplemented from dtn::storage::BundleStorage.

Definition at line 235 of file SimpleBundleStorage.cpp.

References ibrcommon::RWMutex::LOCK_READONLY, and dtn::storage::MetaStorage::size().

Here is the call graph for this function:

bool dtn::storage::SimpleBundleStorage::empty ( )
virtual
See Also
BundleStorage::empty()

Reimplemented from dtn::storage::BundleStorage.

Definition at line 223 of file SimpleBundleStorage.cpp.

References dtn::storage::MetaStorage::empty(), and ibrcommon::RWMutex::LOCK_READONLY.

Here is the call graph for this function:

void dtn::storage::SimpleBundleStorage::eventBundleExpired ( const dtn::data::MetaBundle b) throw ()
protectedvirtual
void dtn::storage::SimpleBundleStorage::eventDataStorageRemoveFailed ( const dtn::storage::DataStorage::Hash hash,
const ibrcommon::Exception ex 
)
virtual
void dtn::storage::SimpleBundleStorage::eventDataStorageStored ( const dtn::storage::DataStorage::Hash hash)
virtual
dtn::data::Bundle dtn::storage::SimpleBundleStorage::get ( const dtn::data::BundleID id)
virtual
void dtn::storage::SimpleBundleStorage::get ( const BundleSelector cb,
BundleResult result 
) throw (NoBundleFoundException, BundleSelectorException)
virtual
See Also
BundleSeeker::get(BundleSelector &cb, BundleResult &result)

Implements dtn::storage::BundleStorage.

Definition at line 252 of file SimpleBundleStorage.cpp.

References dtn::utils::Clock::isExpired(), dtn::data::MetaBundle::lifetime, ibrcommon::RWMutex::LOCK_READONLY, and dtn::data::BundleID::timestamp.

Here is the call graph for this function:

const SimpleBundleStorage::eid_set dtn::storage::SimpleBundleStorage::getDistinctDestinations ( )
virtual
const std::string dtn::storage::SimpleBundleStorage::getName ( ) const
virtual
See Also
Component::getName()

Implements dtn::daemon::Component.

Definition at line 218 of file SimpleBundleStorage.cpp.

void dtn::storage::SimpleBundleStorage::raiseEvent ( const dtn::core::Event evt) throw ()
virtual

This method is used to receive events.

Parameters
evt

Implements dtn::core::EventReceiver.

Definition at line 206 of file SimpleBundleStorage.cpp.

References dtn::core::TimeEvent::getAction(), dtn::core::TimeEvent::getTimestamp(), ibrcommon::RWMutex::LOCK_READWRITE, and dtn::core::TIME_SECOND_TICK.

Here is the call graph for this function:

void dtn::storage::SimpleBundleStorage::releaseCustody ( const dtn::data::EID custodian,
const dtn::data::BundleID id 
)
virtual
void dtn::storage::SimpleBundleStorage::remove ( const dtn::data::BundleID id)
virtual

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

Parameters
idThe ID of the bundle to remove.

Implements dtn::storage::BundleStorage.

Definition at line 379 of file SimpleBundleStorage.cpp.

References dtn::storage::BundleStorage::eventBundleRemoved(), dtn::storage::MetaStorage::find(), dtn::storage::MetaStorage::isRemoved(), ibrcommon::RWMutex::LOCK_READONLY, dtn::storage::MetaStorage::markRemoved(), dtn::data::MetaBundle::mockUp(), dtn::storage::DataStorage::remove(), and dtn::data::BundleID::toString().

Here is the call graph for this function:

dtn::data::MetaBundle dtn::storage::SimpleBundleStorage::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 from dtn::storage::BundleStorage.

Definition at line 434 of file SimpleBundleStorage.cpp.

References dtn::storage::BundleStorage::eventBundleRemoved(), dtn::storage::MetaStorage::find(), dtn::storage::MetaStorage::isRemoved(), ibrcommon::RWMutex::LOCK_READONLY, dtn::storage::MetaStorage::markRemoved(), dtn::storage::DataStorage::remove(), and dtn::data::BundleID::toString().

Here is the call graph for this function:

void dtn::storage::SimpleBundleStorage::setFaulty ( bool  mode)
virtual

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

Reimplemented from dtn::storage::BundleStorage.

Definition at line 246 of file SimpleBundleStorage.cpp.

References dtn::storage::BundleStorage::_faulty, and dtn::storage::DataStorage::setFaulty().

Here is the call graph for this function:

void dtn::storage::SimpleBundleStorage::store ( const dtn::data::Bundle bundle)
virtual

Stores a bundle in the storage.

Parameters
bundleThe bundle to store.

Implements dtn::storage::BundleStorage.

Definition at line 349 of file SimpleBundleStorage.cpp.

References dtn::storage::BundleStorage::acceptCustody(), dtn::storage::BundleStorage::allocSpace(), dtn::data::PrimaryBlock::custodian, and dtn::data::DefaultSerializer::getLength().

Here is the call graph for this function:

void dtn::storage::SimpleBundleStorage::wait ( )
virtual

Wait until all the data has been stored to the disk

Reimplemented from dtn::storage::BundleStorage.

Definition at line 241 of file SimpleBundleStorage.cpp.

References dtn::storage::DataStorage::wait().

Here is the call graph for this function:


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