14 #ifndef WS_FSDAEMON_H__
15 #define WS_FSDAEMON_H__
26 #include <json/json.h>
27 #include <json/reader.h>
28 #include <json/writer.h>
29 #include <json/value.h>
31 #include <boost/lexical_cast.hpp>
256 bool isActiveSession(
const std::string& uid,
const std::string& pass,
const std::string& ip);
DaemonStatus handlePermRequest(zmq::socket_t &sock, Json::Value &root)
sends the permissions of a path to the client
DaemonStatus bind(unsigned int numWorkers=1)
start listening on the port
WsGlobalProperties * m_conf
map< string, WsUserSession * > m_userMap
DaemonStatus handleRenameNodeRequest(zmq::socket_t &sock, Json::Value &root)
rename a node
string rawDataToString(zmq::message_t &msg)
converts raw data received on the socket to string
DaemonStatus parse(const std::string &s, Json::Value &root)
Parses the received data (json)
DaemonStatus handleCreateNodeRequest(zmq::socket_t &sock, Json::Value &root)
create a node requested by the client
bool isActiveSession(const std::string &uid, const std::string &pass, const std::string &ip)
returns true or false whether the section of a user is still active or not
WsDecompressor * m_decompressor
Redirect operations to adequate class.
DaemonStatus handleSavePropertiesRequest(zmq::socket_t &sock, Json::Value &root)
saves the properties received by the client for a node
DaemonStatus receive(zmq::socket_t &sock, std::string &receivedData)
read data from the socket
WsFsTreeOperations * m_operation
DaemonStatus handleIsLockedRequest(zmq::socket_t &sock, Json::Value &root)
checks the lock for the path
Main class of the FsDaemon.
zmq::context_t * m_context
DaemonStatus send(zmq::socket_t &sock, const std::string &s)
Sends data on the socket.
DaemonStatus handleSavePropertyRequest(zmq::socket_t &sock, Json::Value &root)
saves one property received by a client for a node
DaemonStatus handlePropsRequest(zmq::socket_t &sock, Json::Value &root)
sends all the properties of a node
DaemonStatus handleGetTreeVersion(zmq::socket_t &sock, Json::Value &root)
sends the last tree version to the client
DaemonStatus handlePutLockRequest(zmq::socket_t &sock, Json::Value &root)
releases the lock for the path
WsFsDaemon(WsGlobalProperties *props)
constructor for the server
DaemonStatus handleGetLockRequest(zmq::socket_t &sock, Json::Value &root)
Acquires the lock for the path.
DaemonStatus handlePropRequest(zmq::socket_t &sock, Json::Value &root)
sends a property of a node to the client
WsCompressor * m_compressor
DaemonStatus handleAuthRequest(zmq::socket_t &sock, Json::Value &root)
Authenticate user on server Loads the groups which the user belongs to, uid, email, etc..
set< string > m_allGroups
DaemonStatus handleAccessTreeRequest(zmq::socket_t &sock, Json::Value &root)
Sends the accesstree to the client.
Structure representing all the fs tree from the root.
DaemonStatus handleRootPathRequest(zmq::socket_t &sock, Json::Value &root)
send the rootPath to the client
DaemonStatus workerRoutine()
Updates the tree and takes care of unconsistencies with the user.
DaemonStatus handleIsAdminRequest(zmq::socket_t &sock, Json::Value &root)
sends the result of an admin request so that the client can know if he is an admin or not ...
DaemonStatus handleClearCache(zmq::socket_t &sock, Json::Value &root)
clears the user from the cache
DaemonStatus handleSearchRequest(zmq::socket_t &sock, Json::Value &root)
sends the result of a search request to the client. Only nodes where the user has access are returned...
DaemonStatus handleAllGroupsRequest(zmq::socket_t &sock, Json::Value &root)
sends all the groups available to the client
DaemonStatus handleRequest(zmq::socket_t &sock, Json::Value &root)
Handle received request and redirect to correct method.
DaemonStatus handleIsEditorRequest(zmq::socket_t &sock, Json::Value &root)
sends the result of an editor request so that the client can know if he is an editor or not ...
DaemonStatus handleDeleteNodeRequest(zmq::socket_t &sock, Json::Value &root)
delete a node requested by the client