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

#include <SimpleBundleStorage.h>

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

List of all members.

Classes

class  BundleContainer
struct  CMP_BUNDLE_PRIORITY

Public Member Functions

 SimpleBundleStorage (const ibrcommon::File &workdir, size_t maxsize=0, size_t buffer_limit=0)
virtual ~SimpleBundleStorage ()
virtual void store (const dtn::data::Bundle &bundle)
virtual dtn::data::Bundle get (const dtn::data::BundleID &id)
virtual const std::list
< dtn::data::MetaBundle
get (BundleFilterCallback &cb)
virtual const std::set
< dtn::data::EID
getDistinctDestinations ()
void remove (const dtn::data::BundleID &id)
dtn::data::MetaBundle remove (const ibrcommon::BloomFilter &filter)
void clear ()
bool empty ()
unsigned int count ()
size_t size () const
void releaseCustody (const dtn::data::EID &custodian, const dtn::data::BundleID &id)
void raiseEvent (const dtn::core::Event *evt)
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)

Protected Member Functions

virtual void componentUp ()
virtual void componentDown ()
virtual void eventBundleExpired (const ExpiringBundle &b)

Detailed Description

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

Definition at line 33 of file SimpleBundleStorage.h.


Constructor & Destructor Documentation

dtn::storage::SimpleBundleStorage::SimpleBundleStorage ( const ibrcommon::File workdir,
size_t  maxsize = 0,
size_t  buffer_limit = 0 
)

Constructor

Definition at line 23 of file SimpleBundleStorage.cpp.

References dtn::data::BundleList::_bundles, IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, and dtn::storage::DataStorage::iterateAll().

Here is the call graph for this function:

Destructor

Definition at line 33 of file SimpleBundleStorage.cpp.


Member Function Documentation

void dtn::storage::SimpleBundleStorage::componentUp ( ) [protected, virtual]

Implements dtn::daemon::IntegratedComponent.

Definition at line 162 of file SimpleBundleStorage.cpp.

References dtn::core::EventReceiver::bindEvent(), dtn::core::TimeEvent::className, and ibrcommon::JoinableThread::start().

Here is the call graph for this function:

unsigned int dtn::storage::SimpleBundleStorage::count ( ) [virtual]
See also:
BundleStorage::count()

Reimplemented from dtn::storage::BundleStorage.

Definition at line 204 of file SimpleBundleStorage.cpp.

References ibrcommon::RWMutex::LOCK_READONLY, and size().

Here is the call graph for this function:

Implements dtn::storage::DataStorage::Callback.

Definition at line 84 of file SimpleBundleStorage.cpp.

References IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, and ibrcommon::Exception::what().

Here is the call graph for this function:

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

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

Implements dtn::storage::BundleStorage.

Definition at line 231 of file SimpleBundleStorage.cpp.

References IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, ibrcommon::RWMutex::LOCK_READONLY, and ibrcommon::Exception::what().

Here is the call graph for this function:

const std::string dtn::storage::SimpleBundleStorage::getName ( ) const [virtual]
See also:
Component::getName()

Implements dtn::daemon::Component.

Definition at line 187 of file SimpleBundleStorage.cpp.

This method is used to receive events.

Parameters:
evt

Implements dtn::core::EventReceiver.

Definition at line 175 of file SimpleBundleStorage.cpp.

References dtn::data::BundleList::expire(), 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]

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 319 of file SimpleBundleStorage.cpp.

References ibrcommon::RWMutex::LOCK_READWRITE, dtn::storage::DataStorage::remove(), and dtn::data::BundleID::toString().

Referenced by remove().

Here is the call graph for this function:

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 346 of file SimpleBundleStorage.cpp.

References ibrcommon::BloomFilter::contains(), ibrcommon::RWMutex::LOCK_READWRITE, remove(), dtn::storage::DataStorage::remove(), and dtn::data::BundleID::toString().

Here is the call graph for this function:

Get the current size

Definition at line 373 of file SimpleBundleStorage.cpp.

Referenced by count().

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 264 of file SimpleBundleStorage.cpp.

References dtn::data::PrimaryBlock::_custodian, dtn::storage::BundleStorage::acceptCustody(), dtn::data::BundleList::add(), dtn::data::DefaultSerializer::getLength(), ibrcommon::RWMutex::LOCK_READWRITE, and dtn::storage::DataStorage::store().

Here is the call graph for this function:


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