#include "SessionService.h"
Public Member Functions | |
| SessionService () | |
| virtual | ~SessionService () |
| void | setIp (const std::string &_ip) |
| const std::string & | ip (void) const |
| void | setPort (const std::string &_port) |
| const std::string & | port (void) const |
| void | setId (ot::serviceID_t _id) |
| ot::serviceID_t | id (void) const |
| std::string | url (void) const |
| void | setDataBaseURL (const std::string &_url) |
| Will set the database IP. | |
| const std::string & | dataBaseURL (void) const |
| Will return the database IP. | |
| void | setSiteID (std::string _ID) |
| Will set the site ID. | |
| const std::string & | siteID (void) const |
| Will return the session service site ID. | |
| void | setAuthorisationServiceURL (const std::string &_url) |
| Will set the authorisation service IP. | |
| const std::string & | serviceAuthorisationURL (void) const |
| Will return the session service service directory IP. | |
| void | setGlobalDirectoryServiceURL (const std::string &_url) |
| bool | isServiceInDebugMode (const std::string &_serviceName) |
| Will return true if the provided service is in debug mode. | |
| Session * | createSession (const std::string &_sessionID, const std::string &_userName, const std::string &_projectName, const std::string &_collectionName, const std::string &_sessionType) |
| Will create a new session with the provided session information Will return a pointer to the new session, the session is stored in the sessionService. | |
| Session * | getSession (const std::string &_sessionID) |
| Returns the session with the specified id. | |
| bool | runMandatoryServices (const std::string &_sessionID) |
| Will ensure that all mandatory services for the specified session are running. | |
| bool | runMandatoryServices (Session *_session) |
| Will ensure that all mandatory services for the specified session are running. | |
| void | serviceClosing (Service *_service, bool _notifyOthers, bool _autoCloseSessionIfMandatory=true) |
| Will close the service and deregister it from its session. | |
| void | removeSession (Session *_session) |
| Will remove the session and close its logger. Will NOT perform the session shutdown(). Will clear the memory of the provided pointer. | |
| void | forgetSession (Session *_session) |
| Removes the session from the service run starter and all maps. | |
| std::list< const Session * > | sessions (void) |
| bool | runServiceInDebug (const std::string &_serviceName, const std::string &_serviceType, Session *_session, std::string &_serviceURL) |
| bool | runRelayService (Session *_session, std::string &_websocketURL, std::string &_serviceURL) |
| void | setGlobalSessionService (GlobalSessionService *_gss) |
| Service * | getServiceFromURL (const std::string &_url) |
| void | initializeSystemInformation () |
| Initialize the collection of system information (e.g. CPU time and memory). | |
| void | updateLogMode (const ot::LogModeManager &_newData) |
Public Member Functions inherited from ot::ActionHandler | |
| ActionHandler () | |
| ActionHandler (const ActionHandler &_other)=default | |
| ActionHandler (ActionHandler &&_other)=default | |
| virtual | ~ActionHandler () |
| ActionHandler & | operator= (const ActionHandler &_other)=default |
| ActionHandler & | operator= (ActionHandler &&_other)=default |
Static Public Member Functions | |
| static SessionService * | instance (void) |
| SessionService::SessionService | ( | ) |
|
inlinevirtual |
| Session * SessionService::createSession | ( | const std::string & | _sessionID, |
| const std::string & | _userName, | ||
| const std::string & | _projectName, | ||
| const std::string & | _collectionName, | ||
| const std::string & | _sessionType ) |
Will create a new session with the provided session information Will return a pointer to the new session, the session is stored in the sessionService.
| _sessionID | The ID of the new session (must be unique) |
| _userName | The name of the user that started this session |
| _projectName | The namne of the project used in this session |
| _collectionName | The name of the collection used in this session |
| _sessionType | The type of the session |
| _runMandatoryServices | If true, all mandatory services for the specified session type will be started |
|
inline |
Will return the database IP.
| void SessionService::forgetSession | ( | Session * | _session | ) |
Removes the session from the service run starter and all maps.
| Service * SessionService::getServiceFromURL | ( | const std::string & | _url | ) |
| Session * SessionService::getSession | ( | const std::string & | _sessionID | ) |
Returns the session with the specified id.
| _sessionID | The ID of the session to get |
| _throwException | If true, exceptions will be thrown, otherwise a nullptr will be returned |
| std::exception | if the specified session ID is invalid |
|
inline |
| void SessionService::initializeSystemInformation | ( | ) |
Initialize the collection of system information (e.g. CPU time and memory).
|
static |
|
inline |
| bool SessionService::isServiceInDebugMode | ( | const std::string & | _serviceName | ) |
Will return true if the provided service is in debug mode.
|
inline |
| void SessionService::removeSession | ( | Session * | _session | ) |
Will remove the session and close its logger. Will NOT perform the session shutdown(). Will clear the memory of the provided pointer.
| _session | The session to remove |
| bool SessionService::runMandatoryServices | ( | const std::string & | _sessionID | ) |
Will ensure that all mandatory services for the specified session are running.
| _sessionID | The ID of the session |
| bool SessionService::runMandatoryServices | ( | Session * | _session | ) |
Will ensure that all mandatory services for the specified session are running.
| _session | The session |
| bool SessionService::runRelayService | ( | Session * | _session, |
| std::string & | _websocketURL, | ||
| std::string & | _serviceURL ) |
| bool SessionService::runServiceInDebug | ( | const std::string & | _serviceName, |
| const std::string & | _serviceType, | ||
| Session * | _session, | ||
| std::string & | _serviceURL ) |
|
inline |
Will return the session service service directory IP.
| void SessionService::serviceClosing | ( | Service * | _service, |
| bool | _notifyOthers, | ||
| bool | _autoCloseSessionIfMandatory = true ) |
Will close the service and deregister it from its session.
| std::list< const Session * > SessionService::sessions | ( | void | ) |
|
inline |
Will set the authorisation service IP.
| _ip | The IP to set |
|
inline |
Will set the database IP.
| _ip | The IP to set |
| void SessionService::setGlobalDirectoryServiceURL | ( | const std::string & | _url | ) |
|
inline |
|
inline |
|
inline |
| void SessionService::setPort | ( | const std::string & | _port | ) |
|
inline |
Will set the site ID.
| _ID | The ID to set |
|
inline |
Will return the session service site ID.
| void SessionService::updateLogMode | ( | const ot::LogModeManager & | _newData | ) |
|
inline |