dtn::BundleStore Class Reference

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

#include <BundleStore.h>

Inheritance diagram for dtn::BundleStore:
dtn::SQLBundleStore

List of all members.

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

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.


Member Typedef Documentation

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

Definition at line 41 of file BundleStore.h.

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

Helper class typedefs.

Definition at line 39 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 30 of file BundleStore.cc.

Referenced by init().


Member Function Documentation

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

Add a new bundle.

Definition at line 54 of file BundleStore.cc.

References bundles_, dtn::Bundle::durable_size(), and total_size_.

void dtn::BundleStore::close (  ) 

Close down the table.

Definition at line 98 of file BundleStore.cc.

References bundles_.

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

Delete the bundle.

Definition at line 79 of file BundleStore.cc.

References ASSERT, dtn::Bundle::bundleid(), bundles_, dtn::Bundle::durable_size(), and total_size_.

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

Retrieve a bundle.

Definition at line 65 of file BundleStore.cc.

References bundles_.

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 42 of file BundleStore.cc.

References BundleStore().

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

Return a new iterator.

Definition at line 91 of file BundleStore.cc.

References bundles_.

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().

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

Accessors.

Definition at line 76 of file BundleStore.h.

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

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

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

Accessors.

Definition at line 78 of file BundleStore.h.

References total_size_.

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

Update the metabundle for the bundle.

Reimplemented in dtn::SQLBundleStore.

Definition at line 72 of file BundleStore.cc.

References bundles_.


Friends And Related Function Documentation

friend class BundleDaemon [friend]

Definition at line 82 of file BundleStore.h.


Member Data Documentation

Bundle metabundle table.

Definition at line 89 of file BundleStore.h.

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

Storage configuration.

Definition at line 88 of file BundleStore.h.

Referenced by payload_dir(), and payload_quota().

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 Sun Nov 21 13:21:26 2010 for DTN Reference Implementation by  doxygen 1.6.3