artdaq  v3_04_00
artdaq::xmlrpc_commander Class Reference

The xmlrpc_commander class serves as the XMLRPC server run in each artdaq application. More...

#include <artdaq/ExternalComms/xmlrpc_commander.hh>

Inheritance diagram for artdaq::xmlrpc_commander:
artdaq::CommanderInterface

Public Member Functions

 xmlrpc_commander (fhicl::ParameterSet ps, artdaq::Commandable &commandable)
 xmlrpc_commander Constructor More...
 
void run_server () override
 Run the XMLRPC server.
 
std::string send_register_monitor (std::string monitor_fhicl) override
 Send a register_monitor command over XMLRPC More...
 
std::string send_unregister_monitor (std::string monitor_label) override
 Send an unregister_monitor command over XMLRPC More...
 
std::string send_init (fhicl::ParameterSet, uint64_t, uint64_t) override
 Send an init command over XMLRPC More...
 
std::string send_soft_init (fhicl::ParameterSet, uint64_t, uint64_t) override
 Send a soft_init command over XMLRPC More...
 
std::string send_reinit (fhicl::ParameterSet, uint64_t, uint64_t) override
 Send a reinit command over XMLRPC More...
 
std::string send_start (art::RunID, uint64_t, uint64_t) override
 Send a start command over XMLRPC More...
 
std::string send_pause (uint64_t, uint64_t) override
 Send a pause command over XMLRPC More...
 
std::string send_resume (uint64_t, uint64_t) override
 Send a resume command over XMLRPC More...
 
std::string send_stop (uint64_t, uint64_t) override
 Send a stop command over XMLRPC More...
 
std::string send_shutdown (uint64_t) override
 Send a shutdown command over XMLRPC More...
 
std::string send_status () override
 Send a status command over XMLRPC More...
 
std::string send_report (std::string) override
 Send a report command over XMLRPC More...
 
std::string send_legal_commands () override
 Send a legal_commands command over XMLRPC More...
 
std::string send_trace_get (std::string) override
 Send an send_trace_get command over XMLRPC More...
 
std::string send_trace_set (std::string, std::string, uint64_t) override
 Send an send_trace_msgfacility_set command over XMLRPC More...
 
std::string send_meta_command (std::string, std::string) override
 Send an send_meta_command command over XMLRPC More...
 
std::string send_rollover_subrun (uint64_t, uint32_t) override
 Send a send_rollover_subrun command over XMLRPC More...
 
- Public Member Functions inherited from artdaq::CommanderInterface
 CommanderInterface (const fhicl::ParameterSet &ps, artdaq::Commandable &commandable)
 CommanderInterface Constructor. More...
 
 CommanderInterface (const CommanderInterface &)=delete
 Copy Constructor is deleted.
 
CommanderInterfaceoperator= (const CommanderInterface &)=delete
 Copy Assignment operator is deleted. More...
 
virtual ~CommanderInterface ()
 Default virtual Destructor.
 
bool GetStatus ()
 Determine whether the Commander plugin is ready to accept commands More...
 
virtual std::string add_config_archive_entry (std::string, std::string)
 Using the transport mechanism, send an add_config_archive_entry command More...
 
virtual std::string clear_config_archive ()
 Using the transport mechanism, send a clear_config_archive command More...
 

Public Attributes

std::timed_mutex mutex_
 XMLRPC mutex.
 
std::unique_ptr
< xmlrpc_c::serverAbyss > 
server
 XMLRPC server.
 
- Public Attributes inherited from artdaq::CommanderInterface
artdaq::Commandable_commandable
 Reference to the Commandable that this Commander Commands. More...
 

Additional Inherited Members

- Public Types inherited from artdaq::CommanderInterface
using Parameters = fhicl::WrappedTable< Config >
 
- Protected Attributes inherited from artdaq::CommanderInterface
int _id
 ID Number of this Commander.
 
std::atomic< bool > running_
 Whether the server is running and able to respond to requests.
 

Detailed Description

The xmlrpc_commander class serves as the XMLRPC server run in each artdaq application.

Definition at line 17 of file xmlrpc_commander.hh.

Constructor & Destructor Documentation

artdaq::xmlrpc_commander::xmlrpc_commander ( fhicl::ParameterSet  ps,
artdaq::Commandable commandable 
)

xmlrpc_commander Constructor

Parameters
psParameterSet used for configuring xmlrpc_commander
commandableartdaq::Commandable object to send transition commands to
 xmlrpc_commander accepts the following Parameters:
  id: For XMLRPC, the ID should be the port to listen on
  server_url: When sending, location of XMLRPC server
* 

Definition at line 982 of file xmlrpc_commander.cc.

Member Function Documentation

