Kea
1.9.9-git
|
Kea Netconf Application Process. More...
#include <netconf_process.h>
Public Member Functions | |
NetconfProcess (const char *name, const asiolink::IOServicePtr &io_service) | |
Constructor. More... | |
virtual | ~NetconfProcess () |
Destructor. More... | |
virtual isc::data::ConstElementPtr | configure (isc::data::ConstElementPtr config_set, bool check_only=false) |
Processes the given configuration. More... | |
NetconfCfgMgrPtr | getNetconfCfgMgr () |
Returns a pointer to the configuration manager. More... | |
virtual void | init () |
Initialize the Netconf process. More... | |
virtual void | run () |
Implements the process's event loop. More... | |
virtual isc::data::ConstElementPtr | shutdown (isc::data::ConstElementPtr args) |
Initiates the process's shutdown process. More... | |
Public Member Functions inherited from isc::process::DProcessBase | |
DProcessBase (const char *app_name, asiolink::IOServicePtr io_service, DCfgMgrBasePtr cfg_mgr) | |
Constructor. More... | |
virtual | ~DProcessBase () |
Destructor. More... | |
const std::string | getAppName () const |
Fetches the application name. More... | |
DCfgMgrBasePtr & | getCfgMgr () |
Fetches the process's configuration manager. More... | |
asiolink::IOServicePtr & | getIoService () |
Fetches the controller's IOService. More... | |
void | setShutdownFlag (bool value) |
Sets the process shut down flag to the given value. More... | |
bool | shouldShutdown () const |
Checks if the process has been instructed to shut down. More... | |
void | stopIOService () |
Convenience method for stopping IOservice processing. More... | |
Static Public Attributes | |
static std::atomic< bool > | shut_down |
Global (globally visible) shutdown flag. More... | |
Kea Netconf Application Process.
NetconfProcess provides top level application logic for the Netconf, a process managing Kea servers using YANG / NETCONF.
The Netconf receives YANG configuration change events, converts them to JSON commands sent to the respective Kea servers.
Definition at line 25 of file netconf_process.h.
isc::netconf::NetconfProcess::NetconfProcess | ( | const char * | name, |
const asiolink::IOServicePtr & | io_service | ||
) |
Constructor.
name | name is a text label for the process. Generally used in log statements, but otherwise arbitrary. |
io_service | is the io_service used by the caller for asynchronous event handling. |
Definition at line 31 of file netconf_process.cc.
|
virtual |
Destructor.
Definition at line 36 of file netconf_process.cc.
|
virtual |
Processes the given configuration.
This method may be called multiple times during the process lifetime. Certainly once during process startup, and possibly later if the user alters configuration. This method must not throw, it should catch any processing errors and return a success or failure answer as described below.
config_set | a new configuration (JSON) for the process |
check_only | true if configuration is to be verified only, not applied |
Implements isc::process::DProcessBase.
Definition at line 122 of file netconf_process.cc.
References isc::process::DProcessBase::getCfgMgr(), and isc::config::parseAnswer().
NetconfCfgMgrPtr isc::netconf::NetconfProcess::getNetconfCfgMgr | ( | ) |
Returns a pointer to the configuration manager.
Definition at line 132 of file netconf_process.cc.
References isc::process::DProcessBase::getCfgMgr().
Referenced by run().
|
virtual |
Initialize the Netconf process.
This is invoked by the controller after command line arguments but prior to configuration reception. The base class provides this method as a place to perform any derivation-specific initialization steps that are inappropriate for the constructor but necessary prior to launch.
Implements isc::process::DProcessBase.
Definition at line 40 of file netconf_process.cc.
|
virtual |
Implements the process's event loop.
DProcessBaseError | if an operational error is encountered. |
Implements isc::process::DProcessBase.
Definition at line 44 of file netconf_process.cc.
References isc::log::DBGLVL_START_SHUT, isc::process::DProcessBase::getIoService(), getNetconfCfgMgr(), isc::netconf::NetconfAgent::init(), isc::netconf::NetconfAgent::initSysrepo(), isc_throw, LOG_DEBUG, LOG_FATAL, LOG_INFO, isc::netconf::NETCONF_FAILED, isc::netconf::netconf_logger, isc::netconf::NETCONF_RUN_EXIT, isc::netconf::NETCONF_STARTED, isc::process::DProcessBase::shouldShutdown(), isc::process::DProcessBase::stopIOService(), and isc::Exception::what().
|
virtual |
Initiates the process's shutdown process.
This is last step in the shutdown event callback chain, that is intended to notify the process it is to begin its shutdown process.
args | an Element set of shutdown arguments (if any) that are supported by the process derivation. |
DProcessBaseError | if an operational error is encountered. |
Implements isc::process::DProcessBase.
Definition at line 115 of file netconf_process.cc.
References isc::config::createAnswer(), isc::process::DProcessBase::setShutdownFlag(), and shut_down.
|
static |
Global (globally visible) shutdown flag.
Definition at line 89 of file netconf_process.h.
Referenced by shutdown().