IBR-DTNSuite  0.10
dtn::storage::SQLiteBundleStorage Class Reference

#include <SQLiteBundleStorage.h>

Inheritance diagram for dtn::storage::SQLiteBundleStorage:
Inheritance graph
Collaboration diagram for dtn::storage::SQLiteBundleStorage:
Collaboration graph

Public Member Functions

ibrcommon::BLOB::Reference create ()
 
 SQLiteBundleStorage (const ibrcommon::File &path, const dtn::data::Length &maxsize)
 
virtual ~SQLiteBundleStorage ()
 
void store (const dtn::data::Bundle &bundle)
 
dtn::data::Bundle get (const dtn::data::BundleID &id)
 
virtual void get (const BundleSelector &cb, BundleResult &result) throw (NoBundleFoundException, BundleSelectorException)
 
virtual const eid_set getDistinctDestinations ()
 
void remove (const dtn::data::BundleID &id)
 
void clear ()
 
void clearAll ()
 
bool empty ()
 
dtn::data::Size count ()
 
void releaseCustody (const dtn::data::EID &custodian, const dtn::data::BundleID &id)
 
void raiseEvent (const dtn::core::Event *evt) throw ()
 
void eventBundleExpired (const dtn::data::BundleID &id) throw ()
 
void iterateDatabase (const dtn::data::MetaBundle &bundle)
 
virtual void wait ()
 
virtual void setFaulty (bool mode)
 
- Public Member Functions inherited from dtn::storage::BundleStorage
virtual ~BundleStorage ()=0
 
void remove (const dtn::data::Bundle &b)
 
virtual dtn::data::MetaBundle remove (const ibrcommon::BloomFilter &filter)
 
dtn::data::Length size () const
 
const dtn::data::EID acceptCustody (const dtn::data::MetaBundle &meta)
 
void rejectCustody (const dtn::data::MetaBundle &meta, dtn::data::CustodySignalBlock::REASON_CODE reason=dtn::data::CustodySignalBlock::NO_ADDITIONAL_INFORMATION)
 
void attach (dtn::storage::BundleIndex *index)
 
void detach (dtn::storage::BundleIndex *index)
 
- Public Member Functions inherited from dtn::storage::BundleSeeker
virtual ~BundleSeeker ()
 
- Public Member Functions inherited from dtn::core::EventReceiver
virtual ~EventReceiver ()=0
 
- Public Member Functions inherited from dtn::daemon::IndependentComponent
 IndependentComponent ()
 
virtual ~IndependentComponent ()
 
virtual void initialize () throw ()
 
virtual void startup () throw ()
 
virtual void terminate () throw ()
 
- Public Member Functions inherited from dtn::daemon::Component
virtual ~Component ()=0
 
- Public Member Functions inherited from ibrcommon::BLOB::Provider
virtual ~Provider ()=0
 
- Public Member Functions inherited from dtn::storage::SQLiteDatabase::DatabaseListener
virtual ~DatabaseListener ()=0
 

Protected Member Functions

virtual void componentRun () throw ()
 
virtual void componentUp () throw ()
 
virtual void componentDown () throw ()
 
void __cancellation () throw ()
 
- Protected Member Functions inherited from dtn::storage::BundleStorage
 BundleStorage (const dtn::data::Length &maxsize)
 
void allocSpace (const dtn::data::Length &size) throw (StorageSizeExeededException)
 
void freeSpace (const dtn::data::Length &size) throw ()
 
void clearSpace () throw ()
 
void eventBundleAdded (const dtn::data::MetaBundle &b) throw ()
 
void eventBundleRemoved (const dtn::data::BundleID &id) throw ()
 
- Protected Member Functions inherited from dtn::daemon::IndependentComponent
void run () throw ()
 
- Protected Member Functions inherited from ibrcommon::JoinableThread
virtual ~JoinableThread ()=0
 
void join (void) throw (ThreadException)
 
bool isRunning (void)
 
void start (int priority=0) throw (ThreadException)
 
void stop () throw ()
 
 JoinableThread (size_t size=DEFAULT_STACKSIZE)
 

Additional Inherited Members

- Public Types inherited from dtn::storage::BundleSeeker
typedef std::set< dtn::data::EIDeid_set
 
- Protected Attributes inherited from dtn::storage::BundleStorage
bool _faulty
 

Detailed Description

Definition at line 49 of file SQLiteBundleStorage.h.

Constructor & Destructor Documentation

dtn::storage::SQLiteBundleStorage::SQLiteBundleStorage ( const ibrcommon::File path,
const dtn::data::Length maxsize 
)

Constructor

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

Definition at line 115 of file SQLiteBundleStorage.cpp.

References ibrcommon::BLOB::changeProvider(), and ibrcommon::File::get().

Here is the call graph for this function:

dtn::storage::SQLiteBundleStorage::~SQLiteBundleStorage ( )
virtual

destructor

Definition at line 126 of file SQLiteBundleStorage.cpp.

Member Function Documentation

void dtn::storage::SQLiteBundleStorage::__cancellation ( ) throw ()
protectedvirtual

