14 #ifndef WS_FS_DAEMON_CLIENT_H__
15 #define WS_FS_DAEMON_CLIENT_H__
18 #include <json/json.h>
19 #include <json/reader.h>
20 #include <json/writer.h>
21 #include <json/value.h>
25 #include <boost/thread.hpp>
39 WsFsDaemonClient(
const std::string&
id,
const std::string& pass,
const std::string& ip);
70 std::string
getProperty(
const std::string& section,
const std::string& p,
const std::string& prop);
90 int getLock(
const std::string& path);
95 int putLock(
const std::string& path);
100 int isLocked(
const std::string& path, std::string& uid);
140 int renameNode(
const string& path,
const string& newPath);
145 int saveProperty(
const std::string& path,
const std::string& section,
const std::string& attr,
const std::string& val);
175 int send(
const std::string& message);
182 int receive(std::string& receivedData);
269 int parse(
const std::string& s);
int authentify()
authenticate user. Sends an auth request to the daemon
const std::string receiveProperty()
receive a property after a getProperty request
int send(const std::string &message)
sends a string to the daemon
WsFsDaemonClient(const std::string &id, const std::string &pass, const std::string &ip)
constructor
std::set< string > getAllGroups()
boost::shared_ptr< WsAbstractNode > NodePtr
WsDecompressor * m_decompressor
std::string getProperty(const std::string §ion, const std::string &p, const std::string &prop)
returns the properties of a node
NodePtr receiveAccessItems()
receive the access tree items after a getAccessRoot request
boost::mutex * m_sendMutex
int receiveAuthAnswer()
receive the answer after performing an Auth request to the daemon
int receiveInt()
receive an int after a request that returns an int
int threadUpdate()
Launch the routine that will retrieve new AccessTree from fsdaemon This method should be called in a ...
static zmq::context_t * m_context
~WsFsDaemonClient()
destructor
int receiveSuccessCode()
receive the success code after a request that returns a SUCCESS or FAILURE answer only ...
WsCompressor * m_compressor
const WsNodeProperties * receiveProperties()
receive the properties after a getProperties request
int clearServerCache()
clears the server cache (removes the ldap results cached
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...
const std::string receiveString()
receive a string after a request that returns a string
int receiveIsLockedStatus(std::string uid)
const std::string & getEmail() const
return the email of the person
std::set< string > receiveAllGroups()
receive all the groups after a getAllGroups() request
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 a...
int parse(const std::string &s)
parse the received Json from the fsdaemon
int putLock(const std::string &path)
int getLock(const std::string &path)
std::string rawDataToString(zmq::message_t &msg)
Converts raw data received to string. This method should be used each time data is received from netw...
const std::string & getFirstName() const
return the name of the person
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.
int load()
loads the user info
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...
boost::thread * m_updateThread
const std::string & getSurname() const
return the surname of the person
int receive(std::string &receivedData)
receive a string from the daemon.
WsGlobalProperties * m_conf
std::vector< std::string > getTemplatesList(const std::string &path)
std::string m_accessTreeStamp
vector< WsResultItem > getSearchResults(const std::string &terms)
search for all matching results of terms using WsSearch class
NodePtr getAccessRoot(const bool &forceUpdate=false)
return the root node of the access tree starting from the root
Interface between the User class and the fsdaemon.
const WsNodeProperties * getProperties(const std::string &p)
Abstract Interface between the WsUser class and the operation on the tree.
int receivePermissions()
receive the answer of a permission request
std::string m_menuTreeStamp
bool receiveBoolean()
receive a Boolean after a request that returns a boolean
const std::string getRootPath()
return the root path of the filesystem tree, example : /var/www/demo_site
int isLocked(const std::string &path, std::string &uid)
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 mo...
vector< WsResultItem > receiveSearchResults()
receive the search results after a getSearchResults() request
int getPermissions(const std::string &p)
Load infos of the user.