Remoto - VFS: VFS_tcp_export_sessionManager.h Source File
Remoto - VFS
VFS_tcp_export_sessionManager.h
Go to the documentation of this file.
1 #ifndef VFS_TCP_EXPORT_SESSIONMANAGER_H
2 #define VFS_TCP_EXPORT_SESSIONMANAGER_H
3 
4 #include "VFS_auth/VFS_session.h"
6 
7 class VFS_tcp_export_sessionManager : public QObject
8 {
9  Q_OBJECT
10 
11  public:
12  static VFS_session *fetchSession(QString id);
13  static bool requestSession(QString id, VFS_tcp_export_client *client);
14  static bool registerSession(QString id, VFS_session *session);
15 
16  private:
17  static QMutex _lock;
18  static QMap<QString, VFS_session*> _sessions;
19  static QMap<QString, bool> _requests;
21 
22  private slots:
23  void expireSession(bool);
24 };
25 
26 #endif // VFS_TCP_EXPORT_SESSIONMANAGER_H
The VFS_session object represents a single session.
Definition: VFS_session.h:14
The socket client created by VFS_tcp_export.
A static class coupled with VFS_tcp_export_client for managing sessions.
static VFS_tcp_export_sessionManager _instance
A static instance of this class, used to receive expirations.
static QMutex _lock
A mutex for locking _sessions.
static QMap< QString, bool > _requests
Sessions which are currently under request.
static QMap< QString, VFS_session * > _sessions
The sessions registered to this node.
static bool registerSession(QString id, VFS_session *session)
Register a session with the session registry.
static VFS_session * fetchSession(QString id)
Fetch a session by id.
void expireSession(bool)
A session has expired.
static bool requestSession(QString id, VFS_tcp_export_client *client)
Request a session by id from a given VFS_tcp_export_client.