Kea
1.9.9-git
|
Process Controller for D2 Process This class is the DHCP-DDNS specific derivation of DControllerBase. More...
#include <d2_controller.h>
Public Member Functions | |
virtual | ~D2Controller () |
Destructor. More... | |
void | deregisterCommands () |
Deregister commands. More... | |
void | registerCommands () |
Register commands. More... | |
Public Member Functions inherited from isc::process::DControllerBase | |
DControllerBase (const char *app_name, const char *bin_name) | |
Constructor. More... | |
virtual | ~DControllerBase () |
Destructor. More... | |
isc::data::ConstElementPtr | buildReportHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for 'build-report' command More... | |
virtual isc::data::ConstElementPtr | checkConfig (isc::data::ConstElementPtr new_config) |
Instance method invoked by the configuration event handler and which processes the actual configuration check. More... | |
virtual isc::data::ConstElementPtr | configFromFile () |
Reconfigures the process from a configuration file. More... | |
isc::data::ConstElementPtr | configGetHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for config-get command More... | |
isc::data::ConstElementPtr | configReloadHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for config-reload command More... | |
isc::data::ConstElementPtr | configSetHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for config-set command More... | |
isc::data::ConstElementPtr | configTestHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for config-test command More... | |
isc::data::ConstElementPtr | configWriteHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for config-write command More... | |
std::string | getAppName () const |
Fetches the name of the application under control. More... | |
std::string | getBinName () const |
Fetches the name of the application executable. More... | |
std::string | getVersion (bool extended) |
returns Kea version on stdout and exit. More... | |
virtual int | launch (int argc, char *argv[], const bool test_mode) |
Acts as the primary entry point into the controller execution and provides the outermost application control logic: More... | |
isc::data::ConstElementPtr | serverTagGetHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for server-tag-get command More... | |
isc::data::ConstElementPtr | shutdownHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for 'shutdown' command More... | |
isc::data::ConstElementPtr | statusGetHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for status-get command More... | |
virtual isc::data::ConstElementPtr | updateConfig (isc::data::ConstElementPtr new_config) |
Instance method invoked by the configuration event handler and which processes the actual configuration update. More... | |
isc::data::ConstElementPtr | versionGetHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for version-get command More... | |
Public Member Functions inherited from isc::process::Daemon | |
Daemon () | |
Default constructor. More... | |
virtual | ~Daemon () |
Destructor. More... | |
void | checkConfigFile () const |
Checks the configuration file name. More... | |
virtual void | cleanup () |
Performs final deconfiguration. More... | |
void | createPIDFile (int pid=0) |
Creates the PID file. More... | |
std::string | getConfigFile () const |
Returns config file name. More... | |
int | getExitValue () |
Fetches the exit value. More... | |
std::string | getPIDFileDir () const |
Returns the directory used when forming default PID file name. More... | |
std::string | getPIDFileName () const |
Returns the current PID file name. More... | |
virtual std::list< std::list< std::string > > | jsonPathsToRedact () const |
Return a list of all paths that contain passwords or secrets. More... | |
isc::data::ConstElementPtr | redactConfig (isc::data::ConstElementPtr const &config) |
Redact a configuration. More... | |
void | setConfigFile (const std::string &config_file) |
Sets the configuration file name. More... | |
void | setExitValue (int value) |
Sets the exit value. More... | |
void | setPIDFileDir (const std::string &pid_file_dir) |
Sets the PID file directory. More... | |
void | setPIDFileName (const std::string &pid_file_name) |
Sets PID file name. More... | |
virtual void | shutdown () |
Initiates shutdown procedure for the whole server. More... | |
virtual size_t | writeConfigFile (const std::string &config_file, isc::data::ConstElementPtr cfg=isc::data::ConstElementPtr()) const |
Writes current configuration to specified file. More... | |
Static Public Member Functions | |
static process::DControllerBasePtr & | instance () |
Static singleton instance method. More... | |
Static Public Member Functions inherited from isc::process::Daemon | |
static void | configureLogger (const isc::data::ConstElementPtr &log_config, const isc::process::ConfigPtr &storage) |
Configures logger. More... | |
static std::string | getDefaultLoggerName () |
Returns default logger name. More... | |
static std::string | getProcName () |
returns the process name This value is used as when forming the default PID file name More... | |
static bool | getVerbose () |
Returns if running in verbose mode. More... | |
static std::string | getVersion (bool extended) |
returns Kea version on stdout and exits. More... | |
static void | loggerInit (const char *log_name, bool verbose) |
Initializes logger. More... | |
static void | setDefaultLoggerName (const std::string &logger) |
Sets the default logger name. More... | |
static void | setProcName (const std::string &proc_name) |
Sets the process name. More... | |
static void | setVerbose (const bool verbose) |
Sets or clears verbose mode. More... | |
Static Public Attributes | |
static const char * | d2_app_name_ = "DhcpDdns" |
Defines the application name, this is passed into base class and appears in log statements. More... | |
static const char * | d2_bin_name_ = "kea-dhcp-ddns" |
Defines the executable name. More... | |
Protected Member Functions | |
virtual std::string | getVersionAddendum () |
Returns version info specific to D2. More... | |
Protected Member Functions inherited from isc::process::DControllerBase | |
void | checkConfigOnly () |
Check the configuration. More... | |
virtual bool | customOption (int option, char *optarg) |
Virtual method that provides derivations the opportunity to support additional command line options. More... | |
virtual const std::string | getCustomOpts () const |
Virtual method which returns a string containing the option letters for any custom command line options supported by the derivation. More... | |
asiolink::IOServicePtr & | getIOService () |
Getter for fetching the controller's IOService. More... | |
DProcessBasePtr | getProcess () |
Fetches the current process. More... | |
virtual const std::string | getUsageText () const |
Virtual method which can be used to contribute derivation specific usage text. More... | |
std::string | handleOtherObjects (isc::data::ConstElementPtr args) |
Deals with other (i.e. More... | |
void | initProcess () |
Instantiates the application process and then initializes it. More... | |
void | initSignalHandling () |
Initializes signal handling. More... | |
bool | isCheckOnly () const |
Supplies whether or not check only mode is enabled. More... | |
bool | isVerbose () const |
Supplies whether or not verbose logging is enabled. More... | |
void | parseArgs (int argc, char *argv[]) |
Processes the command line arguments. More... | |
virtual isc::data::ConstElementPtr | parseText (const std::string &input) |
Parse text into Elements. More... | |
virtual void | processSignal (int signum) |
Application-level signal processing method. More... | |
void | runProcess () |
Invokes the application process's event loop,(DBaseProcess::run). More... | |
void | setCheckOnly (bool value) |
Method for enabling or disabling check only mode. More... | |
void | setVerbose (bool value) |
Method for enabling or disabling verbose logging. More... | |
isc::data::ConstElementPtr | shutdownProcess (isc::data::ConstElementPtr args) |
Initiates shutdown procedure. More... | |
void | usage (const std::string &text) |
Prints the program usage text to std error. More... | |
Protected Member Functions inherited from isc::process::Daemon | |
std::string | makePIDFileName () const |
Manufacture the pid file name. More... | |
Friends | |
class | NakedD2Controller |
To facilitate unit testing. More... | |
Additional Inherited Members | |
Static Protected Member Functions inherited from isc::process::DControllerBase | |
static DControllerBasePtr & | getController () |
Static getter which returns the singleton instance. More... | |
static void | setController (const DControllerBasePtr &controller) |
Static setter which sets the singleton instance. More... | |
Protected Attributes inherited from isc::process::Daemon | |
isc::asiolink::IOSignalSetPtr | signal_set_ |
A pointer to the object installing custom signal handlers. More... | |
boost::posix_time::ptime | start_ |
Timestamp of the start of the daemon. More... | |
Process Controller for D2 Process This class is the DHCP-DDNS specific derivation of DControllerBase.
It creates and manages an instance of the DHCP-DDNS application process, D2Process.
Definition at line 29 of file d2_controller.h.
|
virtual |
Destructor.
Definition at line 123 of file d2_controller.cc.
void isc::d2::D2Controller::deregisterCommands | ( | ) |
|
protectedvirtual |
Returns version info specific to D2.
Reimplemented from isc::process::DControllerBase.
Definition at line 130 of file d2_controller.cc.
References isc::cryptolink::CryptoLink::getVersion().
|
static |
Static singleton instance method.
This method returns the base class singleton instance member. It instantiates the singleton and sets the base class instance member upon first invocation.
Definition at line 32 of file d2_controller.cc.
Referenced by main(), and isc::d2::D2Process::run().
void isc::d2::D2Controller::registerCommands | ( | ) |
Register commands.
Definition at line 54 of file d2_controller.cc.
References isc::process::DControllerBase::buildReportHandler(), isc::process::DControllerBase::configGetHandler(), isc::process::DControllerBase::configReloadHandler(), isc::process::DControllerBase::configSetHandler(), isc::process::DControllerBase::configTestHandler(), isc::process::DControllerBase::configWriteHandler(), isc::process::DControllerBase::shutdownHandler(), and isc::process::DControllerBase::versionGetHandler().
Referenced by isc::d2::D2Process::run().
|
friend |
To facilitate unit testing.
Definition at line 87 of file d2_controller.h.
|
static |
Defines the application name, this is passed into base class and appears in log statements.
Defines the application name, this is passed into base class it may be used to locate configuration data and appears in log statement.
Definition at line 43 of file d2_controller.h.
|
static |
Defines the executable name.
Defines the executable name. This is passed into the base class.
This is passed into the base class by convention this should match the executable name.
Definition at line 47 of file d2_controller.h.