All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
ndn::Sqlite3GroupManagerDb Class Reference

Sqlite3GroupManagerDb extends GroupManagerDb to implement the storage of data used by the GroupManager using SQLite3. More...

#include <sqlite3-group-manager-db.hpp>

Inheritance diagram for ndn::Sqlite3GroupManagerDb:
ndn::GroupManagerDb

Public Member Functions

 Sqlite3GroupManagerDb (const std::string &databaseFilePath)
 Create an Sqlite3GroupManagerDb to use the given SQLite3 file. More...
 
virtual bool hasSchedule (const std::string &name)
 Check if there is a schedule with the given name. More...
 
virtual void listAllScheduleNames (std::vector< std::string > &nameList)
 Append all the names of the schedules to the nameList. More...
 
virtual ptr_lib::shared_ptr
< Schedule
getSchedule (const std::string &name)
 Get a schedule with the given name. More...
 
virtual void getScheduleMembers (const std::string &name, std::map< Name, Blob > &memberMap)
 For each member using the given schedule, get the name and public key DER of the member's key. More...
 
virtual void addSchedule (const std::string &name, const Schedule &schedule)
 Add a schedule with the given name. More...
 
virtual void deleteSchedule (const std::string &name)
 Delete the schedule with the given name. More...
 
virtual void renameSchedule (const std::string &oldName, const std::string &newName)
 Rename a schedule with oldName to newName. More...
 
virtual void updateSchedule (const std::string &name, const Schedule &schedule)
 Update the schedule with name and replace the old object with the given schedule. More...
 
virtual bool hasMember (const Name &identity)
 Check if there is a member with the given identity name. More...
 
virtual void listAllMembers (std::vector< Name > &nameList)
 Append all the members to the nameList. More...
 
virtual std::string getMemberSchedule (const Name &identity)
 Get the name of the schedule for the given member's identity name. More...
 
virtual void addMember (const std::string &scheduleName, const Name &keyName, const Blob &key)
 Add a new member with the given key named keyName into a schedule named scheduleName. More...
 
virtual void updateMemberSchedule (const Name &identity, const std::string &scheduleName)
 Change the name of the schedule for the given member's identity name. More...
 
virtual void deleteMember (const Name &identity)
 Delete a member with the given identity name. More...
 
virtual bool hasEKey (const Name &eKeyName)
 Check if there is an EKey with the name eKeyName in the database. More...
 
virtual void addEKey (const Name &eKeyName, const Blob &publicKey, const Blob &privateKey)
 Add the EKey with name eKeyName to the database. More...
 
virtual void getEKey (const Name &eKeyName, Blob &publicKey, Blob &privateKey)
 Get the group key pair with the name eKeyName from the database. More...
 
virtual void cleanEKeys ()
 Delete all the EKeys in the database. More...
 
virtual void deleteEKey (const Name &eKeyName)
 Delete the EKey with name eKeyName from the database. More...
 
- Public Member Functions inherited from ndn::GroupManagerDb
virtual ~GroupManagerDb ()
 The virtual Destructor.
 

Detailed Description

Sqlite3GroupManagerDb extends GroupManagerDb to implement the storage of data used by the GroupManager using SQLite3.

Note
This class is an experimental feature. The API may change.

Constructor & Destructor Documentation

ndn::Sqlite3GroupManagerDb::Sqlite3GroupManagerDb ( const std::string &  databaseFilePath)

Create an Sqlite3GroupManagerDb to use the given SQLite3 file.

Parameters
databaseFilePathThe path of the SQLite file.

Member Function Documentation

virtual void ndn::Sqlite3GroupManagerDb::addEKey ( const Name eKeyName,
const Blob publicKey,
const Blob privateKey 
)
virtual

Add the EKey with name eKeyName to the database.

Parameters
eKeyNameThe name of the EKey. This copies the Name.
publicKeyThe encoded public Key of the group key pair.
privateKeyThe encoded private Key of the group key pair.
Exceptions
GroupManagerDb::ErrorIf a key with name eKeyName already exists in the database, or other database error.

Implements ndn::GroupManagerDb.

virtual void ndn::Sqlite3GroupManagerDb::addMember ( const std::string &  scheduleName,
const Name keyName,
const Blob key 
)
virtual

Add a new member with the given key named keyName into a schedule named scheduleName.

The member's identity name is keyName.getPrefix(-1).

Parameters
scheduleNameThe schedule name.
keyNameThe name of the key.
keyA Blob of the public key DER.
Exceptions
GroupManagerDb::ErrorIf there's no schedule named scheduleName, if the member's identity name already exists, or other database error.

Implements ndn::GroupManagerDb.

virtual void ndn::Sqlite3GroupManagerDb::addSchedule ( const std::string &  name,
const Schedule schedule 
)
virtual

Add a schedule with the given name.

Parameters
nameThe name of the schedule. The name cannot be empty.
scheduleThe Schedule to add.
Exceptions
GroupManagerDb::Errorif a schedule with the same name already exists, if the name is empty, or other database error.

Implements ndn::GroupManagerDb.

virtual void ndn::Sqlite3GroupManagerDb::cleanEKeys ( )
virtual

Delete all the EKeys in the database.

The database will keep growing because EKeys will keep being added, so this method should be called periodically.

Exceptions
GroupManagerDb::Errorfor a database error.

Implements ndn::GroupManagerDb.

virtual void ndn::Sqlite3GroupManagerDb::deleteEKey ( const Name eKeyName)
virtual

Delete the EKey with name eKeyName from the database.

If no key with the name exists in the database, do nothing.

Parameters
eKeyNameThe name of the EKey.
Exceptions
GroupManagerDb::Errorfor a database error.

Implements ndn::GroupManagerDb.