std::string artdaq::xmlrpc_commander::send_init ( fhicl::ParameterSet  ps,
uint64_t  a,
uint64_t  b 
)
overridevirtual

Send an init command over XMLRPC

The init command is accepted by all artdaq processes that are in the booted state. It expects a ParameterSet for configuration, a timeout, and a timestamp.

Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1377 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_legal_commands ( )
overridevirtual

Send a legal_commands command over XMLRPC

This will query the artdaq process, and it will return the list of allowed transition commands from its current state.

Returns
Command result: a list of allowed transition commands from its current state

Reimplemented from artdaq::CommanderInterface.

Definition at line 1417 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_meta_command ( std::string  command,
std::string  arg 
)
overridevirtual

Send an send_meta_command command over XMLRPC

This will cause the receiver to run the given command with the given argument in user code

Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1429 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_pause ( uint64_t  a,
uint64_t  b 
)
overridevirtual

Send a pause command over XMLRPC

The pause command pauses a Run. When the run resumes, the subrun number will be incremented. This command accepts a timeout parameter and a timestamp parameter.

Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1393 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_register_monitor ( std::string  monitor_fhicl)
overridevirtual

Send a register_monitor command over XMLRPC

Parameters
monitor_fhiclFHiCL string contianing monitor configuration
Returns
Return status from XMLRPC

Reimplemented from artdaq::CommanderInterface.

Definition at line 1369 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_reinit ( fhicl::ParameterSet  ps,
uint64_t  a,
uint64_t  b 
)
overridevirtual

Send a reinit command over XMLRPC

The reinit command is accepted by all artdaq processes. It expects a ParameterSet for configuration, a timeout, and a timestamp.

Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1385 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_report ( std::string  what)
overridevirtual

Send a report command over XMLRPC

The report command returns the current value of the requested reportable quantity.

Returns
Command result: current value of the requested reportable quantity

Reimplemented from artdaq::CommanderInterface.

Definition at line 1413 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_resume ( uint64_t  a,
uint64_t  b 
)
overridevirtual

Send a resume command over XMLRPC

The resume command resumes a paused Run. When the run resumes, the subrun number will be incremented. This command accepts a timeout parameter and a timestamp parameter.

Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1397 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_rollover_subrun ( uint64_t  when,
uint32_t  sr 
)
overridevirtual

Send a send_rollover_subrun command over XMLRPC

This will cause the receiver to rollover the subrun number at the given event. (Event with seqID == boundary will be in new subrun.) Should be sent to all EventBuilders before the given event is processed.

Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1433 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_shutdown ( uint64_t  a)
overridevirtual

Send a shutdown command over XMLRPC

The shutdown command shuts down the artdaq process. This command accepts a timeout parameter.

Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1405 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_soft_init ( fhicl::ParameterSet  ps,
uint64_t  a,
uint64_t  b 
)
overridevirtual

Send a soft_init command over XMLRPC

The soft_init command is accepted by all artdaq processes that are in the booted state. It expects a ParameterSet for configuration, a timeout, and a timestamp.

Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1381 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_start ( art::RunID  r,
uint64_t  a,
uint64_t  b 
)
overridevirtual

Send a start command over XMLRPC

The start command starts a Run using the given run number. This command also accepts a timeout parameter and a timestamp parameter.

Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1389 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_status ( )
overridevirtual

Send a status command over XMLRPC

The status command returns the current status of the artdaq process.

Returns
Command result: current status of the artdaq process

Reimplemented from artdaq::CommanderInterface.

Definition at line 1409 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_stop ( uint64_t  a,
uint64_t  b 
)
overridevirtual

Send a stop command over XMLRPC

The stop command stops the current Run. This command accepts a timeout parameter and a timestamp parameter.

Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1401 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_trace_get ( std::string  name)
overridevirtual

Send an send_trace_get command over XMLRPC

This will cause the receiver to get the TRACE level masks for the given name Use name == "ALL" to get ALL names

Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1421 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_trace_set ( std::string  name,
std::string  which,
uint64_t  mask 
)
overridevirtual

Send an send_trace_msgfacility_set command over XMLRPC

This will cause the receiver to set the given TRACE level mask for the given name to the given mask. Only the first character of the mask selection will be parsed, dial 'M' for Memory, or 'S' for Slow. Use name == "ALL" to set ALL names

EXAMPLE: xmlrpc http://localhost:5235/RPC2 daq.trace_msgfacility_set TraceLock i/$((0x1234)) # Use Bash to convert hex to dec

Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1425 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_unregister_monitor ( std::string  monitor_label)
overridevirtual

Send an unregister_monitor command over XMLRPC

Parameters
monitor_labelLabel of the monitor to unregister
Returns
Return status from XMLRPC

Reimplemented from artdaq::CommanderInterface.

Definition at line 1373 of file xmlrpc_commander.cc.


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