19 namespace ph = std::placeholders;
26 const char* D2Controller::d2_app_name_ =
"DhcpDdns";
29 const char* D2Controller::d2_bin_name_ =
"kea-dhcp-ddns";
32 D2Controller::instance() {
35 if (!getController()) {
37 setController(controller_ptr);
40 return (getController());
46 return (
new D2Process(getAppName().c_str(), getIOService()));
49 D2Controller::D2Controller()
57 CommandMgr::instance().registerCommand(BUILD_REPORT_COMMAND,
60 CommandMgr::instance().registerCommand(CONFIG_GET_COMMAND,
63 CommandMgr::instance().registerCommand(CONFIG_RELOAD_COMMAND,
66 CommandMgr::instance().registerCommand(CONFIG_SET_COMMAND,
69 CommandMgr::instance().registerCommand(CONFIG_TEST_COMMAND,
72 CommandMgr::instance().registerCommand(CONFIG_WRITE_COMMAND,
75 CommandMgr::instance().registerCommand(SHUT_DOWN_COMMAND,
78 CommandMgr::instance().registerCommand(STATUS_GET_COMMAND,
79 std::bind(&DControllerBase::statusGetHandler,
this, ph::_1, ph::_2));
81 CommandMgr::instance().registerCommand(VERSION_GET_COMMAND,
89 CommandMgr::instance().closeCommandSocket();
92 CommandMgr::instance().deregisterCommand(BUILD_REPORT_COMMAND);
93 CommandMgr::instance().deregisterCommand(CONFIG_GET_COMMAND);
94 CommandMgr::instance().deregisterCommand(CONFIG_RELOAD_COMMAND);
95 CommandMgr::instance().deregisterCommand(CONFIG_SET_COMMAND);
96 CommandMgr::instance().deregisterCommand(CONFIG_TEST_COMMAND);
97 CommandMgr::instance().deregisterCommand(CONFIG_WRITE_COMMAND);
98 CommandMgr::instance().deregisterCommand(SHUT_DOWN_COMMAND);
99 CommandMgr::instance().deregisterCommand(STATUS_GET_COMMAND);
100 CommandMgr::instance().deregisterCommand(VERSION_GET_COMMAND);
110 D2Controller::parseFile(
const std::string& file_name) {
131 std::stringstream stream;
134 return (stream.str());
boost::shared_ptr< DControllerBase > DControllerBasePtr
void registerCommands()
Register commands.
isc::data::ConstElementPtr configTestHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for config-test command
Evaluation context, an interface to the expression evaluation.
virtual ~D2Controller()
Destructor.
isc::data::ConstElementPtr configReloadHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for config-reload command
void deregisterCommands()
Deregister commands.
isc::data::ConstElementPtr shutdownHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for 'shutdown' command
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
const char *const config_report[]
DHCP-DDNS Application Process.
boost::shared_ptr< const Element > ConstElementPtr
isc::data::ConstElementPtr configWriteHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for config-write command
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
isc::data::ElementPtr parseFile(const std::string &filename, ParserType parser_type)
Run the parser on the file specified.
Used for parsing content of DhcpDdns.
virtual std::string getVersionAddendum()
Returns version info specific to D2.
Application Process Interface.
isc::data::ConstElementPtr buildReportHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for 'build-report' command
const char *const * d2_config_report
static std::string getVersion()
Get version string.
isc::data::ConstElementPtr versionGetHandler(const std::string &command, isc::data::ConstElementPtr args)
handler for version-get command
Process Controller for D2 Process This class is the DHCP-DDNS specific derivation of DControllerBase...