RTC Toolkit 5.0.0
Loading...
Searching...
No Matches
deploymentDaemonBusinessLogic.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_REUSABLECOMPONENT_DEPLOYMENT_DAEMON_BUSINESSLOGIC_HPP
14#define RTCTK_REUSABLECOMPONENT_DEPLOYMENT_DAEMON_BUSINESSLOGIC_HPP
15
21
22#include <pybind11/pybind11.h>
23
24#include <mutex>
25
27
29namespace py = pybind11;
30
37public:
39 DeploymentDaemonBusinessLogic(const std::string& name,
40 ServiceContainer& services,
41 const elt::mal::Uri& sde);
42
44
45 void ActivityDeploying(StopToken st, std::string args) override;
46 void ActivityUndeploying(StopToken st) override;
47
48 std::string ActionGetActiveDeployment() override;
49 std::string ActionGetDescription() override;
50
51 std::vector<std::string> ActionGetDeploymentSets() override;
52
53 std::vector<std::string> ActionGetComponents() override;
54
61 std::vector<std::string> ActionGetActiveComponents() override;
62
63 void ActionStartComponent(std::string component_name) override;
64 void ActionStopComponent(std::string component_name) override;
65
66 void ActivityStarting(cfw::StopToken st) override;
67
68 std::vector<std::string> ActionGetServices() override;
69 std::vector<std::string> ActionGetActiveServices() override;
70
71protected:
76 void DeployServices(const DataPointPath& depl_set_path);
77
82 void DeployComponents(const DataPointPath& depl_set_path);
83
89 void UndeployProcesses(std::vector<std::string>& proceses);
90
98 void StartProcess(const std::string& name,
99 const std::string& type,
100 const DataPointPath& depl_set_path);
101
107 void StopProces(const std::string& component_name, const bool check_error = true);
108
116 void GetDeploymentSets();
117
122 void InitPythonObjects();
123
128 void CleanupPythonObjects() noexcept;
129
130 log4cplus::Logger& m_logger;
131
135 const std::string m_name;
136
141 rtctk::componentFramework::ServiceContainer& m_service_container;
142
143 rtctk::componentFramework::ServiceDiscovery& m_service_discovery;
144
148 std::unique_ptr<rtctk::componentFramework::PersistentRepoIf> m_persistent_repo;
149
154 std::vector<std::string> m_deployment_sets;
155
160 std::string m_active_deployment_set;
161
166 std::string m_description;
167
172 std::vector<std::string> m_services;
173
178 std::vector<std::string> m_components;
179
184 elt::mal::Uri m_sde;
185
190 std::mutex m_mutex;
191
193 py::module m_module;
196 };
197
198 std::unique_ptr<PythonObjects> m_pyobjects;
199};
200
201} // namespace rtctk::deploymentDaemon
202
203#endif // RTCTK_REUSABLECOMPONENT_DEPLOYMENT_DAEMON_BUSINESSLOGIC_HPP
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:74
Base interface for all Persistent Configuration Repository adapters.
Definition persistentRepoIf.hpp:25
Container class that holds services of any type.
Definition serviceContainer.hpp:39
Class that implements a very basic service discovery mechanism.
Definition serviceDiscovery.hpp:33
Deployment Daemon business logic.
Definition deploymentDaemonBusinessLogic.hpp:36
std::unique_ptr< PythonObjects > m_pyobjects
Definition deploymentDaemonBusinessLogic.hpp:198
Definition deploymentDaemonLifeCycle.hpp:123
RtcComponent LifeCycle
Definition main.cpp:23
#define RTCTK_LOCAL
Helper to hide a class or function from the public symbol table.
Definition config.hpp:60
Header file for ComponentMetricsIf.
Lifecycle of the 'Deployment Daemon Component'.
Definition statePublisher.hpp:20
rad::StopToken StopToken
Definition stopToken.hpp:20
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Definition deploymentDaemonBusinessLogic.cpp:33
Definition commandReplier.cpp:22
Header file for PersistentRepoIf, which defines the API for PersistentRepoAdapter.
std::vector< DeploymentSetInfo > m_deployment_sets
Definition populateConfig.cpp:264
std::string m_name
Definition populateConfig.cpp:166
A container that can hold any type of service.
Class that implements a very basic service discover mechanism.
Definition deploymentDaemonBusinessLogic.hpp:192
py::module m_module
Definition deploymentDaemonBusinessLogic.hpp:193
py::object m_init_logger_config
Definition deploymentDaemonBusinessLogic.hpp:194
py::object m_generate_nomad_job_from_dp
Definition deploymentDaemonBusinessLogic.hpp:195
Life cycle for DeploymentDaemonComponent.
Definition deploymentDaemonLifeCycle.hpp:122