This method is called after componentDown() and should should guarantee that blocking calls in componentRun() will unblock.

Implements dtn::daemon::IndependentComponent.

Definition at line 215 of file SQLiteBundleStorage.cpp.

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

Here is the call graph for this function:

void dtn::storage::SQLiteBundleStorage::clear ( )
virtual

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

Reimplemented from dtn::storage::BundleStorage.

Definition at line 473 of file SQLiteBundleStorage.cpp.

References dtn::storage::SQLiteDatabase::clear(), ibrcommon::File::createDirectory(), ibrcommon::LogLevel::critical, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::RWMutex::LOCK_READWRITE, ibrcommon::File::remove(), and ibrcommon::Exception::what().

Referenced by clearAll().

Here is the call graph for this function:

void dtn::storage::SQLiteBundleStorage::clearAll ( )

Clears the hole database.

Definition at line 468 of file SQLiteBundleStorage.cpp.

References clear().

Here is the call graph for this function:

void dtn::storage::SQLiteBundleStorage::componentDown ( ) throw ()
protectedvirtual
void dtn::storage::SQLiteBundleStorage::componentRun ( ) throw ()
protectedvirtual

This is the run method. The component should loop in there until componentDown() or __cancellation() is called.

Implements dtn::daemon::IndependentComponent.

Definition at line 130 of file SQLiteBundleStorage.cpp.

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

Here is the call graph for this function:

void dtn::storage::SQLiteBundleStorage::componentUp ( ) throw ()
protectedvirtual
dtn::data::Size dtn::storage::SQLiteBundleStorage::count ( )
virtual
Returns
the count of bundles in the storage

Reimplemented from dtn::storage::BundleStorage.

Definition at line 499 of file SQLiteBundleStorage.cpp.

References dtn::storage::SQLiteDatabase::count(), ibrcommon::LogLevel::critical, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::RWMutex::LOCK_READONLY, and ibrcommon::Exception::what().

Here is the call graph for this function:

ibrcommon::BLOB::Reference dtn::storage::SQLiteBundleStorage::create ( )
virtual

create a new BLOB object within this storage

Returns

Implements ibrcommon::BLOB::Provider.

Definition at line 110 of file SQLiteBundleStorage.cpp.

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

Reimplemented from dtn::storage::BundleStorage.

Definition at line 488 of file SQLiteBundleStorage.cpp.

References ibrcommon::LogLevel::critical, dtn::storage::SQLiteDatabase::empty(), IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::RWMutex::LOCK_READONLY, and ibrcommon::Exception::what().

Here is the call graph for this function:

void dtn::storage::SQLiteBundleStorage::eventBundleExpired ( const dtn::data::BundleID id) throw ()
virtual

callbacks for the sqlite database

Implements dtn::storage::SQLiteDatabase::DatabaseListener.

Definition at line 606 of file SQLiteBundleStorage.cpp.

void dtn::storage::SQLiteBundleStorage::get ( const BundleSelector cb,
BundleResult result 
) throw (NoBundleFoundException, BundleSelectorException)
virtual
See Also
BundleSeeker::get(BundleSelector &cb, BundleResult &result)

Implements dtn::storage::BundleStorage.

Definition at line 231 of file SQLiteBundleStorage.cpp.

References ibrcommon::RWMutex::LOCK_READONLY.

void dtn::storage::SQLiteBundleStorage::iterateDatabase ( const dtn::data::MetaBundle bundle)
virtual

Implements dtn::storage::SQLiteDatabase::DatabaseListener.

Definition at line 600 of file SQLiteBundleStorage.cpp.

References dtn::storage::BundleStorage::eventBundleAdded().

Here is the call graph for this function:

void dtn::storage::SQLiteBundleStorage::raiseEvent ( const dtn::core::Event evt) throw ()
virtual
void dtn::storage::SQLiteBundleStorage::releaseCustody ( const dtn::data::EID custodian,
const dtn::data::BundleID id 
)
virtual
void dtn::storage::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::storage::BundleStorage.

Definition at line 445 of file SQLiteBundleStorage.cpp.

References ibrcommon::LogLevel::critical, dtn::storage::BundleStorage::eventBundleRemoved(), IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::RWMutex::LOCK_READWRITE, dtn::storage::SQLiteDatabase::remove(), and ibrcommon::Exception::what().

Here is the call graph for this function:

void dtn::storage::SQLiteBundleStorage::setFaulty ( bool  mode)
virtual

Set the storage to faulty. If set to true, each try to store or retrieve a bundle will fail.

Reimplemented from dtn::storage::BundleStorage.

Definition at line 617 of file SQLiteBundleStorage.cpp.

References dtn::storage::BundleStorage::_faulty, and dtn::storage::SQLiteDatabase::setFaulty().

Here is the call graph for this function:

void dtn::storage::SQLiteBundleStorage::wait ( )
virtual

Wait until all the data has been stored to the disk

Reimplemented from dtn::storage::BundleStorage.

Definition at line 612 of file SQLiteBundleStorage.cpp.

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

Here is the call graph for this function:


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