Classes | Public Member Functions | Protected Member Functions | Friends

dtn::core::SQLiteBundleStorage Class Reference

#include <SQLiteBundleStorage.h>

Inherits dtn::core::BundleStorage, dtn::core::EventReceiver, dtn::daemon::IndependentComponent, and ibrcommon::MutexInterface.

Collaboration diagram for dtn::core::SQLiteBundleStorage:
Collaboration graph
[legend]

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)
dtn::data::MetaBundle remove (const ibrcommon::BloomFilter &)
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:
Pfad zum Ordner in denen die Datein gespeichert werden.
Dateiname der Datenbank
maximale Größe der Datenbank

Definition at line 146 of file SQLiteBundleStorage.cpp.

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

Here is the call graph for this function:

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

destructor

Definition at line 160 of file SQLiteBundleStorage.cpp.

References IBRCOMMON_LOGGER, ibrcommon::JoinableThread::join(), dtn::core::SQLiteConfigure::shutdown(), and ibrcommon::JoinableThread::stop().

Here is the call graph for this function:


Member Function Documentation

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

Definition at line 291 of file SQLiteBundleStorage.cpp.

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

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::clear (  ) 

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

Definition at line 992 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 980 of file SQLiteBundleStorage.cpp.

References clear().

Here is the call graph for this function:

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

Definition at line 284 of file SQLiteBundleStorage.cpp.

References dtn::core::GlobalEvent::className, dtn::core::TimeEvent::className, and dtn::core::EventReceiver::unbindEvent().

Here is the call graph for this function:

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

Definition at line 238 of file SQLiteBundleStorage.cpp.

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

Here is the call graph for this function:

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

Definition at line 268 of file SQLiteBundleStorage.cpp.

References dtn::core::EventReceiver::bindEvent(), dtn::core::GlobalEvent::className, dtn::core::TimeEvent::className, and openDatabase().

Here is the call graph for this function:

unsigned int dtn::core::SQLiteBundleStorage::count (  ) 
Returns:
the count of bundles in the storage

Definition at line 1032 of file SQLiteBundleStorage.cpp.

References IBRCOMMON_LOGGER.

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

Definition at line 1018 of file SQLiteBundleStorage.cpp.

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

Locks everything in the database.

Implements ibrcommon::MutexInterface.

Definition at line 1652 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  ) 

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

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

Definition at line 589 of file SQLiteBundleStorage.cpp.

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

Here is the call graph for this function:

const std::list< dtn::data::MetaBundle > dtn::core::SQLiteBundleStorage::get ( BundleFilterCallback &  cb  ) 
void dtn::core::SQLiteBundleStorage::leave (  )  throw (ibrcommon::MutexException) [virtual]

Unlocks everything in the database.

Implements ibrcommon::MutexInterface.

Definition at line 1662 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 184 of file SQLiteBundleStorage.cpp.

References ibrcommon::File::createDirectory(), ibrcommon::File::get(), ibrcommon::File::getPath(), IBRCOMMON_LOGGER, 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  ) 

This method is used to receive events.

Parameters:
evt 

Definition at line 1338 of file SQLiteBundleStorage.cpp.

References dtn::core::GlobalEvent::getAction(), dtn::core::TimeEvent::getAction(), dtn::core::TimeEvent::getTimestamp(), and ibrcommon::Queue< T >::push().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::releaseCustody ( const dtn::data::EID custodian,
const dtn::data::BundleID id 
)
See also:
BundleStorage::releaseCustody();

Definition at line 1599 of file SQLiteBundleStorage.cpp.

dtn::data::MetaBundle dtn::core::SQLiteBundleStorage::remove ( const ibrcommon::BloomFilter  )  [inline]

Remove all bundles which match this filter

Parameters:
filter 

Definition at line 312 of file SQLiteBundleStorage.h.

void dtn::core::SQLiteBundleStorage::remove ( const dtn::data::BundleID id  ) 

This method deletes a specific bundle in the storage. No reports will be generated here.

Parameters:
id The ID of the bundle to remove.

Definition at line 763 of file SQLiteBundleStorage.cpp.

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

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::store ( const dtn::data::Bundle bundle  ) 
void dtn::core::SQLiteBundleStorage::trylock (  )  throw (ibrcommon::MutexException) [virtual]

Try to lock everything in the database.

Implements ibrcommon::MutexInterface.

Definition at line 1646 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: