IBR-DTN  1.0.0
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, bool usePersistentBundleSets=false)
 
virtual ~SQLiteBundleStorage ()
 
void store (const dtn::data::Bundle &bundle)
 
bool contains (const dtn::data::BundleID &id)
 
virtual dtn::data::MetaBundle info (const dtn::data::BundleID &id)
 
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 ()
 
bool empty ()
 
dtn::data::Size count ()
 
void releaseCustody (const dtn::data::EID &custodian, const dtn::data::BundleID &id)
 
void raiseEvent (const dtn::core::TimeEvent &evt) throw ()
 
void raiseEvent (const dtn::core::GlobalEvent &evt) throw ()
 
void eventBundleExpired (const dtn::data::BundleID &id, const dtn::data::Length size) throw ()
 
void iterateDatabase (const dtn::data::MetaBundle &bundle, const dtn::data::Length size)
 
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)
 
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< dtn::core::GlobalEvent >
virtual ~EventReceiver ()
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::core::TimeEvent >
virtual ~EventReceiver ()
 
- 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 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 ()
 

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 51 of file SQLiteBundleStorage.h.

Constructor & Destructor Documentation

dtn::storage::SQLiteBundleStorage::SQLiteBundleStorage ( const ibrcommon::File &  path,
const dtn::data::Length maxsize,
bool  usePersistentBundleSets = false 
)

Constructor

Parameters
Pfadzum Ordner in denen die Datein gespeichert werden.
Dateinameder Datenbank
maximaleGröße der Datenbank
shouldbundleSets be stored persistently in database? standard: false

Definition at line 113 of file SQLiteBundleStorage.cpp.

References dtn::storage::SQLiteDatabase::open(), and dtn::data::BundleSet::setFactory().

Here is the call graph for this function:

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

destructor

Definition at line 146 of file SQLiteBundleStorage.cpp.

References dtn::storage::SQLiteDatabase::close(), and dtn::data::BundleSet::setFactory().

Here is the call graph for this function:

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 219 of file SQLiteBundleStorage.cpp.

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 501 of file SQLiteBundleStorage.cpp.

References dtn::storage::SQLiteDatabase::clear(), and dtn::storage::BundleStorage::clearSpace().

Here is the call graph for this function:

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

This method is called if the component should stop. Clean-up code should be inserted here.

Implements dtn::daemon::IndependentComponent.

Definition at line 207 of file SQLiteBundleStorage.cpp.

References dtn::core::EventDispatcher< E >::remove().

Here is the call graph for this function:

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 161 of file SQLiteBundleStorage.cpp.

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

Is called in preparation of the component. Before componentRun() is called.

Implements dtn::daemon::IndependentComponent.

Definition at line 191 of file SQLiteBundleStorage.cpp.

References dtn::core::EventDispatcher< E >::add(), and dtn::storage::SQLiteDatabase::iterateAll().

Here is the call graph for this function:

bool dtn::storage::SQLiteBundleStorage::contains ( const dtn::data::BundleID id)
virtual

This method returns true if the requested bundle is stored in the storage.

Implements dtn::storage::BundleStorage.

Definition at line 465 of file SQLiteBundleStorage.cpp.

References dtn::storage::SQLiteDatabase::contains().

Here is the call graph for this function:

dtn::data::Size dtn::storage::SQLiteBundleStorage::count ( )
virtual
Returns
the count of bundles in the storage

Reimplemented from dtn::storage::BundleStorage.

Definition at line 530 of file SQLiteBundleStorage.cpp.

References dtn::storage::SQLiteDatabase::count().

Here is the call graph for this function:

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

create a new BLOB object within this storage

Returns

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

References dtn::storage::SQLiteDatabase::empty().

Here is the call graph for this function:

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

callbacks for the sqlite database

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

Definition at line 635 of file SQLiteBundleStorage.cpp.

dtn::data::Bundle dtn::storage::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::storage::BundleStorage.

Definition at line 241 of file SQLiteBundleStorage.cpp.

References dtn::data::AgeBlock::addSeconds(), dtn::data::PayloadBlock::BLOCK_TYPE, dtn::storage::SQLiteDatabase::get(), dtn::data::Bundle::push_back(), and dtn::data::SeparateDeserializer::readBlock().

Here is the call graph for this function:

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 235 of file SQLiteBundleStorage.cpp.

const SQLiteBundleStorage::eid_set dtn::storage::SQLiteBundleStorage::getDistinctDestinations ( )
virtual
See Also
BundleSeeker::getDistinctDestinations()

Implements dtn::storage::BundleStorage.

Definition at line 224 of file SQLiteBundleStorage.cpp.

References dtn::storage::SQLiteDatabase::getDistinctDestinations().

Here is the call graph for this function:

dtn::data::MetaBundle dtn::storage::SQLiteBundleStorage::info ( const dtn::data::BundleID id)
virtual

Get meta data about a specific bundle ID

Implements dtn::storage::BundleStorage.

Definition at line 475 of file SQLiteBundleStorage.cpp.

References dtn::storage::SQLiteDatabase::get().

Here is the call graph for this function:

void dtn::storage::SQLiteBundleStorage::iterateDatabase ( const dtn::data::MetaBundle bundle,
const dtn::data::Length  size 
)
virtual
void dtn::storage::SQLiteBundleStorage::raiseEvent ( const dtn::core::TimeEvent evt)
throw (
)
virtual

This method is used to receive events.

Parameters
evt

Implements dtn::core::EventReceiver< dtn::core::TimeEvent >.

Definition at line 541 of file SQLiteBundleStorage.cpp.

References dtn::core::TIME_SECOND_TICK.

void dtn::storage::SQLiteBundleStorage::raiseEvent ( const dtn::core::GlobalEvent evt)
throw (
)
virtual
void dtn::storage::SQLiteBundleStorage::releaseCustody ( const dtn::data::EID custodian,
const dtn::data::BundleID id 
)
virtual
See Also
BundleStorage::releaseCustody();

Implements dtn::storage::BundleStorage.

Definition at line 612 of file SQLiteBundleStorage.cpp.

References dtn::storage::SQLiteDatabase::update(), and dtn::storage::SQLiteDatabase::UPDATE_CUSTODIAN.

Here is the call graph for this function:

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 487 of file SQLiteBundleStorage.cpp.

References dtn::storage::BundleStorage::eventBundleRemoved(), dtn::storage::BundleStorage::freeSpace(), and dtn::storage::SQLiteDatabase::remove().

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 649 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 644 of file SQLiteBundleStorage.cpp.


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