Wittyshare
0.2
|
Interface between the User class and the fsdaemon. More...
#include <WsFsDaemonClient.h>
Public Member Functions | |
WsFsDaemonClient (const std::string &id, const std::string &pass, const std::string &ip) | |
constructor More... | |
~WsFsDaemonClient () | |
destructor More... | |
int | clearServerCache () |
clears the server cache (removes the ldap results cached More... | |
int | load () |
loads the user info More... | |
int | getPermissions (const std::string &p) |
Load infos of the user. More... | |
const WsNodeProperties * | getProperties (const std::string &p) |
std::string | getProperty (const std::string §ion, const std::string &p, const std::string &prop) |
returns the properties of a node More... | |
const std::string & | getSurname () const |
return the surname of the person More... | |
const std::string & | getFirstName () const |
return the name of the person More... | |
const std::string & | getEmail () const |
return the email of the person More... | |
int | getLock (const std::string &path) |
int | putLock (const std::string &path) |
int | isLocked (const std::string &path, std::string &uid) |
NodePtr | getAccessRoot (const bool &forceUpdate=false) |
return the root node of the access tree starting from the root More... | |
vector< WsResultItem > | getSearchResults (const std::string &terms) |
search for all matching results of terms using WsSearch class More... | |
std::set< string > | getAllGroups () |
const std::string | getRootPath () |
return the root path of the filesystem tree, example : /var/www/demo_site More... | |
int | saveProperties (WsNodeProperties *props, const std::string &path) |
save the properties of the node on disk. The user must have access and edit rights for the node. More... | |
int | createNode (const string &path, int type) |
create a directory or File. If the node is a WsDirNode than it will be only accessible to the Admin and the editor who created the node More... | |
int | deleteNode (const string &path) |
delete a node. The user must be an Admin on editor to remove the node In case of a WsDirNode, all the contents of the directory and the directory will be deleted More... | |
int | renameNode (const string &path, const string &newPath) |
renames a node In case of a WsDirNode, all the contents of the directory and the directory will be moved More... | |
int | saveProperty (const std::string &path, const std::string §ion, const std::string &attr, const std::string &val) |
sets one property of the node and save it on disk. More... | |
bool | isEditor () |
bool | isAdministrator () |
std::vector< std::string > | getTemplatesList (const std::string &path) |
Private Member Functions | |
int | authentify () |
authenticate user. Sends an auth request to the daemon More... | |
int | send (const std::string &message) |
sends a string to the daemon More... | |
int | receive (std::string &receivedData) |
receive a string from the daemon. More... | |
int | receiveAuthAnswer () |
receive the answer after performing an Auth request to the daemon More... | |
int | receiveSuccessCode () |
receive the success code after a request that returns a SUCCESS or FAILURE answer only More... | |
int | receivePermissions () |
receive the answer of a permission request More... | |
bool | receiveBoolean () |
receive a Boolean after a request that returns a boolean More... | |
int | receiveInt () |
receive an int after a request that returns an int More... | |
const std::string | receiveString () |
receive a string after a request that returns a string More... | |
const WsNodeProperties * | receiveProperties () |
receive the properties after a getProperties request More... | |
const std::string | receiveProperty () |
receive a property after a getProperty request More... | |
NodePtr | receiveAccessItems () |
receive the access tree items after a getAccessRoot request More... | |
vector< WsResultItem > | receiveSearchResults () |
receive the search results after a getSearchResults() request More... | |
int | receiveIsLockedStatus (std::string uid) |
std::set< string > | receiveAllGroups () |
receive all the groups after a getAllGroups() request More... | |
std::string | rawDataToString (zmq::message_t &msg) |
Converts raw data received to string. This method should be used each time data is received from network to decode it and be sure everything has been read. More... | |
int | parse (const std::string &s) |
parse the received Json from the fsdaemon More... | |
int | threadUpdate () |
Launch the routine that will retrieve new AccessTree from fsdaemon This method should be called in a different thread. More... | |
Private Attributes | |
std::string | m_uid |
std::string | m_pass |
std::string | m_ip |
std::string | m_email |
std::string | m_name |
std::string | m_surname |
std::string | m_host |
std::string | m_port |
std::string | m_proto |
WsGlobalProperties * | m_conf |
Json::Reader | m_reader |
Json::Value | m_root |
bool | m_compress |
NodePtr | m_accessRoot |
NodePtr | m_menuRoot |
std::string | m_accessTreeStamp |
std::string | m_menuTreeStamp |
std::string | m_rootPath |
int | m_isAdmin |
int | m_isEditor |
bool | m_listen |
zmq::socket_t * | m_sock |
WsCompressor * | m_compressor |
WsDecompressor * | m_decompressor |
boost::mutex * | m_sendMutex |
boost::thread * | m_updateThread |
Static Private Attributes | |
static zmq::context_t * | m_context = 0 |
Interface between the User class and the fsdaemon.
Used dynamcally when using FsDaemon
Definition at line 33 of file WsFsDaemonClient.h.
WsFsDaemonClient::WsFsDaemonClient | ( | const std::string & | id, |
const std::string & | pass, | ||
const std::string & | ip | ||
) |
WsFsDaemonClient::~WsFsDaemonClient | ( | ) |
destructor
Definition at line 53 of file WsFsDaemonClient.cpp.
|
private |
authenticate user. Sends an auth request to the daemon
Definition at line 113 of file WsFsDaemonClient.cpp.
int WsFsDaemonClient::clearServerCache | ( | ) |
clears the server cache (removes the ldap results cached
Definition at line 242 of file WsFsDaemonClient.cpp.
|
virtual |
create a directory or File. If the node is a WsDirNode than it will be only accessible to the Admin and the editor who created the node
path | the relative path starting from root |
type | a NodeType enum { File, Directory } |
Implements WsAbstractFsClient.
Definition at line 598 of file WsFsDaemonClient.cpp.
|
virtual |
delete a node. The user must be an Admin on editor to remove the node In case of a WsDirNode, all the contents of the directory and the directory will be deleted
path | the path to the node |
Implements WsAbstractFsClient.
Definition at line 617 of file WsFsDaemonClient.cpp.
|
virtual |
return the root node of the access tree starting from the root
Implements WsAbstractFsClient.
Definition at line 295 of file WsFsDaemonClient.cpp.
|
virtual |
Implements WsAbstractFsClient.
Definition at line 556 of file WsFsDaemonClient.cpp.
|
virtual |
return the email of the person
Implements WsAbstractFsClient.
Definition at line 537 of file WsFsDaemonClient.cpp.
|
virtual |
return the name of the person
Implements WsAbstractFsClient.
Definition at line 532 of file WsFsDaemonClient.cpp.
|
virtual |
Implements WsAbstractFsClient.
Definition at line 256 of file WsFsDaemonClient.cpp.
|
virtual |
Load infos of the user.
Loads the name, surname, email, groups ..
Implements WsAbstractFsClient.
Definition at line 482 of file WsFsDaemonClient.cpp.
|
virtual |
Implements WsAbstractFsClient.
Definition at line 495 of file WsFsDaemonClient.cpp.
|
virtual |
returns the properties of a node
p | the path to the node |
Implements WsAbstractFsClient.
Definition at line 510 of file WsFsDaemonClient.cpp.
|
virtual |
return the root path of the filesystem tree, example : /var/www/demo_site
Implements WsAbstractFsClient.
Definition at line 310 of file WsFsDaemonClient.cpp.
|
virtual |
search for all matching results of terms using WsSearch class
terms | the terms to match results where found or if an error occured during the process. |
Implements WsAbstractFsClient.
Definition at line 542 of file WsFsDaemonClient.cpp.
|
virtual |
return the surname of the person
Implements WsAbstractFsClient.
Definition at line 527 of file WsFsDaemonClient.cpp.
|
virtual |
Implements WsAbstractFsClient.
Definition at line 683 of file WsFsDaemonClient.cpp.
|
virtual |
Implements WsAbstractFsClient.
Definition at line 667 of file WsFsDaemonClient.cpp.
|
virtual |
Implements WsAbstractFsClient.
Definition at line 651 of file WsFsDaemonClient.cpp.
|
virtual |
Implements WsAbstractFsClient.
Definition at line 269 of file WsFsDaemonClient.cpp.
|
virtual |
loads the user info
Implements WsAbstractFsClient.
Definition at line 84 of file WsFsDaemonClient.cpp.
|
private |
parse the received Json from the fsdaemon
s | the received string from the fsdaemon |
Definition at line 222 of file WsFsDaemonClient.cpp.
|
virtual |
Implements WsAbstractFsClient.
Definition at line 282 of file WsFsDaemonClient.cpp.
|
private |
Converts raw data received to string. This method should be used each time data is received from network to decode it and be sure everything has been read.
msg | the zmq::message_t receveived from the network |
Definition at line 689 of file WsFsDaemonClient.cpp.
|
private |
receive a string from the daemon.
receivedData | a string where will be stored the received input |
Definition at line 129 of file WsFsDaemonClient.cpp.
|
private |
receive the access tree items after a getAccessRoot request
Definition at line 326 of file WsFsDaemonClient.cpp.
|
private |
receive all the groups after a getAllGroups() request
Definition at line 431 of file WsFsDaemonClient.cpp.
|
private |
receive the answer after performing an Auth request to the daemon
Definition at line 194 of file WsFsDaemonClient.cpp.
|
private |
receive a Boolean after a request that returns a boolean
Definition at line 443 of file WsFsDaemonClient.cpp.
|
private |
receive an int after a request that returns an int
Definition at line 454 of file WsFsDaemonClient.cpp.
|
private |
Definition at line 418 of file WsFsDaemonClient.cpp.
|
private |
receive the answer of a permission request
Definition at line 346 of file WsFsDaemonClient.cpp.
|
private |
receive the properties after a getProperties request
Definition at line 364 of file WsFsDaemonClient.cpp.
|
private |
receive a property after a getProperty request
Definition at line 380 of file WsFsDaemonClient.cpp.
|
private |
receive the search results after a getSearchResults() request
Definition at line 392 of file WsFsDaemonClient.cpp.
|
private |
receive a string after a request that returns a string
Definition at line 469 of file WsFsDaemonClient.cpp.
|
private |
receive the success code after a request that returns a SUCCESS or FAILURE answer only
Definition at line 231 of file WsFsDaemonClient.cpp.
|
virtual |
renames a node In case of a WsDirNode, all the contents of the directory and the directory will be moved
path | the path to the node from the root |
newPath | new path from the root |
Implements WsAbstractFsClient.
Definition at line 634 of file WsFsDaemonClient.cpp.
|
virtual |
save the properties of the node on disk. The user must have access and edit rights for the node.
props | the properties to save |
path | the path to the node (relative path) |
Implements WsAbstractFsClient.
Definition at line 568 of file WsFsDaemonClient.cpp.
|
virtual |
sets one property of the node and save it on disk.
path | the path to the node (relative path) |
section | the section of the property |
attr | the key of the property |
val | the value to set |
Implements WsAbstractFsClient.
Definition at line 582 of file WsFsDaemonClient.cpp.
|
private |
sends a string to the daemon
message | the string to send |
Definition at line 144 of file WsFsDaemonClient.cpp.
|
private |
Launch the routine that will retrieve new AccessTree from fsdaemon This method should be called in a different thread.
Definition at line 698 of file WsFsDaemonClient.cpp.
|
private |
Definition at line 292 of file WsFsDaemonClient.h.
|
private |
Definition at line 294 of file WsFsDaemonClient.h.
|
private |
Definition at line 291 of file WsFsDaemonClient.h.
|
private |
Definition at line 302 of file WsFsDaemonClient.h.
|
private |
Definition at line 287 of file WsFsDaemonClient.h.
|
staticprivate |
Definition at line 304 of file WsFsDaemonClient.h.
|
private |
Definition at line 303 of file WsFsDaemonClient.h.
|
private |
Definition at line 280 of file WsFsDaemonClient.h.
|
private |
Definition at line 284 of file WsFsDaemonClient.h.
|
private |
Definition at line 279 of file WsFsDaemonClient.h.
|
private |
Definition at line 297 of file WsFsDaemonClient.h.
|
private |
Definition at line 298 of file WsFsDaemonClient.h.
|
private |
Definition at line 300 of file WsFsDaemonClient.h.
|
private |
Definition at line 293 of file WsFsDaemonClient.h.
|
private |
Definition at line 295 of file WsFsDaemonClient.h.
|
private |
Definition at line 281 of file WsFsDaemonClient.h.
|
private |
Definition at line 278 of file WsFsDaemonClient.h.
|
private |
Definition at line 285 of file WsFsDaemonClient.h.
|
private |
Definition at line 286 of file WsFsDaemonClient.h.
|
private |
Definition at line 288 of file WsFsDaemonClient.h.
|
private |
Definition at line 289 of file WsFsDaemonClient.h.
|
private |
Definition at line 296 of file WsFsDaemonClient.h.
|
private |
Definition at line 305 of file WsFsDaemonClient.h.
|
private |
Definition at line 301 of file WsFsDaemonClient.h.
|
private |
Definition at line 282 of file WsFsDaemonClient.h.
|
private |
Definition at line 277 of file WsFsDaemonClient.h.
|
private |
Definition at line 306 of file WsFsDaemonClient.h.