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< SchedulegetSchedule (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...
 
- 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::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::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 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::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: