Kea 2.7.5
|
Process Controller for Netconf Process. More...
#include <netconf_controller.h>
Public Member Functions | |
virtual | ~NetconfController ()=default |
Destructor. | |
NetconfProcessPtr | getNetconfProcess () |
Returns pointer to an instance of the underlying process object. | |
isc::data::ConstElementPtr | parseFile (const std::string &name) override final |
Parses the configuration file using Netconf::ParserContext (bison) | |
void | processSignal (int signum) override final |
Redefined application-level signal processing method. | |
Public Member Functions inherited from isc::process::DControllerBase | |
DControllerBase (const char *app_name, const char *bin_name) | |
Constructor. | |
virtual | ~DControllerBase () |
Destructor. | |
isc::data::ConstElementPtr | buildReportHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for 'build-report' command | |
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. | |
virtual isc::data::ConstElementPtr | configFromFile () |
Reconfigures the process from a configuration file. | |
isc::data::ConstElementPtr | configGetHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for config-get command | |
isc::data::ConstElementPtr | configHashGetHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for config-hash-get command | |
isc::data::ConstElementPtr | configReloadHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for config-reload command | |
isc::data::ConstElementPtr | configSetHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for config-set command | |
isc::data::ConstElementPtr | configTestHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for config-test command | |
isc::data::ConstElementPtr | configWriteHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for config-write command | |
std::string | getAppName () const |
Fetches the name of the application under control. | |
std::string | getBinName () const |
Fetches the name of the application executable. | |
std::string | getVersion (bool extended) |
returns Kea version on stdout and exit. | |
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: | |
isc::data::ConstElementPtr | serverTagGetHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for server-tag-get command | |
isc::data::ConstElementPtr | shutdownHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for 'shutdown' command | |
isc::data::ConstElementPtr | statusGetHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for status-get command | |
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. | |
isc::data::ConstElementPtr | versionGetHandler (const std::string &command, isc::data::ConstElementPtr args) |
handler for version-get command | |
Public Member Functions inherited from isc::process::Daemon | |
Daemon () | |
Default constructor. | |
virtual | ~Daemon () |
Destructor. | |
void | checkConfigFile () const |
Checks the configuration file name. | |
virtual void | cleanup () |
Performs final deconfiguration. | |
void | createPIDFile (int pid=0) |
Creates the PID file. | |
std::string | getConfigFile () const |
Returns config file name. | |
int | getExitValue () |
Fetches the exit value. | |
std::string | getPIDFileDir () const |
Returns the directory used when forming default PID file name. | |
std::string | getPIDFileName () const |
Returns the current PID file name. | |
virtual std::list< std::list< std::string > > | jsonPathsToRedact () const |
Return a list of all paths that contain passwords or secrets. | |
isc::data::ConstElementPtr | redactConfig (isc::data::ConstElementPtr const &config) |
Redact a configuration. | |
void | setConfigFile (const std::string &config_file) |
Sets the configuration file name. | |
void | setExitValue (int value) |
Sets the exit value. | |
void | setPIDFileDir (const std::string &pid_file_dir) |
Sets the PID file directory. | |
void | setPIDFileName (const std::string &pid_file_name) |
Sets PID file name. | |
virtual void | shutdown () |
Initiates shutdown procedure for the whole server. | |
virtual size_t | writeConfigFile (const std::string &config_file, isc::data::ConstElementPtr cfg=isc::data::ConstElementPtr()) const |
Writes current configuration to specified file. | |
Static Public Member Functions | |
static process::DControllerBasePtr & | instance () |
Static singleton instance method. | |
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. | |
static std::string | getDefaultLoggerName () |
Returns default logger name. | |
static std::string | getProcName () |
returns the process name This value is used as when forming the default PID file name | |
static bool | getVerbose () |
Returns if running in verbose mode. | |
static std::string | getVersion (bool extended) |
returns Kea version on stdout and exits. | |
static void | loggerInit (const char *log_name, bool verbose) |
Initializes logger. | |
static void | setDefaultLoggerName (const std::string &logger) |
Sets the default logger name. | |
static void | setProcName (const std::string &proc_name) |
Sets the process name. | |
static void | setVerbose (const bool verbose) |
Sets or clears verbose mode. | |
Static Public Attributes | |
static const char * | netconf_app_name_ = "Netconf" |
Defines the application name, this is passed into base class and appears in log statements. | |
static const char * | netconf_bin_name_ = "kea-netconf" |
Defines the executable name. | |
Additional Inherited Members | |
Protected Member Functions inherited from isc::process::DControllerBase | |
void | checkConfigOnly () |
Check the configuration. | |
virtual bool | customOption (int option, char *optarg) |
Virtual method that provides derivations the opportunity to support additional command line options. | |
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. | |
asiolink::IOServicePtr & | getIOService () |
Getter for fetching the controller's IOService. | |
DProcessBasePtr | getProcess () |
Fetches the current process. | |
virtual const std::string | getUsageText () const |
Virtual method which can be used to contribute derivation specific usage text. | |
virtual std::string | getVersionAddendum () |
Fetches text containing additional version specifics. | |
std::string | handleOtherObjects (isc::data::ConstElementPtr args) |
Deals with other (i.e. | |
void | initProcess () |
Instantiates the application process and then initializes it. | |
void | initSignalHandling () |
Initializes signal handling. | |
bool | isCheckOnly () const |
Supplies whether or not check only mode is enabled. | |
bool | isVerbose () const |
Supplies whether or not verbose logging is enabled. | |
void | parseArgs (int argc, char *argv[]) |
Processes the command line arguments. | |
virtual isc::data::ConstElementPtr | parseText (const std::string &input) |
Parse text into Elements. | |
void | runProcess () |
Invokes the application process's event loop,(DBaseProcess::run). | |
void | setCheckOnly (bool value) |
Method for enabling or disabling check only mode. | |
void | setVerbose (bool value) |
Method for enabling or disabling verbose logging. | |
isc::data::ConstElementPtr | shutdownProcess (isc::data::ConstElementPtr args) |
Initiates shutdown procedure. | |
void | usage (const std::string &text) |
Prints the program usage text to std error. | |
Protected Member Functions inherited from isc::process::Daemon | |
std::string | makePIDFileName () const |
Manufacture the pid file name. | |
Static Protected Member Functions inherited from isc::process::DControllerBase | |
static DControllerBasePtr & | getController () |
Static getter which returns the singleton instance. | |
static void | setController (const DControllerBasePtr &controller) |
Static setter which sets the singleton instance. | |
Protected Attributes inherited from isc::process::Daemon | |
isc::asiolink::IOSignalSetPtr | signal_set_ |
A pointer to the object installing custom signal handlers. | |
boost::posix_time::ptime | start_ |
Timestamp of the start of the daemon. | |
Process Controller for Netconf Process.
This class is the Netconf specific derivation of the DControllerBase. It creates and manages an instance of the Netconf application process, NetconfProcess.
Definition at line 21 of file netconf_controller.h.
|
virtualdefault |
Destructor.
NetconfProcessPtr isc::netconf::NetconfController::getNetconfProcess | ( | ) |
Returns pointer to an instance of the underlying process object.
Definition at line 67 of file netconf_controller.cc.
References isc::process::DControllerBase::getProcess().
|
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 29 of file netconf_controller.cc.
References isc::process::DControllerBase::getController(), and isc::process::DControllerBase::setController().
Referenced by isc::netconf::NetconfAgent::announceShutdown(), main(), and isc::netconf::NetconfAgent::shouldShutdown().
|
finaloverridevirtual |
Parses the configuration file using Netconf::ParserContext (bison)
name | name of the text file to be parsed |
Reimplemented from isc::process::DControllerBase.
Definition at line 57 of file netconf_controller.cc.
References isc::netconf::ParserContext::parseFile(), and isc::netconf::ParserContext::PARSER_NETCONF.
|
finaloverridevirtual |
Redefined application-level signal processing method.
This method ignores SIGHUP as configuration reloading is not yet supported.
signum | signal number to process. |
Reimplemented from isc::process::DControllerBase.
Definition at line 41 of file netconf_controller.cc.
References isc::process::dctl_logger, isc::process::DCTL_UNSUPPORTED_SIGNAL, LOG_WARN, and isc::process::DControllerBase::processSignal().
|
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 40 of file netconf_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 44 of file netconf_controller.h.