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

#include <SQLiteDatabase.h>

List of all members.

Classes

class  SQLBundleQuery
class  SQLiteQueryException
class  Statement

Public Types

enum  UPDATE_VALUES { UPDATE_CUSTODIAN }
typedef std::list< std::pair
< int, const ibrcommon::File > > 
blocklist
typedef std::pair< int, const
ibrcommon::File
blocklist_entry

Public Member Functions

 SQLiteDatabase (const ibrcommon::File &file, const size_t &size)
virtual ~SQLiteDatabase ()
void open ()
void close ()
void expire (size_t timestamp)
void vacuum ()
void update (UPDATE_VALUES, const dtn::data::BundleID &id, const dtn::data::EID &)
void remove (const dtn::data::BundleID &id)
const std::list
< dtn::data::MetaBundle
get (dtn::storage::BundleStorage::BundleFilterCallback &cb) const
void get (const dtn::data::BundleID &id, dtn::data::MetaBundle &meta) const
void get (const dtn::data::BundleID &id, dtn::data::Bundle &bundle, blocklist &blocks) const
void store (const dtn::data::Bundle &bundle)
void store (const dtn::data::BundleID &id, int index, const dtn::data::Block &block, const ibrcommon::File &file)
void transaction ()
void rollback ()
void commit ()
bool empty () const
unsigned int count () const
void clear ()
virtual const std::set
< dtn::data::EID
getDistinctDestinations ()

Detailed Description

Definition at line 25 of file SQLiteDatabase.h.


Member Typedef Documentation

typedef std::list<std::pair<int, const ibrcommon::File> > dtn::storage::SQLiteDatabase::blocklist

Definition at line 141 of file SQLiteDatabase.h.

Definition at line 142 of file SQLiteDatabase.h.


Member Enumeration Documentation

Enumerator:
UPDATE_CUSTODIAN 

Definition at line 87 of file SQLiteDatabase.h.


Constructor & Destructor Documentation

dtn::storage::SQLiteDatabase::SQLiteDatabase ( const ibrcommon::File file,
const size_t &  size 
)

Definition at line 132 of file SQLiteDatabase.cpp.

Definition at line 137 of file SQLiteDatabase.cpp.


Member Function Documentation

Definition at line 823 of file SQLiteDatabase.cpp.

References dtn::storage::SQLiteDatabase::Statement::step(), and vacuum().

Referenced by dtn::storage::SQLiteBundleStorage::clear().

Here is the call graph for this function:

close the database

Returns:

Definition at line 273 of file SQLiteDatabase.cpp.

References IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, and dtn::storage::SQLiteConfigure::shutdown().

Referenced by dtn::storage::SQLiteBundleStorage::componentDown().

Here is the call graph for this function:

unsigned int dtn::storage::SQLiteDatabase::count ( ) const

Definition at line 854 of file SQLiteDatabase.cpp.

References IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, and dtn::storage::SQLiteDatabase::Statement::step().

Referenced by dtn::storage::SQLiteBundleStorage::count().

Here is the call graph for this function:

Definition at line 840 of file SQLiteDatabase.cpp.

References dtn::storage::SQLiteDatabase::Statement::step().

Referenced by dtn::storage::SQLiteBundleStorage::empty().

Here is the call graph for this function:

void dtn::storage::SQLiteDatabase::expire ( size_t  timestamp)

Expire all bundles with a lifetime lower than the given timestamp.

Parameters:
timestamp

Definition at line 898 of file SQLiteDatabase.cpp.

References dtn::core::BundleExpiredEvent::raise(), ibrcommon::File::remove(), and dtn::storage::SQLiteDatabase::Statement::step().

Here is the call graph for this function:

Get meta data of several bundles using a callback filter.

Parameters:
cb
Returns:

Definition at line 508 of file SQLiteDatabase.cpp.

References dtn::storage::SQLiteDatabase::SQLBundleQuery::bind(), dtn::storage::SQLiteDatabase::SQLBundleQuery::getWhere(), and dtn::storage::BundleStorage::BundleFilterCallback::limit().

Referenced by dtn::storage::SQLiteBundleStorage::get().

Here is the call graph for this function:

Retrieve the meta data of a given bundle

Parameters:
id
Returns:

Definition at line 437 of file SQLiteDatabase.cpp.

References IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, and dtn::storage::SQLiteDatabase::Statement::step().

Here is the call graph for this function:

void dtn::storage::SQLiteDatabase::get ( const dtn::data::BundleID id,
dtn::data::Bundle bundle,
blocklist blocks 
) const

Retrieve the data of a given bundle

Parameters:
id
Returns:

Definition at line 597 of file SQLiteDatabase.cpp.

References IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, dtn::storage::SQLiteDatabase::Statement::step(), and ibrcommon::Exception::what().

Here is the call graph for this function:

Delete an entry in the database.

Parameters:
id

Definition at line 782 of file SQLiteDatabase.cpp.

References IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, ibrcommon::File::remove(), and dtn::storage::SQLiteDatabase::Statement::step().

Here is the call graph for this function:

void dtn::storage::SQLiteDatabase::store ( const dtn::data::BundleID id,
int  index,
const dtn::data::Block block,
const ibrcommon::File file 
)

Definition at line 735 of file SQLiteDatabase.cpp.

References ibrcommon::File::getPath(), dtn::data::Block::getType(), and dtn::storage::SQLiteDatabase::Statement::step().

Here is the call graph for this function:

Shrink down the database.

Definition at line 949 of file SQLiteDatabase.cpp.

References dtn::storage::SQLiteDatabase::Statement::step().

Referenced by clear().

Here is the call graph for this function:


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