#include <SimpleBundleStorage.h>
Inherits dtn::core::BundleStorage, dtn::core::EventReceiver, dtn::daemon::IndependentComponent, and dtn::data::BundleList.

Classes | |
| class | BundleContainer |
| class | Task |
| class | TaskExpireBundles |
| class | TaskRemoveBundle |
| class | TaskStoreBundle |
Public Member Functions | |
| SimpleBundleStorage (size_t maxsize=0) | |
| SimpleBundleStorage (const ibrcommon::File &workdir, size_t maxsize=0) | |
| virtual | ~SimpleBundleStorage () |
| virtual void | store (const dtn::data::Bundle &bundle) |
| virtual dtn::data::Bundle | get (const dtn::data::BundleID &id) |
| virtual const dtn::data::MetaBundle | getByDestination (const dtn::data::EID &eid, bool exact=false) |
| virtual const dtn::data::MetaBundle | getByFilter (const ibrcommon::BloomFilter &filter) |
| const std::list < dtn::data::BundleID > | getList () |
| 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 (dtn::data::BundleID &bundle) |
| void | raiseEvent (const Event *evt) |
| virtual const std::string | getName () const |
| void | invokeExpiration (const size_t timestamp) |
Protected Member Functions | |
| virtual void | componentUp () |
| virtual void | componentRun () |
| virtual void | componentDown () |
| bool | __cancellation () |
| virtual void | eventBundleExpired (const ExpiringBundle &b) |
This storage holds all bundles and fragments in the system memory.
Definition at line 30 of file SimpleBundleStorage.h.
| dtn::core::SimpleBundleStorage::SimpleBundleStorage | ( | size_t | maxsize = 0 |
) |
Constructor
Definition at line 21 of file SimpleBundleStorage.cpp.
| dtn::core::SimpleBundleStorage::SimpleBundleStorage | ( | const ibrcommon::File & | workdir, | |
| size_t | maxsize = 0 | |||
| ) |
Constructor
Definition at line 26 of file SimpleBundleStorage.cpp.
References ibrcommon::File::getFiles(), ibrcommon::File::getPath(), IBRCOMMON_LOGGER, ibrcommon::File::isDirectory(), ibrcommon::File::isSystem(), and ibrcommon::File::remove().

| dtn::core::SimpleBundleStorage::~SimpleBundleStorage | ( | ) | [virtual] |
Destructor
Definition at line 61 of file SimpleBundleStorage.cpp.
References ibrcommon::Queue< T >::abort(), and ibrcommon::JoinableThread::join().

| bool dtn::core::SimpleBundleStorage::__cancellation | ( | ) | [protected] |
Definition at line 100 of file SimpleBundleStorage.cpp.
References ibrcommon::Queue< T >::abort().

| void dtn::core::SimpleBundleStorage::clear | ( | ) | [virtual] |
Reimplemented from dtn::data::BundleList.
Definition at line 343 of file SimpleBundleStorage.cpp.
| void dtn::core::SimpleBundleStorage::componentDown | ( | ) | [protected, virtual] |
Definition at line 72 of file SimpleBundleStorage.cpp.
References ibrcommon::Queue< T >::abort(), dtn::core::TimeEvent::className, and dtn::core::EventReceiver::unbindEvent().

| void dtn::core::SimpleBundleStorage::componentRun | ( | ) | [protected, virtual] |
Definition at line 79 of file SimpleBundleStorage.cpp.
References ibrcommon::Queue< T >::getnpop(), IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_DEBUG, and ibrcommon::Thread::yield().

| void dtn::core::SimpleBundleStorage::componentUp | ( | ) | [protected, virtual] |
Definition at line 67 of file SimpleBundleStorage.cpp.
References dtn::core::EventReceiver::bindEvent(), and dtn::core::TimeEvent::className.

| unsigned int dtn::core::SimpleBundleStorage::count | ( | ) |
Definition at line 134 of file SimpleBundleStorage.cpp.
| bool dtn::core::SimpleBundleStorage::empty | ( | ) |
Definition at line 122 of file SimpleBundleStorage.cpp.
| void dtn::core::SimpleBundleStorage::eventBundleExpired | ( | const ExpiringBundle & | b | ) | [protected, virtual] |
Reimplemented from dtn::data::BundleList.
Definition at line 363 of file SimpleBundleStorage.cpp.
References dtn::data::BundleList::ExpiringBundle::bundle, dtn::core::BUNDLE_DELETED, dtn::data::StatusReportBlock::LIFETIME_EXPIRED, dtn::core::BundleExpiredEvent::raise(), and dtn::core::BundleEvent::raise().

