artdaq  v3_09_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 (const 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 const &monitor_fhicl) override
 Send a register_monitor command over XMLRPC More...
 
std::string send_unregister_monitor (std::string const &monitor_label) override
 Send an unregister_monitor command over XMLRPC More...
 
std::string send_init (fhicl::ParameterSet const &ps, uint64_t timeout, uint64_t timestamp) override
 Send an init command over XMLRPC More...
 
std::string send_soft_init (fhicl::ParameterSet const &ps, uint64_t timeout, uint64_t timestamp) override
 Send a soft_init command over XMLRPC More...
 
std::string send_reinit (fhicl::ParameterSet const &ps, uint64_t timeout, uint64_t timestamp) override
 Send a reinit command over XMLRPC More...
 
std::string send_start (art::RunID runNumber, uint64_t timeout, uint64_t timestamp) override
 Send a start command over XMLRPC More...
 
std::string send_pause (uint64_t timeout, uint64_t timestamp) override
 Send a pause command over XMLRPC More...
 
std::string send_resume (uint64_t timeout, uint64_t timestamp) override
 Send a resume command over XMLRPC More...
 
std::string send_stop (uint64_t timeout, uint64_t timestamp) override
 Send a stop command over XMLRPC More...
 
std::string send_shutdown (uint64_t timeout) 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 const &what) 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 const &name) override
 Send an send_trace_get command over XMLRPC More...
 
std::string send_trace_set (std::string const &name, std::string const &type, std::string const &mask) override
 Send an send_trace_msgfacility_set command over XMLRPC More...
 
std::string send_meta_command (std::string const &command, std::string const &argument) override
 Send an send_meta_command command over XMLRPC More...
 
std::string send_rollover_subrun (uint64_t when, uint32_t sr) 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 const &key, std::string const &value)
 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 >
 Used for ParameterSet validation (if desired)
 
- 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 16 of file xmlrpc_commander.hh.

Constructor & Destructor Documentation

artdaq::xmlrpc_commander::xmlrpc_commander ( const 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 1072 of file xmlrpc_commander.cc.

Member Function Documentation

std::string artdaq::xmlrpc_commander::send_init ( fhicl::ParameterSet const &  ps,
uint64_t  timeout,
uint64_t  timestamp 
)
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.

Parameters
psParameterSet received with the init command
timeoutTimeout for the command
timestampTimestamp of the command
Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1484 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 1524 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_meta_command ( std::string const &  command,
std::string const &  argument 
)
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

Parameters
commandCommand name to send
argumentArgument for command
Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1536 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_pause ( uint64_t  timeout,
uint64_t  timestamp 
)
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.

Parameters
timeoutTimeout for the command
timestampTimestamp of the command
Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1500 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_register_monitor ( std::string const &  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 1476 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_reinit ( fhicl::ParameterSet const &  ps,
uint64_t  timeout,
uint64_t  timestamp 
)
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.

Parameters
psParameterSet received with the reinit command
timeoutTimeout for the command
timestampTimestamp of the command
Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1492 of file xmlrpc_commander.cc.

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

Send a report command over XMLRPC

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

Parameters
whichReportable quantity to request
Returns
Command result: current value of the requested reportable quantity

Reimplemented from artdaq::CommanderInterface.

Definition at line 1520 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_resume ( uint64_t  timeout,
uint64_t  timestamp 
)
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.

Parameters
timeoutTimeout for the command
timestampTimestamp of the command
Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1504 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.

Parameters
seqSequence ID of new subrun
subrunNumberSubrun number of the new subrun
Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1540 of file xmlrpc_commander.cc.

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

Send a shutdown command over XMLRPC

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

Parameters
timeoutTimeout for the command
Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1512 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_soft_init ( fhicl::ParameterSet const &  ps,
uint64_t  timeout,
uint64_t  timestamp 
)
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.

Parameters
psParameterSet received with the soft_init command
timeoutTimeout for the command
timestampTimestamp of the command
Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1488 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_start ( art::RunID  runNumber,
uint64_t  timeout,
uint64_t  timestamp 
)
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.

Parameters
runNumberRun number of the new run
timeoutTimeout for the command
timestampTimestamp of the command
Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1496 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 1516 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_stop ( uint64_t  timeout,
uint64_t  timestamp 
)
overridevirtual

Send a stop command over XMLRPC

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

Parameters
timeoutTimeout for the command
timestampTimestamp of the command
Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1508 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_trace_get ( std::string const &  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

Parameters
nameTRACE name to get the mask for ("ALL" to get all names)
Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1528 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_trace_set ( std::string const &  name,
std::string const &  type,
std::string const &  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 i8/$((0x1234)) # Use Bash to convert hex to dec

Parameters
nameTRACE name to set ("ALL" for all TRACE names)
typeType of mask to set ('M', 'S', or 'T')
mask64-bit mask, in string form
Returns
Command result: "SUCCESS" if succeeded

Reimplemented from artdaq::CommanderInterface.

Definition at line 1532 of file xmlrpc_commander.cc.

std::string artdaq::xmlrpc_commander::send_unregister_monitor ( std::string const &  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 1480 of file xmlrpc_commander.cc.


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