35#include <libthreadar/libthreadar.hpp>
38#include "user_interface.hpp"
64 bool has_waiting_threads()
const {
return lock_wui.waiting_thread(); };
65 bool has_working_server()
const {
return lock_wui.working_thread(); };
66 std::string get_session_ID()
const {
return session_ID; };
67 bool disconnection_requested()
const;
71 virtual void on_event(
const std::string & event_name)
override;
111 static bool get_session_info(
const std::string & session_ID, session_summary & val);
144 void set_session_id(
const std::string & sessid);
146 libthreadar::semaphore lock_wui;
149 std::string session_ID;
151 void check_caller()
const;
163 unsigned int ref_given;
165 void clear() { owner =
"";
reference =
nullptr; ref_given = 0; closing =
false; };
168 static libthreadar::mutex lock_running;
169 static std::map<std::string, table> running_session;
170 static session_summary publish(std::map<std::string, table>::iterator it);
171 static std::string create_new(
const std::string & owner);
class of object that are pointed/triggered to by others
Definition: actor.hpp:55
class answer provides easy means to set an HTTP answer and means to sent it back to a proto_connexion...
Definition: answer.hpp:49
class reference gives a mean to link objects by a peering method
Definition: reference.hpp:47
reference()
usual constructor
Definition: reference.hpp:51
class holding fields of an HTTP request (method, URI, header, cookies, and so on)
Definition: request.hpp:45
pure virtual class, base class for all classes that can generate an answer to a request
Definition: responder.hpp:46
class session - holds information about a current user session
Definition: session.hpp:51
static unsigned int get_num_session()
get the total number of session (all users)
Definition: session.cpp:101
virtual void on_event(const std::string &event_name) override
inherited from actor parent class
Definition: session.cpp:86
static session * acquire_session(const std::string &session_ID)
acquire the excusivity use of the session which id is provided in argument
Definition: session.cpp:263
static bool get_session_info(const std::string &session_ID, session_summary &val)
get a summary description of the session known from its session_ID
Definition: session.cpp:174
static std::vector< session_summary > get_summary()
get a summary description vector of all sessions
Definition: session.cpp:145
virtual answer give_answer(const request &req) override
inherited from responder
Definition: session.cpp:74
static bool close_session(const std::string &session_ID)
request the session to be tear down and destoyed
Definition: session.cpp:340
static bool create_new_session(const std::string &user, bool initial, const request &req, answer &ret)
create a new session
Definition: session.cpp:410
static void release_session(session *sess)
release the session object from our exclusive access
Definition: session.cpp:298
main webdar html components that defines for a given session the type of output (config pages,...
Definition: user_interface.hpp:68
summary information of sessions
Definition: session.hpp:80
std::string session_name
name given to that session by the user
Definition: session.hpp:83
std::string session_ID
session ID: internal unique identifier for that session
Definition: session.hpp:82
std::string owner
owner of the session
Definition: session.hpp:81
bool closing
whether the session is pending for closure
Definition: session.hpp:86
bool libdar_running
whether a libdar job is running
Definition: session.hpp:85
bool locked
whether the session is locked by a thread
Definition: session.hpp:84