dtn::BundleStore Class Reference

#include <BundleStore.h>

Inheritance diagram for dtn::BundleStore:

dtn::SQLBundleStore List of all members.

Detailed Description

The class for bundle storage is an instantiation of an oasys durable table to store the bundle metadata, tracking logic for the storage total, and other support classes for the payloads.

Definition at line 36 of file BundleStore.h.

Public Types

typedef oasys::OpenFdCache<
std::string > 
FdCache
 Helper class typedefs.
typedef oasys::InternalKeyDurableTable<
oasys::UIntShim, u_int32_t,
Bundle
BundleTable
typedef BundleTable::iterator iterator

Public Member Functions

 BundleStore (const DTNStorageConfig &cfg)
 Constructor.
bool add (Bundle *bundle)
 Add a new bundle.
Bundleget (u_int32_t bundleid)
 Retrieve a bundle.
bool update (Bundle *bundle)
 Update the metabundle for the bundle.
bool del (Bundle *bundle)
 Delete the bundle.
iteratornew_iterator ()
 Return a new iterator.
void close ()
 Close down the table.
const std::string & payload_dir ()
 Accessors.
u_int64_t payload_quota ()
 Accessors.
FdCachepayload_fdcache ()
 Accessors.
u_int64_t total_size ()
 Accessors.

Static Public Member Functions

static int init (const DTNStorageConfig &cfg, oasys::DurableStore *store)
 Boot time initializer that takes as a parameter the storage configuration to use.

Protected Member Functions

void set_total_size (u_int64_t sz)
 When the bundle store is loaded at boot time, we need to reset the in-memory total_size_ parameter.

Protected Attributes

const DTNStorageConfigcfg_
 Storage configuration.
BundleTable bundles_
 Bundle metabundle table.
FdCache payload_fdcache_
 File descriptor cache.
u_int64_t total_size_

Friends

class BundleDaemon


Member Typedef Documentation

typedef oasys::OpenFdCache<std::string> dtn::BundleStore::FdCache

Helper class typedefs.

Definition at line 39 of file BundleStore.h.

typedef oasys::InternalKeyDurableTable< oasys::UIntShim, u_int32_t, Bundle> dtn::BundleStore::BundleTable

Definition at line 41 of file BundleStore.h.

typedef BundleTable::iterator dtn::BundleStore::iterator

Definition at line 42 of file BundleStore.h.


Constructor & Destructor Documentation

dtn::BundleStore::BundleStore ( const DTNStorageConfig cfg  ) 

Constructor.

Definition at line 27 of file BundleStore.cc.

Referenced by init().


Member Function Documentation

int dtn::BundleStore::init ( const DTNStorageConfig cfg,
oasys::DurableStore store 
) [static]

Boot time initializer that takes as a parameter the storage configuration to use.

Definition at line 39 of file BundleStore.cc.

References BundleStore().

Referenced by dtn::DTNServer::init_datastore().

bool dtn::BundleStore::add ( Bundle bundle  ) 

Add a new bundle.

Definition at line 51 of file BundleStore.cc.

References oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::add(), bundles_, dtn::Bundle::durable_size(), and total_size_.

Bundle * dtn::BundleStore::get ( u_int32_t  bundleid  ) 

Retrieve a bundle.

Definition at line 62 of file BundleStore.cc.

References bundles_, and oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::get().

Referenced by dtn::BundleDaemon::load_bundles().

bool dtn::BundleStore::update ( Bundle bundle  ) 

Update the metabundle for the bundle.

Reimplemented in dtn::SQLBundleStore.

Definition at line 69 of file BundleStore.cc.

References bundles_, and oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::update().

bool dtn::BundleStore::del ( Bundle bundle  ) 

Delete the bundle.

Definition at line 76 of file BundleStore.cc.

References ASSERT, dtn::Bundle::bundleid_, bundles_, oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::del(), dtn::Bundle::durable_size(), and total_size_.

BundleStore::iterator * dtn::BundleStore::new_iterator (  ) 

Return a new iterator.

Definition at line 88 of file BundleStore.cc.

References bundles_, and oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::new_iterator().

Referenced by dtn::BundleDaemon::load_bundles().

void dtn::BundleStore::close (  ) 

Close down the table.

Definition at line 95 of file BundleStore.cc.

References bundles_, and oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::close().

const std::string& dtn::BundleStore::payload_dir (  )  [inline]

Accessors.

Definition at line 75 of file BundleStore.h.

References cfg_, and dtn::DTNStorageConfig::payload_dir_.

Referenced by dtn::BundlePayload::init(), and dtn::BundlePayload::init_from_store().

u_int64_t dtn::BundleStore::payload_quota (  )  [inline]

Accessors.

Definition at line 76 of file BundleStore.h.

References cfg_, and dtn::DTNStorageConfig::payload_quota_.

Referenced by dtn::BundleRouter::accept_bundle().

FdCache* dtn::BundleStore::payload_fdcache (  )  [inline]

Accessors.

Definition at line 77 of file BundleStore.h.

References payload_fdcache_.

Referenced by dtn::BundlePayload::init(), dtn::BundlePayload::init_from_store(), and dtn::BundlePayload::pin_file().

u_int64_t dtn::BundleStore::total_size (  )  [inline]

Accessors.

Definition at line 78 of file BundleStore.h.

References total_size_.

Referenced by dtn::BundleRouter::accept_bundle().

void dtn::BundleStore::set_total_size ( u_int64_t  sz  )  [inline, protected]

When the bundle store is loaded at boot time, we need to reset the in-memory total_size_ parameter.

Definition at line 86 of file BundleStore.h.

References total_size_.

Referenced by dtn::BundleDaemon::load_bundles().


Friends And Related Function Documentation

friend class BundleDaemon [friend]

Definition at line 82 of file BundleStore.h.


Member Data Documentation

const DTNStorageConfig& dtn::BundleStore::cfg_ [protected]

Storage configuration.

Definition at line 88 of file BundleStore.h.

Referenced by payload_dir(), and payload_quota().

BundleTable dtn::BundleStore::bundles_ [protected]

Bundle metabundle table.

Definition at line 89 of file BundleStore.h.

Referenced by add(), close(), del(), get(), new_iterator(), and update().

FdCache dtn::BundleStore::payload_fdcache_ [protected]

File descriptor cache.

Definition at line 90 of file BundleStore.h.

Referenced by payload_fdcache().

u_int64_t dtn::BundleStore::total_size_ [protected]

Definition at line 91 of file BundleStore.h.

Referenced by add(), del(), set_total_size(), and total_size().


The documentation for this class was generated from the following files:
Generated on Thu Jun 7 12:54:34 2007 for DTN Reference Implementation by  doxygen 1.5.1