Manages the database to store various profile data. More...
Public Types | |
|
typedef boost::shared_ptr < ConfigDb > | SharedPtr |
Public Member Functions | |
| ConfigDb () | |
| Ctor. | |
| virtual | ~ConfigDb () |
| Dtor. | |
| virtual bool | initDB () |
| Initialize the Database. | |
| int | getVersionInfo (std::string &a_status, std::string &a_notes) |
| Gets the current DB Version Info. | |
| bool | peerAdd (const Data::Peer::SharedPtr &a_peer) |
| Adds a new Peer. | |
| Data::Peer::SharedPtr | peerGet (const Tonido::Data::PeerID &a_peerID) |
| Gets a specific Peer. | |
| bool | peerDelete (const Tonido::Data::PeerID &a_peer) |
| Deletes a specific Peer. | |
| bool | peerUpdate (const Data::Peer::SharedPtr &a_peer) |
| Updates a specific Peer. | |
| std::string | getPeerGroupMemberStatus (const Tonido::Data::PeerID &a_peerID, const Poco::UUID &a_groupID) |
| Gets the Peer's Group member status. | |
| bool | groupAdd (const Data::Group::SharedPtr &a_group) |
| Add a new group. | |
| bool | groupUpdate (const Data::Group::SharedPtr &a_group) |
| Updates a group. | |
| bool | groupDelete (const Data::Group::SharedPtr &a_group) |
| Deletes a group. | |
| void | removePeersForGroup (const std::string &a_groupID) |
| Removes the peers associated with a group. | |
| void | removeUnGroupedPeers (const Tonido::Data::PeerID &a_peer) |
| Removes the peers associated with a group. | |
| void | getUnGroupedPeers (const Tonido::Data::PeerID &a_peer, std::vector< Tonido::Data::PeerID > &a_peers) |
| Gets the peers that are not part. | |
| Data::Group::SharedPtr | groupGet (const std::string &a_groupID) |
| groupGet | |
| bool | peerCollectionGet (Data::Peer::Collection &a_collection, const Poco::UUID &a_groupId, int64_bt a_from=-1, int64_bt a_numOfRecs=-1) |
| peerCollectionGet | |
| bool | peerCollectionGet (Data::Peer::Collection &a_collection, int64_bt a_from=-1, int64_bt a_numOfRecs=-1) |
| peerCollectionGet | |
| void | groupCollectionGet (Data::Group::Collection &a_collection) |
| groupCollectionGet | |
| void | groupCollectionGet (const std::string &a_groupID, Data::Group::Collection &a_collection, bool a_isPartOf) |
| groupCollectionGet | |
| bool | activityAdd (Data::Activity::SharedPtr &a_pActivity) |
| addActivity | |
| bool | activityCollectionGet (Data::Activity::Collection &a_activities) |
| getActivityCollection | |
| bool | activityDelete (int a_activity) |
| deleteActivity | |
| std::string | activityCollectionGetXML (int a_source, int a_start, int a_numItems) |
| getActivityCollectionXML | |
| std::string | activityCollectionGetXMLByLevel (int a_level, int a_start, int a_numItems) |
| bool | activityDeleteAll () |
| deleteAllActivity | |
| std::string | getConfigValue (const std::string &a_key, const std::string &a_name, const std::string &a_defaultVal) |
| getConfigValue | |
| bool | doesConfigExist (const std::string &a_key, const std::string &a_name) |
| doesConfigExist | |
| void | setConfigValue (const std::string &a_key, const std::string &a_name, const std::string &a_value) |
| setConfigValue | |
| bool | invitationAdd (const Data::Invitation::SharedPtr &a_pInvitation) |
| invitationAdd | |
| bool | invitationCollectionGet (Data::Invitation::Collection &a_collection, const std::string &a_invitationType="") |
| invitationCollectionGet | |
| bool | invitationCollectionGetForGroup (Data::Invitation::Collection &a_collection, const Poco::UUID &a_groupID) |
| bool | invitationDelete (const std::string &a_invitationId) |
| invitationDelete | |
| Data::Invitation::SharedPtr | invitationGet (const std::string &a_invitationId) |
| invitationGet | |
| Data::Invitation::SharedPtr | invitationGet (const Poco::UUID &a_groupID, const std::string &a_invitationPassword) |
| invitationGet | |
| bool | invitationCollectionGet (Data::Invitation::Collection &a_collection, const Tonido::Data::PeerID &a_peerID, const std::string &a_inviteType, bool a_isInvitingPeer) |
| invitationCollectionGet | |
| void | getPeerGroupMembership (const Tonido::Data::PeerID &a_peerID, std::set< std::string > &o_groupUUIDs) |
| getPeerGroupMembership | |
| bool | addRemoteAccessHistoryItem (Data::RemoteAccessHistoryItem::SharedPtr &a_item) |
| addRemoteAccessHistoryItem | |
| int64_bt | getRemoteAccessHistoryCount () |
| getRemoteAccessHistoryCount | |
| bool | getRemoteAccessHistory (Data::RemoteAccessHistoryItem::Collection &a_collection, int64_bt a_from=-1, int64_bt a_numOfRecs=-1) |
| getRemoteAccessHistory | |
| bool | deleteAllRemoteAccessItems () |
| deleteAllRemoteAccessItems | |
| bool | groupDataStoreGet (const Poco::UUID &a_groupId, const Poco::UUID &a_localPeerId, DataSync::DataSyncStore &a_store) |
| groupDataStoreGet | |
| bool | groupDataStoreSave (DataSync::DataSyncStore &a_store) |
| groupDataStoreSave | |
| bool | messageAdd (const Data::Mail::SharedPtr &a_message) |
| messageAdd | |
| Data::Mail::SharedPtr | messageGet (const Poco::UUID &a_messageID) |
| messageGet | |
| bool | messageDelete (const Poco::UUID &a_messageID) |
| messageDelete | |
| bool | messageUpdateStatus (const Poco::UUID &a_messageID, const std::string &a_Status) |
| messageUpdate | |
| bool | messageUpdateDate (const Poco::UUID &a_messageID, const std::string &a_date) |
| messageUpdateDate | |
| bool | messageCollectionGet (Data::Mail::Collection &a_collection, const std::string &a_status, int offset, int limit) |
| messageGetCollection | |
| bool | messageCollectionGet (Data::Mail::Collection &a_collection, const std::string &a_status, const std::string &orderby, int offset, int limit) |
| bool | messageCollectionGet (Data::Mail::Collection &a_collection, const std::string &a_status, const std::string &orderby, const std::string &ascending, int offset, int limit) |
| int | messageCount (const std::string &a_status) |
| bool | messageSearch (Data::Mail::Collection &a_collection, const std::string &keyword, int offset, int limit, int &a_total) |
| messageSearch | |
| bool | remotePeerAdd (const Tonido::Data::PeerID &a_peer) |
| addNewRemoteAccessList | |
| bool | remotePeerDelete (const Tonido::Data::PeerID &a_peer) |
| deleteRemoteAccessList | |
| bool | remotePeerAllowedCollectionGet (std::set< Tonido::Data::PeerID > &a_peers) |
| getAllowedRemotePeerList | |
| bool | ipAuthRecordAdd (const Data::IPData &a_data) |
| iplistAddNew | |
| bool | doesIPAuthRecordExist (const Data::IPData &a_data) |
| bool | ipAuthRecordsGet (std::vector< Data::IPData > &a_List, const uint32_bt &a_allowDeny) |
| getIPList | |
| bool | ipAuthRecordRemove (const Data::IPData &a_data) |
| getIPList | |
| bool | blockedPeersCollectionGet (std::vector< Tonido::Data::PeerID > &a_List) |
| getBlockedPeers | |
| bool | blockedPeerDelete (const Tonido::Data::PeerID &a_peerid) |
| removeBlockedPeer | |
| bool | blockedPeerAdd (const Tonido::Data::PeerID &a_peerid) |
| addBlockedPeer | |
| bool | isPeerBlocked (const Tonido::Data::PeerID &a_peerid) |
| bool | guestUserAdd (Tonido::Data::GuestUser::SharedPtr &a_guestUser) |
| guestUserAdd | |
| bool | guestUserUpdate (Tonido::Data::GuestUser::SharedPtr &a_guestUser) |
| guestUserUpdate | |
| bool | guestUserRemove (int a_userID) |
| guestUserRemove | |
| int | guestUserAuthenticate (const std::string &a_userName, const std::string &a_password) |
| guestUserAuthenticate | |
| std::string | getUsersXML () |
| getUsersXML | |
| int | getGuestUserId (const std::string &a_userName, const std::string &a_password, bool a_isHashed=false) |
| getGuestUserId | |
| void | guestUserCollectionGet (Tonido::Data::GuestUser::Collection &a_collection) |
| guestUserCollectionGet | |
| Tonido::Data::GuestUser::SharedPtr | guestUserGet (int a_userId) |
| guestUserGet | |
| bool | doesGuestUserExist (const std::string &a_userName) |
| doesGuestUserExist | |
| bool | doesGuestUserExist (const std::string &a_userName, int a_userId) |
| doesGuestUserExist | |
| bool | doesGuestUserExist (int a_userId) |
| doesGuestUserExist | |
| bool | addCommentRecord (Tonido::Data::CommentRecord &a_record) |
| bool | deleteCommentRecord (int32_bt a_commentId) |
| bool | getCommentRecords (const std::string &a_name, Tonido::Data::CommentRecord::Collection &a_recs) |
| bool | getAllCommentRecords (Tonido::Data::CommentRecord::Collection &a_recs) |
| bool | addTagRecord (Tonido::Data::TagRecord &a_record) |
| bool | deleteTagRecord (int32_bt a_tagId) |
| bool | getTagRecords (const std::string &a_name, Tonido::Data::TagRecord::Collection &a_Recs) |
| bool | getAllTagRecords (Tonido::Data::TagRecord::Collection &a_Recs) |
| bool | isFavorite (const std::string &a_name) |
| int | addPathFilter (const std::string &a_filter) |
| bool | deletePathFilter (int32_bt a_tagId) |
| bool | getPathFilters (std::vector< std::pair< int, std::string > > &a_Recs) |
| bool | addFavoriteList (const std::string &a_name, int &a_id) |
| bool | updateFavoriteList (int a_id, const std::string &a_name) |
| bool | deleteFavoriteList (int a_id) |
| std::string | getFavoriteListsXML () |
| bool | doesFavoriteListExist (const std::string &a_name, int &a_id) |
| bool | setFavorite (int a_id, const std::string &a_name, int a_order) |
| bool | unsetFavorite (int a_id, const std::string &a_name) |
| bool | doesFavoriteExist (int a_id, const std::string &a_name) |
| bool | updateFavoriteOrder (int a_id, const std::string &a_name, int a_order) |
| std::string | getFavoriteRecordsXML (int a_id, const std::string &a_filter) |
Manages the database to store various profile data.
| Tonido::Misc::ConfigDb::ConfigDb | ( | ) |
Ctor.
details if needed ...
| Tonido::Misc::ConfigDb::~ConfigDb | ( | ) | [virtual] |
Dtor.
details if needed ...
| bool Tonido::Misc::ConfigDb::activityAdd | ( | Data::Activity::SharedPtr & | a_pActivity | ) |
addActivity
adds a activity
| bool Tonido::Misc::ConfigDb::activityCollectionGet | ( | Data::Activity::Collection & | a_activities | ) |
getActivityCollection
Gets all available news items
| std::string Tonido::Misc::ConfigDb::activityCollectionGetXML | ( | int | a_source, |
| int | a_start, | ||
| int | a_numItems | ||
| ) |
getActivityCollectionXML
Gets the Activity from the database as XML
| bool Tonido::Misc::ConfigDb::activityDelete | ( | int | a_activity | ) |
deleteActivity
Deletes a given activity
| bool Tonido::Misc::ConfigDb::activityDeleteAll | ( | ) |
deleteAllActivity
Deletes all activities
| bool Tonido::Misc::ConfigDb::addRemoteAccessHistoryItem | ( | Data::RemoteAccessHistoryItem::SharedPtr & | a_item | ) |
addRemoteAccessHistoryItem
adds a new remote access history item
| bool Tonido::Misc::ConfigDb::deleteAllRemoteAccessItems | ( | ) |
deleteAllRemoteAccessItems
removes all remote access items
| bool Tonido::Misc::ConfigDb::doesConfigExist | ( | const std::string & | a_key, |
| const std::string & | a_name | ||
| ) |
doesConfigExist
Indicates if the given configuration setting exists for a given key, name
| [in] | a_key | represents the key part of the key, name pair used to identify a value |
| [in] | a_name | represents the name in the key, name pair |
| std::string Tonido::Misc::ConfigDb::getConfigValue | ( | const std::string & | a_key, |
| const std::string & | a_name, | ||
| const std::string & | a_defaultVal | ||
| ) |
getConfigValue
Gets the config value associated with the specified key and name
| [in] | a_key | represents the key part of the key, name pair used to identify a value |
| [in] | a_name | represents the name in the key, name pair |
| [in] | a_defaultVal | represents the default value if the setting cannot be found |
| void Tonido::Misc::ConfigDb::getPeerGroupMembership | ( | const Tonido::Data::PeerID & | a_peerID, |
| std::set< std::string > & | o_groupUUIDs | ||
| ) |
getPeerGroupMembership
Return the list of group UUIDs this peer is part of.
| bool Tonido::Misc::ConfigDb::getRemoteAccessHistory | ( | Data::RemoteAccessHistoryItem::Collection & | a_collection, |
| int64_bt | a_from = -1, |
||
| int64_bt | a_numOfRecs = -1 |
||
| ) |
getRemoteAccessHistory
Gets all the remote access history items
| int64_bt Tonido::Misc::ConfigDb::getRemoteAccessHistoryCount | ( | ) |
getRemoteAccessHistoryCount
Gets the total num of the remote access history items
| void Tonido::Misc::ConfigDb::groupCollectionGet | ( | Data::Group::Collection & | a_collection | ) |
groupCollectionGet
Gets all peers
| void Tonido::Misc::ConfigDb::groupCollectionGet | ( | const std::string & | a_groupID, |
| Data::Group::Collection & | a_collection, | ||
| bool | a_isPartOf | ||
| ) |
groupCollectionGet
Gets all groups peer is part of or not part of
| bool Tonido::Misc::ConfigDb::groupDataStoreGet | ( | const Poco::UUID & | a_groupId, |
| const Poco::UUID & | a_localPeerId, | ||
| DataSync::DataSyncStore & | a_store | ||
| ) |
groupDataStoreGet
Gets a Data Store populated with group data
| bool Tonido::Misc::ConfigDb::groupDataStoreSave | ( | DataSync::DataSyncStore & | a_store | ) |
groupDataStoreSave
Gets a Data Store populated with group data
| boost::shared_ptr< Group > Tonido::Misc::ConfigDb::groupGet | ( | const std::string & | a_groupID | ) |
groupGet
Gets a specific Group
| bool Tonido::Misc::ConfigDb::invitationAdd | ( | const Data::Invitation::SharedPtr & | a_pInvitation | ) |
invitationAdd
adds a invitation
| bool Tonido::Misc::ConfigDb::invitationCollectionGet | ( | Data::Invitation::Collection & | a_collection, |
| const std::string & | a_invitationType = "" |
||
| ) |
invitationCollectionGet
Gets all available invitations
| bool Tonido::Misc::ConfigDb::invitationCollectionGet | ( | Data::Invitation::Collection & | a_collection, |
| const Tonido::Data::PeerID & | a_peerID, | ||
| const std::string & | a_inviteType, | ||
| bool | a_isInvitingPeer | ||
| ) |
invitationCollectionGet
Gets all available invitations
| bool Tonido::Misc::ConfigDb::invitationDelete | ( | const std::string & | a_invitationId | ) |
invitationDelete
Deletes a given invitation
| Invitation::SharedPtr Tonido::Misc::ConfigDb::invitationGet | ( | const std::string & | a_invitationId | ) |
invitationGet
Gets a specific Invitation
| Invitation::SharedPtr Tonido::Misc::ConfigDb::invitationGet | ( | const Poco::UUID & | a_groupID, |
| const std::string & | a_invitationPassword | ||
| ) |
invitationGet
Gets a specific Invitation
| bool Tonido::Misc::ConfigDb::ipAuthRecordAdd | ( | const Data::IPData & | a_data | ) |
iplistAddNew
adds ip info to ip authorization list
| bool Tonido::Misc::ConfigDb::ipAuthRecordRemove | ( | const Data::IPData & | a_data | ) |
getIPList
get ip authorization list
| bool Tonido::Misc::ConfigDb::ipAuthRecordsGet | ( | std::vector< Data::IPData > & | a_List, |
| const uint32_bt & | a_allowDeny | ||
| ) |
getIPList
get ip authorization list
| bool Tonido::Misc::ConfigDb::messageAdd | ( | const Data::Mail::SharedPtr & | a_message | ) |
messageAdd
Adds a new message
| bool Tonido::Misc::ConfigDb::messageCollectionGet | ( | Data::Mail::Collection & | a_collection, |
| const std::string & | a_status, | ||
| int | offset, | ||
| int | limit | ||
| ) |
messageGetCollection
Gets a all messages in a specified status
| bool Tonido::Misc::ConfigDb::messageDelete | ( | const Poco::UUID & | a_messageID | ) |
messageDelete
Deletes a specific message
| Mail::SharedPtr Tonido::Misc::ConfigDb::messageGet | ( | const Poco::UUID & | a_messageID | ) |
messageGet
Gets a specific message
| bool Tonido::Misc::ConfigDb::messageSearch | ( | Data::Mail::Collection & | a_collection, |
| const std::string & | keyword, | ||
| int | offset, | ||
| int | limit, | ||
| int & | a_total | ||
| ) |
messageSearch
Gets a all messages with specific search criteria
| bool Tonido::Misc::ConfigDb::messageUpdateDate | ( | const Poco::UUID & | a_messageID, |
| const std::string & | a_date | ||
| ) |
messageUpdateDate
Updates a specific message's date
| bool Tonido::Misc::ConfigDb::messageUpdateStatus | ( | const Poco::UUID & | a_messageID, |
| const std::string & | a_Status | ||
| ) |
messageUpdate
Updates a specific message
| bool Tonido::Misc::ConfigDb::peerCollectionGet | ( | Data::Peer::Collection & | a_collection, |
| const Poco::UUID & | a_groupId, | ||
| int64_bt | a_from = -1, |
||
| int64_bt | a_numOfRecs = -1 |
||
| ) |
peerCollectionGet
Gets Peers for a given group id
| bool Tonido::Misc::ConfigDb::peerCollectionGet | ( | Data::Peer::Collection & | a_collection, |
| int64_bt | a_from = -1, |
||
| int64_bt | a_numOfRecs = -1 |
||
| ) |
peerCollectionGet
Gets All Peers
| bool Tonido::Misc::ConfigDb::remotePeerAdd | ( | const Tonido::Data::PeerID & | a_peer | ) |
addNewRemoteAccessList
AddNewRemoteAccessList
| bool Tonido::Misc::ConfigDb::remotePeerAllowedCollectionGet | ( | std::set< Tonido::Data::PeerID > & | a_peers | ) |
getAllowedRemotePeerList
GetRemoteAccessList
| bool Tonido::Misc::ConfigDb::remotePeerDelete | ( | const Tonido::Data::PeerID & | a_peer | ) |
deleteRemoteAccessList
DeleteRemoteAccessList
| void Tonido::Misc::ConfigDb::setConfigValue | ( | const std::string & | a_key, |
| const std::string & | a_name, | ||
| const std::string & | a_value | ||
| ) |
setConfigValue
Sets the config value associated with the specified key, name
| [in] | a_key | represents the key part of the key, name pair used to identify a value |
| [in] | a_name | represents the name in the key, name pair |
| [in] | a_value | represents the value to be set |