RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic Class Reference

Deployment Daemon business logic. More...

#include <deploymentDaemonBusinessLogic.hpp>

Inheritance diagram for rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic:
rtctk::deploymentDaemon::DeploymentDaemonLifeCycle::BizLogicIf

Classes

struct  PythonObjects
 

Public Types

using ComponentType = LifeCycle
 

Public Member Functions

 DeploymentDaemonBusinessLogic (const std::string &name, ServiceContainer &services, const elt::mal::Uri &sde)
 
virtual ~DeploymentDaemonBusinessLogic ()
 
void ActivityDeploying (StopToken st, std::string args) override
 
void ActivityUndeploying (StopToken st) override
 
std::string ActionGetActiveDeployment () override
 
std::string ActionGetDescription () override
 
std::vector< std::string > ActionGetDeploymentSets () override
 
std::vector< std::string > ActionGetComponents () override
 
std::vector< std::string > ActionGetActiveComponents () override
 Returns active components from the active deployment set.
 
void ActionStartComponent (std::string component_name) override
 
void ActionStopComponent (std::string component_name) override
 
void ActivityStarting (cfw::StopToken st) override
 
std::vector< std::string > ActionGetServices () override
 
std::vector< std::string > ActionGetActiveServices () override
 

Protected Member Functions

void DeployServices (const DataPointPath &depl_set_path)
 Deploys all services if any.
 
void DeployComponents (const DataPointPath &depl_set_path)
 Deploys all components.
 
void UndeployProcesses (std::vector< std::string > &proceses)
 Undeploys all components.
 
void StartProcess (const std::string &name, const std::string &type, const DataPointPath &depl_set_path)
 Implements the StartProcess command: starts Nomad job process for give component or service.
 
void StopProces (const std::string &component_name, const bool check_error=true)
 Implements the StopProces command.
 
void GetDeploymentSets ()
 Fetches the available Deployment Sets from the Persistent Configuration Repository and caches the value.
 
void InitPythonObjects ()
 Initialize Python object for py bind calls.
 
void CleanupPythonObjects () noexcept
 Clean up Python objects.
 

Protected Attributes

log4cplus::Logger & m_logger
 
const std::string m_name
 component name
 
rtctk::componentFramework::ServiceContainerm_service_container
 Reference to container services needed to access run-time repository for configuration, and other services.
 
rtctk::componentFramework::ServiceDiscoverym_service_discovery
 
std::unique_ptr< rtctk::componentFramework::PersistentRepoIfm_persistent_repo
 References to the persistent repository.
 
std::vector< std::string > m_deployment_sets
 List of deployment sets.
 
std::string m_active_deployment_set
 Name of active deployment set.
 
std::string m_description
 Deployment set description.
 
std::vector< std::string > m_services
 List of deployed services.
 
std::vector< std::string > m_components
 List of deployed components.
 
elt::mal::Uri m_sde
 Service Discovery EndPoint URI.
 
std::mutex m_mutex
 Mutex as a temporary workaround to protect python jobfile generation.
 
std::unique_ptr< PythonObjectsm_pyobjects
 

Detailed Description

Deployment Daemon business logic.

Member Typedef Documentation

◆ ComponentType

Constructor & Destructor Documentation

◆ DeploymentDaemonBusinessLogic()

rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::DeploymentDaemonBusinessLogic ( const std::string & name,
ServiceContainer & services,
const elt::mal::Uri & sde )

◆ ~DeploymentDaemonBusinessLogic()

rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::~DeploymentDaemonBusinessLogic ( )
virtual

Member Function Documentation

◆ ActionGetActiveComponents()

std::vector< std::string > rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::ActionGetActiveComponents ( )
overridevirtual

Returns active components from the active deployment set.

Should be the subset of ActionGetComponents, or the same.

Returns
std::vector<std::string> list of active components

Implements rtctk::deploymentDaemon::DeploymentDaemonLifeCycle::BizLogicIf.

◆ ActionGetActiveDeployment()

std::string rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::ActionGetActiveDeployment ( )
overridevirtual

◆ ActionGetActiveServices()

std::vector< std::string > rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::ActionGetActiveServices ( )
overridevirtual

◆ ActionGetComponents()

