1 #ifndef VFS_SESSIONMANAGER_H
2 #define VFS_SESSIONMANAGER_H
58 Q_INVOKABLE
explicit VFS_sessionManager(QString cwd, QString userdata, qint64 ttl, QString tokendata=
"", QString developerGroup=
"",
double pruneProbability=0.1);
67 virtual QByteArray
icon();
VFS_node is the base class from which all other VFS_node classes derive.
The base class for all requests between nodes.
VFS_sessionManager manages connected clients and their session data.
VFS_sessionTokenPruner _pruner
Our pruner.
QString _cwd
The VFS path of this node.
virtual void receiveResponse(VFS_request *t)
VFS_sessionManager::receiveResponse.
Q_INVOKABLE VFS_sessionManager(QString cwd, QString userdata, qint64 ttl, QString tokendata="", QString developerGroup="", double pruneProbability=0.1)
Create a session node, whose job is to return session data for a user.
qint64 _ttl
Number of seconds for sessions to live once created (time to live)
virtual void read(VFS_request *r)
Read from the sessionManager.
QString _tokendata
A VFS path to store session tokens.
virtual VFS_node * find(VFS_request *r)
Find a node using a VFS_request.
VFS_node * _sessions
A VFS_node to hold current sessions.
double _pruneProbability
The probability that a prune will happen.
virtual void write(VFS_request *r)
Write to the session manager to create a session.
QString _userdata
A VFS path to store user data.
QString _developerGroup
Name of the group used for development mode. Members of this group will have additional preferences a...
QString generateAuthtoken()
Generate a new unique authtoken for this session.
virtual QByteArray icon()
Return the user icon from VFS_icons.
virtual ~VFS_sessionManager()
virtual QString getCWD()
Return the manager's _cwd value.
virtual QString reportDetails()
Return information about any current sessions.
void pruneTokens()
Run a session token prune on a separate thread.
VFS_sessionTokenPruner(QString path)
Create a VFS_sessionTokenPruner.
void pruneEntry(QString p)
Request to remove a token entry.
virtual void receiveResponse(VFS_request *t)
Receive a response on a pruner request.
QString _path
The VFS path to prune.
QStringList _pathList
The list of paths remaining to check.
bool checkEntry(QJsonObject e)
Check a token entry for validity.
bool running()
Return the _running state of the pruner.
void stop()
Stop the prune operation if it is running.
virtual ~VFS_sessionTokenPruner()
Destroy the pruner.
void peel()
Remove a path from the stack or stop processing if empty.
bool run()
Attempt to run the prune operation.
bool _running
The running state of the pruner.