OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::intern::ExternalServicesComponent Class Reference

This is the main class interacting with external services. Use the static instance() function to get the global component that should be used in this service. More...

#include "ExternalServicesComponent.h"

Inheritance diagram for ot::intern::ExternalServicesComponent:
ot::ActionHandler

Public Types

enum  ComponentState { WaitForStartup , WaitForInit , Ready }
 

Public Member Functions

int startup (ApplicationBase *_application, const std::string &_localDirectoryServiceURL, const std::string &_ownURL)
 
std::string init (const std::string &_sessionServiceURL, const std::string &_sessionID)
 Will initialize the service.
 
std::string initDebugExplicit (const std::string &_sessionServiceURL, const std::string &_sessionID)
 
std::string dispatchAction (const std::string &_json, const std::string &_sender, ot::MessageType _messageType)
 Will perform the provided action.
 
void shutdown (bool _requestedAsCommand)
 Will shutdown the service.
 
ApplicationBaseapplication (void) const
 Will return the application.
 
ComponentState componentState (void) const
 
void updateSettingsFromDataBase (PropertyGridCfg &_config)
 
void getCPUAndMemoryLoad (double &globalCPULoad, double &globalMemoryLoad, double &processCPULoad, double &processMemoryLoad)
 Tell the current cpu and memory load in percent.
 
std::string handleGetSystemInformation ()
 
std::string getLoggedInUserName (void)
 
std::string getLoggedInUserPassword (void)
 
- 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 ExternalServicesComponentinstance (void)
 Will return the global instance of this component since it should exist only once in the service.
 

Private Member Functions

virtual ~ExternalServicesComponent ()
 

Detailed Description

This is the main class interacting with external services. Use the static instance() function to get the global component that should be used in this service.

Member Enumeration Documentation

◆ ComponentState

Enumerator
WaitForStartup 
WaitForInit 
Ready 

Member Function Documentation

◆ application()

ApplicationBase * ot::intern::ExternalServicesComponent::application ( void ) const
inline

Will return the application.

◆ componentState()

ComponentState ot::intern::ExternalServicesComponent::componentState ( void ) const
inline

◆ dispatchAction()

std::string ExternalServicesComponent::dispatchAction ( const std::string & _json,
const std::string & _sender,
ot::MessageType _messageType )

Will perform the provided action.

Parameters
_jsonThe JSON type string containing the action and required parameter
_senderThe sender IP of the service sending the action
Returns
The response to the request or the error / warning text

◆ getCPUAndMemoryLoad()

void ExternalServicesComponent::getCPUAndMemoryLoad ( double & globalCPULoad,
double & globalMemoryLoad,
double & processCPULoad,
double & processMemoryLoad )

Tell the current cpu and memory load in percent.

◆ getLoggedInUserName()

std::string ot::intern::ExternalServicesComponent::getLoggedInUserName ( void )
inline

◆ getLoggedInUserPassword()

std::string ot::intern::ExternalServicesComponent::getLoggedInUserPassword ( void )
inline

◆ handleGetSystemInformation()

std::string ExternalServicesComponent::handleGetSystemInformation ( )

◆ init()

std::string ExternalServicesComponent::init ( const std::string & _sessionServiceURL,
const std::string & _sessionID )

Will initialize the service.

Parameters
_siteIDThe site ID this service is running on
_ownIPThe IP address of this service
_sessionServiceIPThe IP address of the session service this service was started from/ should interact with
_sessionIDThe ID of the session this service is running at

◆ initDebugExplicit()

std::string ExternalServicesComponent::initDebugExplicit ( const std::string & _sessionServiceURL,
const std::string & _sessionID )

◆ instance()

ot::intern::ExternalServicesComponent & ExternalServicesComponent::instance ( void )
static

Will return the global instance of this component since it should exist only once in the service.

◆ shutdown()

void ExternalServicesComponent::shutdown ( bool _requestedAsCommand)

Will shutdown the service.

Parameters
_receivedAsCommandIf true, the shutdown request was send from the session service

◆ startup()

int ExternalServicesComponent::startup ( ApplicationBase * _application,
const std::string & _localDirectoryServiceURL,
const std::string & _ownURL )

◆ updateSettingsFromDataBase()

void ExternalServicesComponent::updateSettingsFromDataBase ( PropertyGridCfg & _config)

◆ ~ExternalServicesComponent()

ExternalServicesComponent::~ExternalServicesComponent ( )
privatevirtual

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