artdaq  v3_07_02
xmlrpc_commander.hh
1 /* DarkSide 50 DAQ program
2  * This file add the xmlrpc commander as a client to the SC
3  * Author: Alessandro Razeto <Alessandro.Razeto@ge.infn.it>
4  */
5 #ifndef artdaq_ExternalComms_xmlrpc_commander_hh
6 #define artdaq_ExternalComms_xmlrpc_commander_hh
7 
8 #include <mutex>
9 #include "artdaq/ExternalComms/CommanderInterface.hh"
10 
11 namespace artdaq {
12 
17 {
18 public:
30  xmlrpc_commander(fhicl::ParameterSet ps, artdaq::Commandable& commandable);
31 
35  void run_server() override;
36 
42  std::string send_register_monitor(std::string monitor_fhicl) override;
43 
49  std::string send_unregister_monitor(std::string monitor_label) override;
50 
58  std::string send_init(fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) override;
59 
67  std::string send_soft_init(fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) override;
68 
76  std::string send_reinit(fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) override;
77 
85  std::string send_start(art::RunID runNumber, uint64_t timeout, uint64_t timestamp) override;
86 
94  std::string send_pause(uint64_t timeout, uint64_t timestamp) override;
95 
103  std::string send_resume(uint64_t timeout, uint64_t timestamp) override;
104 
112  std::string send_stop(uint64_t timeout, uint64_t timestamp) override;
113 
121  std::string send_shutdown(uint64_t timeout) override;
122 
129  std::string send_status() override;
130 
137  std::string send_report(std::string which) override;
138 
145  std::string send_legal_commands() override;
146 
154  std::string send_trace_get(std::string name) override;
155 
166  std::string send_trace_set(std::string name, std::string type, std::string mask) override;
167 
174  std::string send_meta_command(std::string command, std::string argument) override;
175 
183  std::string send_rollover_subrun(uint64_t seq, uint32_t subrunNumber) override;
184 
185 private:
186  xmlrpc_commander(const xmlrpc_commander&) = delete;
187 
189 
190  int port_;
191  std::string serverUrl_;
192 
193  std::string send_command_(std::string command);
194  std::string send_command_(std::string command, std::string arg);
195  std::string send_command_(std::string command, fhicl::ParameterSet pset, uint64_t a, uint64_t b);
196  std::string send_command_(std::string command, uint64_t a, uint64_t b);
197  std::string send_command_(std::string command, art::RunID r, uint64_t a, uint64_t b);
198  std::string send_command_(std::string, uint64_t);
199  std::string send_command_(std::string, std::string, std::string);
200  std::string send_command_(std::string, std::string, std::string, std::string);
201 
202 public:
203  std::timed_mutex mutex_;
204  std::unique_ptr<xmlrpc_c::serverAbyss> server;
205 };
206 
207 } // namespace artdaq
208 
209 #endif /* artdaq_ExternalComms_xmlrpc_commander_hh */
std::string send_rollover_subrun(uint64_t seq, uint32_t subrunNumber) override
Send a send_rollover_subrun command over XMLRPC
This interface defines the functions used to transfer data between artdaq applications.
std::string send_trace_get(std::string name) override
Send an send_trace_get command over XMLRPC
std::string send_unregister_monitor(std::string monitor_label) override
Send an unregister_monitor command over XMLRPC
std::string send_register_monitor(std::string monitor_fhicl) override
Send a register_monitor command over XMLRPC
Commandable is the base class for all artdaq components which implement the artdaq state machine...
Definition: Commandable.hh:20
xmlrpc_commander(fhicl::ParameterSet ps, artdaq::Commandable &commandable)
xmlrpc_commander Constructor
std::string send_stop(uint64_t timeout, uint64_t timestamp) override
Send a stop command over XMLRPC
std::string send_status() override
Send a status command over XMLRPC
std::string send_legal_commands() override
Send a legal_commands command over XMLRPC
The xmlrpc_commander class serves as the XMLRPC server run in each artdaq application.
std::string send_meta_command(std::string command, std::string argument) override
Send an send_meta_command command over XMLRPC
void run_server() override
Run the XMLRPC server.
std::unique_ptr< xmlrpc_c::serverAbyss > server
XMLRPC server.
std::string send_shutdown(uint64_t timeout) override
Send a shutdown command over XMLRPC
std::string send_init(fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) override
Send an init command over XMLRPC
std::string send_pause(uint64_t timeout, uint64_t timestamp) override
Send a pause command over XMLRPC
std::string send_trace_set(std::string name, std::string type, std::string mask) override
Send an send_trace_msgfacility_set command over XMLRPC
std::string send_start(art::RunID runNumber, uint64_t timeout, uint64_t timestamp) override
Send a start command over XMLRPC
std::string send_soft_init(fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) override
Send a soft_init command over XMLRPC
std::timed_mutex mutex_
XMLRPC mutex.
std::string send_resume(uint64_t timeout, uint64_t timestamp) override
Send a resume command over XMLRPC
std::string send_report(std::string which) override
Send a report command over XMLRPC
std::string send_reinit(fhicl::ParameterSet ps, uint64_t timeout, uint64_t timestamp) override
Send a reinit command over XMLRPC