OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
SessionService Class Reference

#include "SessionService.h"

Inheritance diagram for SessionService:
ot::ActionHandler

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.
 
SessioncreateSession (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.
 
SessiongetSession (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)
 
ServicegetServiceFromURL (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 ()
 
ActionHandleroperator= (const ActionHandler &_other)=default
 
ActionHandleroperator= (ActionHandler &&_other)=default
 

Static Public Member Functions

static SessionServiceinstance (void)
 

Constructor & Destructor Documentation

◆ SessionService()

SessionService::SessionService ( )

◆ ~SessionService()

virtual SessionService::~SessionService ( )
inlinevirtual

Member Function Documentation

◆ createSession()

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.

Parameters
_sessionIDThe ID of the new session (must be unique)
_userNameThe name of the user that started this session
_projectNameThe namne of the project used in this session
_collectionNameThe name of the collection used in this session
_sessionTypeThe type of the session
_runMandatoryServicesIf true, all mandatory services for the specified session type will be started

◆ dataBaseURL()

const std::string & SessionService::dataBaseURL ( void ) const
inline

Will return the database IP.

◆ forgetSession()

void SessionService::forgetSession ( Session * _session)

Removes the session from the service run starter and all maps.

◆ getServiceFromURL()

Service * SessionService::getServiceFromURL ( const std::string & _url)

◆ getSession()

Session * SessionService::getSession ( const std::string & _sessionID)

Returns the session with the specified id.

Parameters
_sessionIDThe ID of the session to get
_throwExceptionIf true, exceptions will be thrown, otherwise a nullptr will be returned
Exceptions
std::exceptionif the specified session ID is invalid

◆ id()

ot::serviceID_t SessionService::id ( void ) const
inline

◆ initializeSystemInformation()

void SessionService::initializeSystemInformation ( )

Initialize the collection of system information (e.g. CPU time and memory).

◆ instance()

SessionService * SessionService::instance ( void )
static

◆ ip()

const std::string & SessionService::ip ( void ) const
inline

◆ isServiceInDebugMode()

bool SessionService::isServiceInDebugMode ( const std::string & _serviceName)

Will return true if the provided service is in debug mode.

◆ port()

const std::string & SessionService::port ( void ) const
inline

◆ removeSession()

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.

Parameters
_sessionThe session to remove

◆ runMandatoryServices() [1/2]

bool SessionService::runMandatoryServices ( const std::string & _sessionID)

Will ensure that all mandatory services for the specified session are running.

Parameters
_sessionIDThe ID of the session

◆ runMandatoryServices() [2/2]

bool SessionService::runMandatoryServices ( Session * _session)

Will ensure that all mandatory services for the specified session are running.

Parameters
_sessionThe session

◆ runRelayService()

bool SessionService::runRelayService ( Session * _session,
std::string & _websocketURL,
std::string & _serviceURL )

◆ runServiceInDebug()

bool SessionService::runServiceInDebug ( const std::string & _serviceName,
const std::string & _serviceType,
Session * _session,
std::string & _serviceURL )

◆ serviceAuthorisationURL()

const std::string & SessionService::serviceAuthorisationURL ( void ) const
inline

Will return the session service service directory IP.

◆ serviceClosing()

void SessionService::serviceClosing ( Service * _service,
bool _notifyOthers,
bool _autoCloseSessionIfMandatory = true )

Will close the service and deregister it from its session.

◆ sessions()

std::list< const Session * > SessionService::sessions ( void )

◆ setAuthorisationServiceURL()

void SessionService::setAuthorisationServiceURL ( const std::string & _url)
inline

Will set the authorisation service IP.

Parameters
_ipThe IP to set

◆ setDataBaseURL()

void SessionService::setDataBaseURL ( const std::string & _url)
inline

Will set the database IP.

Parameters
_ipThe IP to set

◆ setGlobalDirectoryServiceURL()

void SessionService::setGlobalDirectoryServiceURL ( const std::string & _url)

◆ setGlobalSessionService()

void SessionService::setGlobalSessionService ( GlobalSessionService * _gss)
inline

◆ setId()

void SessionService::setId ( ot::serviceID_t _id)
inline

◆ setIp()

void SessionService::setIp ( const std::string & _ip)
inline

◆ setPort()

void SessionService::setPort ( const std::string & _port)

◆ setSiteID()

void SessionService::setSiteID ( std::string _ID)
inline

Will set the site ID.

Parameters
_IDThe ID to set

◆ siteID()

const std::string & SessionService::siteID ( void ) const
inline

Will return the session service site ID.

◆ updateLogMode()

void SessionService::updateLogMode ( const ot::LogModeManager & _newData)

◆ url()

std::string SessionService::url ( void ) const
inline

The documentation for this class was generated from the following files: