Classes | Public Member Functions | Protected Member Functions | Friends

dtn::core::SQLiteBundleStorage Class Reference

#include <SQLiteBundleStorage.h>

Inherits dtn::core::BundleStorage, dtn::core::EventReceiver, and ibrcommon::JoinableThread.

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

List of all members.

Classes

class  NoBundleFoundException
class  SQLiteQuerryException

Public Member Functions

 SQLiteBundleStorage (const ibrcommon::File &dbPath, const string &dbFile, const int &size)
virtual ~SQLiteBundleStorage ()
void store (const dtn::data::Bundle &bundle)
void storeBundleRoutingInfo (const data::BundleID &BundleID, const int &key, const string &routingInfo)
void storeNodeRoutingInfo (const data::EID &nodel, const int &key, const std::string &routingInfo)
void storeRoutingInfo (const int &key, const std::string &routingInfo)
dtn::data::Bundle get (const dtn::data::BundleID &id)
const dtn::data::MetaBundle getByDestination (const dtn::data::EID &eid, bool exact=false)
const dtn::data::MetaBundle getByFilter (const ibrcommon::BloomFilter &filter)
std::string getBundleRoutingInfo (const data::BundleID &bundleID, const int &key)
std::string getNodeRoutingInfo (const data::EID &eid, const int &key)
std::string getRoutingInfo (const int &key)
void removeBundleRoutingInfo (const data::BundleID &bundleID, const int &key)
void removeNodeRoutingInfo (const data::EID &eid, const int &key)
void removeRoutingInfo (const int &key)
void remove (const dtn::data::BundleID &id)
void clear ()
void clearAll ()
bool empty ()
unsigned int count ()
void releaseCustody (dtn::data::BundleID &bundle)
void setPriority (const int priority, const dtn::data::BundleID &id)
list< data::BundlegetBundleBySize (const int &limit)
list< data::BundlegetBundleByTTL (const int &limit)
list< data::BundlegetBundlesBySource (const dtn::data::EID &sourceID)
list< data::BundlegetBundlesByDestination (const dtn::data::EID &sourceID)
list< data::BlockgetBlock (const data::BundleID &bundleID, const char &blocktype)
int occupiedSpace ()
void raiseEvent (const Event *evt)

Protected Member Functions

void run (void)
bool __cancellation ()

Friends

class testsuite::SQLiteBundleStorageTestSuite

Detailed Description

Definition at line 20 of file SQLiteBundleStorage.h.


Constructor & Destructor Documentation

dtn::core::SQLiteBundleStorage::SQLiteBundleStorage ( const ibrcommon::File dbPath,
const string &  dbFile,
const int &  size 
)

Constructor

Parameters:
Pfad zum Ordner in denen die Datein gespeichert werden.
Dateiname der Datenbank
maximale Größe der Datenbank

Definition at line 46 of file SQLiteBundleStorage.cpp.

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

Here is the call graph for this function:

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

Member Function Documentation

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

Reimplemented from ibrcommon::Thread.

Definition at line 1558 of file SQLiteBundleStorage.cpp.

References ibrcommon::Conditional::signal().

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

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

Clears the hole database.

Definition at line 1097 of file SQLiteBundleStorage.cpp.

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

Definition at line 1181 of file SQLiteBundleStorage.cpp.

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

Definition at line 1169 of file SQLiteBundleStorage.cpp.

dtn::data::Bundle dtn::core::SQLiteBundleStorage::get ( const dtn::data::BundleID id  ) 
list< data::Block > dtn::core::SQLiteBundleStorage::getBlock ( const data::BundleID bundleID,
const char &  blocktype 
)

Gets the Block by its type of a specific Bundle

Parameters:
BundleID 
Blocktype 
Returns:
A list containing the resulting Blocks

Definition at line 1807 of file SQLiteBundleStorage.cpp.

References dtn::data::BundleID::toString().

Here is the call graph for this function:

list< data::Bundle > dtn::core::SQLiteBundleStorage::getBundleBySize ( const int &  limit  ) 
list< data::Bundle > dtn::core::SQLiteBundleStorage::getBundleByTTL ( const int &  limit  ) 
std::string dtn::core::SQLiteBundleStorage::getBundleRoutingInfo ( const data::BundleID bundleID,
const int &  key 
)

Returns the routinginformation stored for a specific Bundle.

Parameters:
ID to the Bundle

Definition at line 783 of file SQLiteBundleStorage.cpp.

References dtn::data::BundleID::toString().

Here is the call graph for this function:

list< data::Bundle > dtn::core::SQLiteBundleStorage::getBundlesByDestination ( const dtn::data::EID sourceID  ) 
list< data::Bundle > dtn::core::SQLiteBundleStorage::getBundlesBySource ( const dtn::data::EID sourceID  ) 
const dtn::data::MetaBundle dtn::core::SQLiteBundleStorage::getByDestination ( const dtn::data::EID eid,
bool  exact = false 
)
const dtn::data::MetaBundle dtn::core::SQLiteBundleStorage::getByFilter ( const ibrcommon::BloomFilter filter  ) 

Returns a bundle ID which is not in the bloomfilter, but in the storage

Parameters:
filter 
Returns:

Definition at line 566 of file SQLiteBundleStorage.cpp.

std::string dtn::core::SQLiteBundleStorage::getNodeRoutingInfo ( const data::EID eid,
const int &  key 
)

Returns the routinginformation stored for a specific Node.

Parameters:
ID to the Bundle
Returns:
string containing Routinginformation for a specific Node

Definition at line 805 of file SQLiteBundleStorage.cpp.

References dtn::data::EID::getString().

Here is the call graph for this function:

std::string dtn::core::SQLiteBundleStorage::getRoutingInfo ( const int &  key  ) 

Gets Routinginformation storen refered by Key.

Parameters:
the key referring to der routinginformation
Returns:
string containing Routinginformation

Definition at line 827 of file SQLiteBundleStorage.cpp.

int dtn::core::SQLiteBundleStorage::occupiedSpace (  ) 

Returns the ammount of occupied storage space

Returns:
occupied storage space or -1 indicating an error

Definition at line 1198 of file SQLiteBundleStorage.cpp.

void dtn::core::SQLiteBundleStorage::raiseEvent ( const Event evt  ) 

This method is used to receive events.

Parameters:
evt 

Definition at line 1508 of file SQLiteBundleStorage.cpp.

References dtn::core::GlobalEvent::getAction(), dtn::core::TimeEvent::getAction(), dtn::core::TimeEvent::getTimestamp(), and ibrcommon::Conditional::signal().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::releaseCustody ( dtn::data::BundleID bundle  ) 
See also:
BundleStorage::releaseCustody();

Definition at line 1856 of file SQLiteBundleStorage.cpp.

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

void dtn::core::SQLiteBundleStorage::removeBundleRoutingInfo ( const data::BundleID bundleID,
const int &  key 
)

Deletes the Routinginformation of a Bundle

Parameters:
BundleID 

Definition at line 1053 of file SQLiteBundleStorage.cpp.

References dtn::data::BundleID::toString().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::removeNodeRoutingInfo ( const data::EID eid,
const int &  key 
)

Deletes Routinginformation of a node

Parameters:
The EID of the Node

Definition at line 1068 of file SQLiteBundleStorage.cpp.

References dtn::data::EID::getString().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::removeRoutingInfo ( const int &  key  ) 

deletes a Routinginformation specified by a key

Parameters:
key specifieing the information to be deleted

Definition at line 1083 of file SQLiteBundleStorage.cpp.

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

Abstract interface for thread context run method.

Implements ibrcommon::Thread.

Definition at line 1547 of file SQLiteBundleStorage.cpp.

References ibrcommon::Conditional::wait().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::setPriority ( const int  priority,
const dtn::data::BundleID id 
)

Sets the priority of the Bundle.

Parameters:
The Priority Value between 0 and 3.
BundleId where the priority should be set.

Definition at line 848 of file SQLiteBundleStorage.cpp.

References dtn::data::PrimaryBlock::PRIORITY_BIT1, and dtn::data::PrimaryBlock::PRIORITY_BIT2.

void dtn::core::SQLiteBundleStorage::store ( const dtn::data::Bundle bundle  ) 
void dtn::core::SQLiteBundleStorage::storeBundleRoutingInfo ( const data::BundleID BundleID,
const int &  key,
const string &  routingInfo 
)

store routinginformation referring to a Bundle

Parameters:
ID of the Bundle to which the routinginformation is referring
string containing the routinginformation

Definition at line 945 of file SQLiteBundleStorage.cpp.

References dtn::data::BundleID::toString().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::storeNodeRoutingInfo ( const data::EID nodel,
const int &  key,
const std::string &  routingInfo 
)

store routinginformation reffering to a Node.

Parameters:
EID of the Node
A string routinginformation

Definition at line 965 of file SQLiteBundleStorage.cpp.

References dtn::data::EID::getString().

Here is the call graph for this function:

void dtn::core::SQLiteBundleStorage::storeRoutingInfo ( const int &  key,
const std::string &  routingInfo 
)

store Routinginformation

Parameters:
Key which refers to the Routinginformation
string containing Routinginformation

Definition at line 985 of file SQLiteBundleStorage.cpp.


Friends And Related Function Documentation

friend class testsuite::SQLiteBundleStorageTestSuite [friend]

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