| dtn::data::Bundle dtn::core::SimpleBundleStorage::get | ( | const dtn::data::BundleID & | id | ) | [virtual] |
This method returns a specific bundle which is identified by its id.
| id | The ID of the bundle to return. |
Definition at line 199 of file SimpleBundleStorage.cpp.
Referenced by dtn::routing::NeighborRoutingExtension::NeighborRoutingExtension(), and dtn::routing::StaticRoutingExtension::StaticRoutingExtension().
| const dtn::data::MetaBundle dtn::core::SimpleBundleStorage::getByDestination | ( | const dtn::data::EID & | eid, | |
| bool | exact = false | |||
| ) | [virtual] |
Query for a bundle with a specific destination. Set exact to true, if the application part should be compared too.
| eid | ||
| exact |
Definition at line 167 of file SimpleBundleStorage.cpp.
References dtn::data::EID::getNodeEID(), dtn::data::EID::getString(), IBRCOMMON_LOGGER_DEBUG, and ibrcommon::Exception::what().

| const dtn::data::MetaBundle dtn::core::SimpleBundleStorage::getByFilter | ( | const ibrcommon::BloomFilter & | filter | ) | [virtual] |
Returns a bundle ID which is not in the bloomfilter, but in the storage
| filter |
Definition at line 140 of file SimpleBundleStorage.cpp.
References dtn::core::BundleStorage::_destination_filter, ibrcommon::BloomFilter::contains(), IBRCOMMON_LOGGER_DEBUG, and ibrcommon::Exception::what().

| const std::list< dtn::data::BundleID > dtn::core::SimpleBundleStorage::getList | ( | ) |
Returns all bundles in the storage as a list of IDs
Definition at line 387 of file SimpleBundleStorage.cpp.
Referenced by dtn::routing::NeighborRoutingExtension::NeighborRoutingExtension(), and dtn::routing::StaticRoutingExtension::StaticRoutingExtension().
| const std::string dtn::core::SimpleBundleStorage::getName | ( | ) | const [virtual] |
Definition at line 117 of file SimpleBundleStorage.cpp.
| void dtn::core::SimpleBundleStorage::invokeExpiration | ( | const size_t | timestamp | ) |
Invoke the expiration process
| timestamp |
Definition at line 218 of file SimpleBundleStorage.cpp.
References dtn::data::BundleList::expire().

| void dtn::core::SimpleBundleStorage::raiseEvent | ( | const Event * | evt | ) |
This method is used to receive events.
| evt |
Definition at line 106 of file SimpleBundleStorage.cpp.
References dtn::core::TimeEvent::getAction(), dtn::core::TimeEvent::getTimestamp(), and ibrcommon::Queue< T >::push().

| void dtn::core::SimpleBundleStorage::releaseCustody | ( | dtn::data::BundleID & | bundle | ) |
Definition at line 128 of file SimpleBundleStorage.cpp.
| dtn::data::MetaBundle dtn::core::SimpleBundleStorage::remove | ( | const ibrcommon::BloomFilter & | filter | ) |
Remove one bundles which match this filter
| filter |
Definition at line 306 of file SimpleBundleStorage.cpp.
References ibrcommon::BloomFilter::contains(), ibrcommon::Queue< T >::push(), and remove().

| void dtn::core::SimpleBundleStorage::remove | ( | const dtn::data::BundleID & | id | ) |
This method deletes a specific bundle in the storage. No reports will be generated here.
| id | The ID of the bundle to remove. |
Definition at line 276 of file SimpleBundleStorage.cpp.
References ibrcommon::Queue< T >::push().
Referenced by remove().

| size_t dtn::core::SimpleBundleStorage::size | ( | ) | const |
Get the current size
Definition at line 338 of file SimpleBundleStorage.cpp.
| void dtn::core::SimpleBundleStorage::store | ( | const dtn::data::Bundle & | bundle | ) | [virtual] |
Stores a bundle in the storage.
| bundle | The bundle to store. |
Definition at line 238 of file SimpleBundleStorage.cpp.
References dtn::data::BundleList::add(), IBRCOMMON_LOGGER_DEBUG, ibrcommon::Queue< T >::push(), ibrcommon::File::size(), and dtn::data::Bundle::toString().

1.7.1