dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
dfx::Server::Api::SystemConfigCommandHandler Class Reference

Unix control API command handler exposing dfx::Utils::SystemConfig operations. More...

#include <dfx-server/command-handlers/SystemConfigCommandHandler.hpp>

Inheritance diagram for dfx::Server::Api::SystemConfigCommandHandler:
[legend]
Collaboration diagram for dfx::Server::Api::SystemConfigCommandHandler:
[legend]

Public Member Functions

 SystemConfigCommandHandler (UnixRouter &router, Utils::SystemConfig &sysConfig)
 Construct and register system-config commands on the router.
Public Member Functions inherited from dfx::Server::Api::BaseCommandHandler
 BaseCommandHandler ()=default
 Default constructor.

Additional Inherited Members

Protected Member Functions inherited from dfx::Server::Api::BaseCommandHandler
template<typename PMF>
void registerNewCommand (UnixRouter &router, std::string command, nlohmann::json const &schema, PMF handler)
 Register a new command in the router with an associated params schema and member handler.
bool validateParams (std::string_view command, nlohmann::json const &params, std::string_view id, UnixSessionPtr session) const
 Validate params for a command and reply with errors on failure.

Detailed Description

Unix control API command handler exposing dfx::Utils::SystemConfig operations.

SystemConfigCommandHandler registers a small set of Unix control commands on a dfx::Server::UnixRouter to allow clients (typically dfx-ctl) to query and modify runtime system configuration values.

Registered commands
The constructor registers the following commands which are self explanatory:
  • set_system_value
  • get_system_value
  • list_system_values
Ownership and lifetime
The handler stores a reference to the system configuration registry (dfx::Utils::SystemConfig). The referenced object must outlive this handler.

Constructor & Destructor Documentation

◆ SystemConfigCommandHandler()

dfx::Server::Api::SystemConfigCommandHandler::SystemConfigCommandHandler ( UnixRouter & router,
Utils::SystemConfig & sysConfig )

Construct and register system-config commands on the router.

Registers set_system_value, get_system_value, and list_system_values with their associated parameter schemas and handler member functions.

Note
Lifetime The registered router handlers capture this, so this object must outlive the router usage (typically created at server startup and kept until shutdown).
Parameters
routerRouter used to dispatch Unix control commands.
sysConfigSystem configuration registry to query and update.

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