virtual void ndn::Sqlite3GroupManagerDb::deleteMember ( const Name identity)
virtual

Delete a member with the given identity name.

If there is no member with the identity name, then do nothing.

Parameters
identityThe member's identity name.
Exceptions
GroupManagerDb::Errorfor a database error.

Implements ndn::GroupManagerDb.

virtual void ndn::Sqlite3GroupManagerDb::deleteSchedule ( const std::string &  name)
virtual

Delete the schedule with the given name.

Also delete members which use this schedule. If there is no schedule with the name, then do nothing.

Parameters
nameThe name of the schedule.
Exceptions
GroupManagerDb::Errorfor a database error.

Implements ndn::GroupManagerDb.

virtual void ndn::Sqlite3GroupManagerDb::getEKey ( const Name eKeyName,
Blob publicKey,
Blob privateKey 
)
virtual

Get the group key pair with the name eKeyName from the database.

Parameters
eKeyNameThe name of the EKey.
publicKeySet publicKey to the encoded public Key.
privateKeySet publicKey to the encoded private Key.
Exceptions
GroupManagerDb::ErrorIf the key with name eKeyName does not exist in the database, or other database error.

Implements ndn::GroupManagerDb.

virtual std::string ndn::Sqlite3GroupManagerDb::getMemberSchedule ( const Name identity)
virtual

Get the name of the schedule for the given member's identity name.

Parameters
identityThe member's identity name.
Returns
The name of the schedule.
Exceptions
GroupManagerDb::Errorif there's no member with the given identity name in the database, or other database error.

Implements ndn::GroupManagerDb.

virtual ptr_lib::shared_ptr<Schedule> ndn::Sqlite3GroupManagerDb::getSchedule ( const std::string &  name)
virtual

Get a schedule with the given name.

Parameters
nameThe name of the schedule.
Returns
A new Schedule object.
Exceptions
GroupManagerDb::Errorif the schedule does not exist or other database error.

Implements ndn::GroupManagerDb.

virtual void ndn::Sqlite3GroupManagerDb::getScheduleMembers ( const std::string &  name,
std::map< Name, Blob > &  memberMap 
)
virtual

For each member using the given schedule, get the name and public key DER of the member's key.

Parameters
nameThe name of the schedule.
memberMapPut results in this map where the map's key is the Name of the public key and the value is the Blob of the public key DER. This first clears the map. Note that the member's identity name is keyName.getPrefix(-1). If the schedule name is not found, the map is empty.
Exceptions
GroupManagerDb::Errorfor a database error.

Implements ndn::GroupManagerDb.

virtual bool ndn::Sqlite3GroupManagerDb::hasEKey ( const Name eKeyName)
virtual

Check if there is an EKey with the name eKeyName in the database.

Parameters
eKeyNameThe name of the EKey.
Returns
True if the EKey exists.
Exceptions
GroupManagerDb::Errorfor a database error.

Implements ndn::GroupManagerDb.

virtual bool ndn::Sqlite3GroupManagerDb::hasMember ( const Name identity)
virtual

Check if there is a member with the given identity name.

Parameters
identityThe member's identity name.
Returns
True if there is a member.
Exceptions
GroupManagerDb::Errorfor a database error.

Implements ndn::GroupManagerDb.

virtual bool ndn::Sqlite3GroupManagerDb::hasSchedule ( const std::string &  name)
virtual

Check if there is a schedule with the given name.

Parameters
nameThe name of the schedule.
Returns
True if there is a schedule.
Exceptions
GroupManagerDb::Errorfor a database error.

Implements ndn::GroupManagerDb.

virtual void ndn::Sqlite3GroupManagerDb::listAllMembers ( std::vector< Name > &  nameList)
virtual

Append all the members to the nameList.

Parameters
nameListAppend result names to nameList. This first clears the list.
Exceptions
GroupManagerDb::Errorfor a database error.

Implements ndn::GroupManagerDb.

virtual void ndn::Sqlite3GroupManagerDb::listAllScheduleNames ( std::vector< std::string > &  nameList)
virtual

Append all the names of the schedules to the nameList.

Parameters
nameListAppend result names to nameList. This first clears the list.
Exceptions
GroupManagerDb::Errorfor a database error.

Implements ndn::GroupManagerDb.

virtual void ndn::Sqlite3GroupManagerDb::renameSchedule ( const std::string &  oldName,
const std::string &  newName 
)
virtual

Rename a schedule with oldName to newName.

Parameters
oldNameThe name of the schedule to be renamed.
newNameThe new name of the schedule. The name cannot be empty.
Exceptions
GroupManagerDb::ErrorIf a schedule with newName already exists, if the schedule with oldName does not exist, if newName is empty, or other database error.

Implements ndn::GroupManagerDb.

virtual void ndn::Sqlite3GroupManagerDb::updateMemberSchedule ( const Name identity,
const std::string &  scheduleName 
)
virtual

Change the name of the schedule for the given member's identity name.

Parameters
identityThe member's identity name.
scheduleNameThe new schedule name.
Exceptions
GroupManagerDb::Errorif there's no member with the given identity name in the database, or there's no schedule named scheduleName, or other database error.

Implements ndn::GroupManagerDb.

virtual void ndn::Sqlite3GroupManagerDb::updateSchedule ( const std::string &  name,
const Schedule schedule 
)
virtual

Update the schedule with name and replace the old object with the given schedule.

Otherwise, if no schedule with name exists, a new schedule with name and the given schedule will be added to database.

Parameters
nameThe name of the schedule. The name cannot be empty.
scheduleThe Schedule to update or add.
Exceptions
GroupManagerDb::Errorif the name is empty, or other database error.

Implements ndn::GroupManagerDb.


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