IBR-DTNSuite 0.6

dtn::core::SQLiteBundleStorage Class Reference

#include <SQLiteBundleStorage.h>

Inheritance diagram for dtn::core::SQLiteBundleStorage:
Collaboration diagram for dtn::core::SQLiteBundleStorage:

List of all members.

Classes

class  AutoResetLock
class  BlockingTask
class  SQLBundleQuery
class  SQLiteQueryException
class  Task
class  TaskExpire
class  TaskIdle
class  TaskRemove

Public Member Functions

 SQLiteBundleStorage (const ibrcommon::File &path, const size_t &size)
virtual ~SQLiteBundleStorage ()
void openDatabase (const ibrcommon::File &path)
void store (const dtn::data::Bundle &bundle)
dtn::data::Bundle get (const dtn::data::BundleID &id)
const std::list
< dtn::data::MetaBundle
get (BundleFilterCallback &cb)
void remove (const dtn::data::BundleID &id)
void clear ()
void clearAll ()
bool empty ()
unsigned int count ()
void releaseCustody (const dtn::data::EID &custodian, const dtn::data::BundleID &id)
void raiseEvent (const Event *evt)
virtual void trylock () throw (ibrcommon::MutexException)
virtual void enter () throw (ibrcommon::MutexException)
virtual void leave () throw (ibrcommon::MutexException)

Protected Member Functions

virtual void componentRun ()
virtual void componentUp ()
virtual void componentDown ()
bool __cancellation ()

Friends

class ::SQLiteBundleStorageTest

Detailed Description

Definition at line 37 of file SQLiteBundleStorage.h.


Constructor & Destructor Documentation

dtn::core::SQLiteBundleStorage::SQLiteBundleStorage ( const ibrcommon::File path,
const size_t &  size 
)

Constructor

Parameters:
Pfadzum Ordner in denen die Datein gespeichert werden.
Dateinameder Datenbank
maximaleGröße der Datenbank

Definition at line 147 of file SQLiteBundleStorage.cpp.

References dtn::core::SQLiteConfigure::configure(), IBRCOMMON_LOGGER, and IBRCOMMON_LOGGER_ENDL.

Here is the call graph for this function:

dtn::core::SQLiteBundleStorage::~SQLiteBundleStorage ( ) [virtual]

Member Function Documentation

bool dtn::core::SQLiteBundleStorage::__cancellation ( ) [protected, virtual]

Implements dtn::daemon::IndependentComponent.

Definition at line 292 of file SQLiteBundleStorage.cpp.

References ibrcommon::Queue< T >::abort().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::clear ( ) [virtual]

Clears all bundles and fragments in the storage. Routinginformation won't be deleted.

Reimplemented from dtn::core::BundleStorage.

Definition at line 1022 of file SQLiteBundleStorage.cpp.

References ibrcommon::File::createDirectory(), and ibrcommon::File::remove().

Referenced by clearAll().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::clearAll ( )

Clears the hole database.

Definition at line 1010 of file SQLiteBundleStorage.cpp.

References clear().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::componentDown ( ) [protected, virtual]
void dtn::core::SQLiteBundleStorage::componentRun ( ) [protected, virtual]

Implements dtn::daemon::IndependentComponent.

Definition at line 239 of file SQLiteBundleStorage.cpp.

References ibrcommon::Queue< T >::getnpop().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::componentUp ( ) [protected, virtual]
unsigned int dtn::core::SQLiteBundleStorage::count ( ) [virtual]
Returns:
the count of bundles in the storage

Reimplemented from dtn::core::BundleStorage.

Definition at line 1062 of file SQLiteBundleStorage.cpp.

References IBRCOMMON_LOGGER, and IBRCOMMON_LOGGER_ENDL.

bool dtn::core::SQLiteBundleStorage::empty ( ) [virtual]
Returns:
True, if no bundles in the storage.

Reimplemented from dtn::core::BundleStorage.

Definition at line 1048 of file SQLiteBundleStorage.cpp.

void dtn::core::SQLiteBundleStorage::enter ( ) throw (ibrcommon::MutexException) [virtual]

Locks everything in the database.

Implements ibrcommon::MutexInterface.

Definition at line 1685 of file SQLiteBundleStorage.cpp.

References ibrcommon::Mutex::enter().

Here is the call graph for this function:

dtn::data::Bundle dtn::core::SQLiteBundleStorage::get ( const dtn::data::BundleID id) [virtual]

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

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

Implements dtn::core::BundleStorage.

Definition at line 619 of file SQLiteBundleStorage.cpp.

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

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::leave ( ) throw (ibrcommon::MutexException) [virtual]

Unlocks everything in the database.

Implements ibrcommon::MutexInterface.

Definition at line 1695 of file SQLiteBundleStorage.cpp.

References ibrcommon::Mutex::leave().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::openDatabase ( const ibrcommon::File path)

open the database

Definition at line 185 of file SQLiteBundleStorage.cpp.

References ibrcommon::File::createDirectory(), ibrcommon::File::get(), ibrcommon::File::getPath(), IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_LEVEL, and dtn::core::sql_tracer().

Referenced by componentUp().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::raiseEvent ( const Event evt) [virtual]
void dtn::core::SQLiteBundleStorage::releaseCustody ( const dtn::data::EID custodian,
const dtn::data::BundleID id 
) [virtual]
See also:
BundleStorage::releaseCustody();

Implements dtn::core::BundleStorage.

Definition at line 1632 of file SQLiteBundleStorage.cpp.

void dtn::core::SQLiteBundleStorage::remove ( 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::core::BundleStorage.

Definition at line 793 of file SQLiteBundleStorage.cpp.

References ibrcommon::Queue< T >::push().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::trylock ( ) throw (ibrcommon::MutexException) [virtual]

Try to lock everything in the database.

Implements ibrcommon::MutexInterface.

Definition at line 1679 of file SQLiteBundleStorage.cpp.


Friends And Related Function Documentation

friend class ::SQLiteBundleStorageTest [friend]

Definition at line 110 of file SQLiteBundleStorage.h.


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