![]() |
sP2P c++ STL *nix API
1.2
NAT traversal and peer-to-peer networking API providing all utilities needed to build peer-to-peer application straigth out of box
|
Used to send commands and receive results from virtual network index server More...
#include <VNManager.h>
Inherited by sp2plib::ConnectionManager::VNManagerInstancier.
Public Member Functions | |
~VNManager () | |
Destructor. | |
VUser | SaveUser (VUser &user,::std::string user_password="") |
Saves virtual user object in sP2P index storage | |
VNetwork | SaveNetwork (VNetwork &network) |
Creates/Updates Virtal network object in sP2P index storage | |
VObject | SaveObject (VObject &obj) |
Creates/Updates Virtal object in sP2P index storage | |
void | DeleteUser (Guid userToDeleteUID) |
Deletes virtual user object form sP2P index storage | |
void | DeleteNetwork (Guid networkToDeleteUID) |
Deletes virtual network object form sP2P index storage | |
void | DeleteObject (Guid objectToDeleteUID) |
Deletes virtual object form sP2P index storage | |
long | QueryUsersCount (::std::string QueryCommandText) |
Returns count of virtal user objects in sP2P index storage matched by query | |
long | QueryNetworksCount (::std::string QueryCommandText) |
Returns count of virtal networks objects in sP2P index storage matched by query | |
long | QueryObjectsCount (::std::string QueryCommandText) |
Returns count of virtal objects in sP2P index storage matched by query | |
void | QueryUsers (::std::list< VUser > *result_list,::std::string QueryCommandText, int skip=0, int limit=0,::std::string ascOrderBy="",::std::string descOrderBy="") |
Quieries virtual user objects in sP2P index storage | |
void | QueryNetworks (::std::list< VNetwork > *result_list,::std::string QueryCommandText, int skip=0, int limit=0,::std::string ascOrderBy="",::std::string descOrderBy="") |
Quieries virtual network objects in sP2P index storage | |
void | QueryObjects (::std::list< VObject > *result_list,::std::string QueryCommandText, int skip=0, int limit=0,::std::string ascOrderBy="",::std::string descOrderBy="") |
Quieries virtual objects in sP2P index storage | |
void | ChangeUserPassword (Guid userUID,::std::string old_password,::std::string new_password) |
Changes virtual user object password | |
void | JoinUserToNetwork (Guid userUID, Guid networkUID) |
Joins virtual user object to virtual network object | |
void | UnJoinUserFromNetwork (Guid userUID, Guid networkUID) |
Un-Joins virtual user object from virtual network object | |
VUser | AuthenticateUser (::std::string Username,::std::string Password) |
Returns virtual user object having exact username and password | |
VUser | LogOffUser (::std::string Username) |
Updates VUser object properties on index server to indicate user is no more loged in | |
Static Public Member Functions | |
::std::string | IndexHandleFromGuid (Guid UID) |
Converts GUID to index handle string that can be used for index quieries as id : ObjectId("indexhandle") | |
Protected Member Functions | |
VNManager (Peer *localPeer, IPEndPoint IndexServerEP, int IndexIdentifikator) | |
Initializes new instance of VNManager class | |
Protected Attributes | |
Peer * | _localPeer |
IPEndPoint | _IndexServerEP |
int | _IndexIdentifikator |
Used to send commands and receive results from virtual network index server
|
protected |
sp2plib::VNManager::~VNManager | ( | ) |
Destructor.
VUser sp2plib::VNManager::AuthenticateUser | ( | ::std::string | Username, |
::std::string | Password | ||
) |
Returns virtual user object having exact username and password
Username | Username of user to return |
Password | Passwor of user to return |
void sp2plib::VNManager::ChangeUserPassword | ( | Guid | userUID, |
::std::string | old_password, | ||
::std::string | new_password | ||
) |
Changes virtual user object password
userUID | UID of virtual user object to change password |
old_password | Old passworrd, this can be also magic value: (requesterPeerUID.ToString() + ApplicationUID.ToString() + userUID.ToString()).ToLower() |
new_password | New password |
void sp2plib::VNManager::DeleteNetwork | ( | Guid | networkToDeleteUID | ) |
Deletes virtual network object form sP2P index storage
networkToDeleteUID | UID of virtual network to delete |
void sp2plib::VNManager::DeleteObject | ( | Guid | objectToDeleteUID | ) |
Deletes virtual object form sP2P index storage
objectToDeleteUID | UID of virtual object to delete |
void sp2plib::VNManager::DeleteUser | ( | Guid | userToDeleteUID | ) |
Deletes virtual user object form sP2P index storage
userToDeleteUID | UID of virtual user object to delete |
|
static |
Converts GUID to index handle string that can be used for index quieries as id : ObjectId("indexhandle")
UID | GUID to convet to index handle string |
Joins virtual user object to virtual network object
userUID | UID of user to join |
networkUID | UID of network to join to |
VUser sp2plib::VNManager::LogOffUser | ( | ::std::string | Username | ) |
Updates VUser object properties on index server to indicate user is no more loged in
Username | Username of user to log of |
void sp2plib::VNManager::QueryNetworks | ( | ::std::list< VNetwork > * | result_list, |
::std::string | QueryCommandText, | ||
int | skip = 0 , |
||
int | limit = 0 , |
||
::std::string | ascOrderBy = "" , |
||
::std::string | descOrderBy = "" |
||
) |
Quieries virtual network objects in sP2P index storage
result_list | List to fill with returned objects |
QueryCommandText | NoSQL query |
skip | Number of object to skip |
limit | Maximal number of object to return |
ascOrderBy | Comma separated of field names to sort by result ascending |
descOrderBy | Comma separated of field names to sort by result descending |
long sp2plib::VNManager::QueryNetworksCount | ( | ::std::string | QueryCommandText | ) |
Returns count of virtal networks objects in sP2P index storage matched by query
QueryCommandText | NoSQL Query |
void sp2plib::VNManager::QueryObjects | ( | ::std::list< VObject > * | result_list, |
::std::string | QueryCommandText, | ||
int | skip = 0 , |
||
int | limit = 0 , |
||
::std::string | ascOrderBy = "" , |
||
::std::string | descOrderBy = "" |
||
) |
Quieries virtual objects in sP2P index storage
result_list | List to fill with returned objects |
QueryCommandText | NoSQL query |
skip | Number of object to skip |
limit | Maximal number of object to return |
ascOrderBy | Comma separated of field names to sort by result ascending |
descOrderBy | Comma separated of field names to sort by result descending |
long sp2plib::VNManager::QueryObjectsCount | ( | ::std::string | QueryCommandText | ) |
Returns count of virtal objects in sP2P index storage matched by query
QueryCommandText | NoSQL Query |
void sp2plib::VNManager::QueryUsers | ( | ::std::list< VUser > * | result_list, |
::std::string | QueryCommandText, | ||
int | skip = 0 , |
||
int | limit = 0 , |
||
::std::string | ascOrderBy = "" , |
||
::std::string | descOrderBy = "" |
||
) |
Quieries virtual user objects in sP2P index storage
result_list | List to fill with returned objects |
QueryCommandText | NoSQL query |
skip | Number of object to skip |
limit | Maximal number of object to return |
ascOrderBy | Comma separated of field names to sort by result ascending |
descOrderBy | Comma separated of field names to sort by result descending |
long sp2plib::VNManager::QueryUsersCount | ( | ::std::string | QueryCommandText | ) |
Returns count of virtal user objects in sP2P index storage matched by query
QueryCommandText | NoSQL Query |
Creates/Updates Virtal network object in sP2P index storage
network | Virtual network object |
Creates/Updates Virtal object in sP2P index storage
obj | Virtual object |
Saves virtual user object in sP2P index storage
user | virtual user object |
user_password | user password |
Un-Joins virtual user object from virtual network object
userUID | UID of user to un-join |
networkUID | UID of network to un-join from |