17 namespace ph = std::placeholders;
24 const char* CtrlAgentController::agent_app_name_ =
"Control-agent";
27 const char* CtrlAgentController::agent_bin_name_ =
"kea-ctrl-agent";
30 CtrlAgentController::instance() {
33 if (!getController()) {
35 setController(controller_ptr);
38 return (getController());
42 CtrlAgentController::createProcess() {
49 CtrlAgentController::parseFile(
const std::string& name) {
51 return (parser.
parseFile(name, ParserContext::PARSER_AGENT));
55 CtrlAgentController::registerCommands() {
56 CtrlAgentCommandMgr::instance().registerCommand(BUILD_REPORT_COMMAND,
59 CtrlAgentCommandMgr::instance().registerCommand(CONFIG_GET_COMMAND,
62 CtrlAgentCommandMgr::instance().registerCommand(CONFIG_RELOAD_COMMAND,
65 CtrlAgentCommandMgr::instance().registerCommand(CONFIG_SET_COMMAND,
68 CtrlAgentCommandMgr::instance().registerCommand(CONFIG_TEST_COMMAND,
71 CtrlAgentCommandMgr::instance().registerCommand(CONFIG_WRITE_COMMAND,
74 CtrlAgentCommandMgr::instance().registerCommand(SHUT_DOWN_COMMAND,
77 CtrlAgentCommandMgr::instance().registerCommand(STATUS_GET_COMMAND,
80 CtrlAgentCommandMgr::instance().registerCommand(VERSION_GET_COMMAND,
85 CtrlAgentController::deregisterCommands() {
86 CtrlAgentCommandMgr::instance().deregisterCommand(BUILD_REPORT_COMMAND);
87 CtrlAgentCommandMgr::instance().deregisterCommand(CONFIG_GET_COMMAND);
88 CtrlAgentCommandMgr::instance().deregisterCommand(CONFIG_RELOAD_COMMAND);
89 CtrlAgentCommandMgr::instance().deregisterCommand(CONFIG_SET_COMMAND);
90 CtrlAgentCommandMgr::instance().deregisterCommand(CONFIG_TEST_COMMAND);
91 CtrlAgentCommandMgr::instance().deregisterCommand(CONFIG_WRITE_COMMAND);
92 CtrlAgentCommandMgr::instance().deregisterCommand(SHUT_DOWN_COMMAND);
93 CtrlAgentCommandMgr::instance().deregisterCommand(STATUS_GET_COMMAND);
94 CtrlAgentCommandMgr::instance().deregisterCommand(VERSION_GET_COMMAND);
97 CtrlAgentController::CtrlAgentController()
106 return (boost::dynamic_pointer_cast<CtrlAgentProcess>(
getProcess()));
boost::shared_ptr< DControllerBase > DControllerBasePtr
isc::data::ConstElementPtr statusGetHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for status-get command
isc::data::ConstElementPtr configTestHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for config-test command
isc::data::ConstElementPtr configReloadHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for config-reload command
DProcessBasePtr getProcess()
Fetches the current process.
isc::data::ConstElementPtr shutdownHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for 'shutdown' command
boost::shared_ptr< CtrlAgentProcess > CtrlAgentProcessPtr
Defines a shared pointer to CtrlAgentProcess.
CtrlAgentProcessPtr getCtrlAgentProcess()
Returns pointer to an instance of the underlying process object.
const char *const config_report[]
virtual ~CtrlAgentController()
Destructor.
Process Controller for Control Agent Process.
isc::data::ElementPtr parseFile(const std::string &filename, ParserType parser_type)
Run the parser on the file specified.
boost::shared_ptr< const Element > ConstElementPtr
isc::data::ConstElementPtr configWriteHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for config-write command
Kea Control Agent Application Process.
Defines the logger used by the top-level component of kea-dhcp-ddns.
isc::data::ConstElementPtr configGetHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for config-get command
isc::data::ConstElementPtr configSetHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for config-set command
Application Process Interface.
isc::data::ConstElementPtr buildReportHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for 'build-report' command
isc::data::ConstElementPtr versionGetHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for version-get command
Parser context is a wrapper around flex/bison instances dedicated to Control-agent config file parser...
const char *const * ca_config_report