std::vector< std::string > rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::ActionGetComponents ( )
overridevirtual

◆ ActionGetDeploymentSets()

std::vector< std::string > rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::ActionGetDeploymentSets ( )
overridevirtual

◆ ActionGetDescription()

std::string rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::ActionGetDescription ( )
overridevirtual

◆ ActionGetServices()

std::vector< std::string > rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::ActionGetServices ( )
overridevirtual

◆ ActionStartComponent()

void rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::ActionStartComponent ( std::string component_name)
overridevirtual

◆ ActionStopComponent()

void rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::ActionStopComponent ( std::string component_name)
overridevirtual

◆ ActivityDeploying()

void rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::ActivityDeploying ( StopToken st,
std::string args )
overridevirtual

◆ ActivityStarting()

void rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::ActivityStarting ( cfw::StopToken st)
overridevirtual

◆ ActivityUndeploying()

void rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::ActivityUndeploying ( StopToken st)
overridevirtual

◆ CleanupPythonObjects()

void rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::CleanupPythonObjects ( )
protectednoexcept

Clean up Python objects.

◆ DeployComponents()

void rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::DeployComponents ( const DataPointPath & depl_set_path)
protected

Deploys all components.

Parameters
[in]depl_set_pathpath to the deployment cfg

go one by one through the component list

◆ DeployServices()

void rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::DeployServices ( const DataPointPath & depl_set_path)
protected

Deploys all services if any.

Parameters
[in]depl_set_pathpath to the deployment cfg

go one by one through the service list

◆ GetDeploymentSets()

void rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::GetDeploymentSets ( )
protected

Fetches the available Deployment Sets from the Persistent Configuration Repository and caches the value.

If the Deployment Sets have not been retrieved yet, this method fetches the value and stores it in m_deployment_sets.

◆ InitPythonObjects()

void rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::InitPythonObjects ( )
protected

Initialize Python object for py bind calls.

◆ StartProcess()

void rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::StartProcess ( const std::string & name,
const std::string & type,
const DataPointPath & depl_set_path )
protected

Implements the StartProcess command: starts Nomad job process for give component or service.

Parameters
[in]nameName of the component/service to be started.
[in]typeType of the service to be started.
[in]depl_set_pathpath to the deployment cfg

◆ StopProces()

void rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::StopProces ( const std::string & component_name,
const bool check_error = true )
protected

Implements the StopProces command.

Parameters
[in]component_nameName of the component to be stopped.
[in]check_errorif should be check for error, and throw exception

◆ UndeployProcesses()

void rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::UndeployProcesses ( std::vector< std::string > & proceses)
protected

Undeploys all components.

Parameters
procesesList of processes (components or services) to undeploy/stop. the list is cleared at the end.

Member Data Documentation

◆ m_active_deployment_set

std::string rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::m_active_deployment_set
protected

Name of active deployment set.

◆ m_components

std::vector<std::string> rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::m_components
protected

List of deployed components.

◆ m_deployment_sets

std::vector<std::string> rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::m_deployment_sets
protected

List of deployment sets.

◆ m_description

std::string rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::m_description
protected

Deployment set description.

◆ m_logger

log4cplus::Logger& rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::m_logger
protected

◆ m_mutex

std::mutex rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::m_mutex
protected

Mutex as a temporary workaround to protect python jobfile generation.

◆ m_name

const std::string rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::m_name
protected

component name

◆ m_persistent_repo

std::unique_ptr<rtctk::componentFramework::PersistentRepoIf> rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::m_persistent_repo
protected

References to the persistent repository.

◆ m_pyobjects

std::unique_ptr<PythonObjects> rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::m_pyobjects
protected

◆ m_sde

elt::mal::Uri rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::m_sde
protected

Service Discovery EndPoint URI.

◆ m_service_container

rtctk::componentFramework::ServiceContainer& rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::m_service_container
protected

Reference to container services needed to access run-time repository for configuration, and other services.

◆ m_service_discovery

rtctk::componentFramework::ServiceDiscovery& rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::m_service_discovery
protected

◆ m_services

std::vector<std::string> rtctk::deploymentDaemon::DeploymentDaemonBusinessLogic::m_services
protected

List of deployed services.


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