GroupManagerDb is an abstract base class for the storage of data used by the GroupManager. More...
#include <group-manager-db.hpp>
Classes | |
| class | Error |
| GroupManagerDb::Error extends std::exception for errors using GroupManagerDb methods. More... | |
Public Member Functions | |
| virtual | ~GroupManagerDb () |
| The virtual Destructor. | |
| virtual bool | hasSchedule (const std::string &name)=0 |
| Check if there is a schedule with the given name. More... | |
| virtual void | listAllScheduleNames (std::vector< std::string > &nameList)=0 |
| Append all the names of the schedules to the nameList. More... | |
| virtual ptr_lib::shared_ptr < Schedule > | getSchedule (const std::string &name)=0 |
| Get a schedule with the given name. More... | |
| virtual void | getScheduleMembers (const std::string &name, std::map< Name, Blob > &memberMap)=0 |
| 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)=0 |
| Add a schedule with the given name. More... | |
| virtual void | deleteSchedule (const std::string &name)=0 |
| Delete the schedule with the given name. More... | |
| virtual void | renameSchedule (const std::string &oldName, const std::string &newName)=0 |
| Rename a schedule with oldName to newName. More... | |
| virtual void | updateSchedule (const std::string &name, const Schedule &schedule)=0 |
| Update the schedule with name and replace the old object with the given schedule. More... | |
| virtual bool | hasMember (const Name &identity)=0 |
| Check if there is a member with the given identity name. More... | |
| virtual void | listAllMembers (std::vector< Name > &nameList)=0 |
| Append all the members to the nameList. More... | |
| virtual std::string | getMemberSchedule (const Name &identity)=0 |
| 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)=0 |
| 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)=0 |
| Change the name of the schedule for the given member's identity name. More... | |
| virtual void | deleteMember (const Name &identity)=0 |
| Delete a member with the given identity name. More... | |
| virtual bool | hasEKey (const Name &eKeyName)=0 |
| 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)=0 |
| Add the EKey with name eKeyName to the database. More... | |
| virtual void | getEKey (const Name &eKeyName, Blob &publicKey, Blob &privateKey)=0 |
| Get the group key pair with the name eKeyName from the database. More... | |
| virtual void | cleanEKeys ()=0 |
| Delete all the EKeys in the database. More... | |
| virtual void | deleteEKey (const Name &eKeyName)=0 |
| Delete the EKey with name eKeyName from the database. More... | |
GroupManagerDb is an abstract base class for the storage of data used by the GroupManager.
It contains two tables to store Schedules and Members. This is an abstract base class. A subclass must implement the methods. For example, see Sqlite3GroupManagerDb.
|
pure virtual |
Add the EKey with name eKeyName to the database.
| eKeyName | The name of the EKey. This copies the Name. |
| publicKey | The encoded public Key of the group key pair. |
| privateKey | The encoded private Key of the group key pair. |
| GroupManagerDb::Error | If a key with name eKeyName already exists in the database, or other database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure 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).
| scheduleName | The schedule name. |
| keyName | The name of the key. |
| key | A Blob of the public key DER. |
| GroupManagerDb::Error | If there's no schedule named scheduleName, if the member's identity name already exists, or other database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
Add a schedule with the given name.
| name | The name of the schedule. The name cannot be empty. |
| schedule | The Schedule to add. |
| GroupManagerDb::Error | if a schedule with the same name already exists, if the name is empty, or other database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure 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.
| GroupManagerDb::Error | for a database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
Delete the EKey with name eKeyName from the database.
If no key with the name exists in the database, do nothing.
| eKeyName | The name of the EKey. |
| GroupManagerDb::Error | for a database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
Delete a member with the given identity name.
If there is no member with the identity name, then do nothing.
| identity | The member's identity name. |
| GroupManagerDb::Error | for a database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure 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.
| name | The name of the schedule. |
| GroupManagerDb::Error | for a database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
Get the group key pair with the name eKeyName from the database.
| eKeyName | The name of the EKey. |
| publicKey | Set publicKey to the encoded public Key. |
| privateKey | Set publicKey to the encoded private Key. |
| GroupManagerDb::Error | If the key with name eKeyName does not exist in the database, or other database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
Get the name of the schedule for the given member's identity name.
| identity | The member's identity name. |
| GroupManagerDb::Error | if there's no member with the given identity name in the database, or other database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
Get a schedule with the given name.
| name | The name of the schedule. |
| GroupManagerDb::Error | if the schedule does not exist or other database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
For each member using the given schedule, get the name and public key DER of the member's key.
| name | The name of the schedule. |
| memberMap | Put 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. |
| GroupManagerDb::Error | for a database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
Check if there is an EKey with the name eKeyName in the database.
| eKeyName | The name of the EKey. |
| GroupManagerDb::Error | for a database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
Check if there is a member with the given identity name.
| identity | The member's identity name. |
| GroupManagerDb::Error | for a database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
Check if there is a schedule with the given name.
| name | The name of the schedule. |
| GroupManagerDb::Error | for a database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
Append all the members to the nameList.
| nameList | Append result names to nameList. This first clears the list. |
| GroupManagerDb::Error | for a database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
Append all the names of the schedules to the nameList.
| nameList | Append result names to nameList. This first clears the list. |
| GroupManagerDb::Error | for a database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
Rename a schedule with oldName to newName.
| oldName | The name of the schedule to be renamed. |
| newName | The new name of the schedule. The name cannot be empty. |
| GroupManagerDb::Error | If a schedule with newName already exists, if the schedule with oldName does not exist, if newName is empty, or other database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure virtual |
Change the name of the schedule for the given member's identity name.
| identity | The member's identity name. |
| scheduleName | The new schedule name. |
| GroupManagerDb::Error | if there's no member with the given identity name in the database, or there's no schedule named scheduleName, or other database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
|
pure 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.
| name | The name of the schedule. The name cannot be empty. |
| schedule | The Schedule to update or add. |
| GroupManagerDb::Error | if the name is empty, or other database error. |
Implemented in ndn::Sqlite3GroupManagerDb.
1.8.6