Kea 2.5.8
isc::netconf::NetconfProcess Class Reference

Kea Netconf Application Process. More...

#include <netconf_process.h>

+ Inheritance diagram for isc::netconf::NetconfProcess:

Public Member Functions

 NetconfProcess (const char *name, const asiolink::IOServicePtr &io_service)
 Constructor.
 
virtual ~NetconfProcess ()=default
 Destructor.
 
isc::data::ConstElementPtr configure (isc::data::ConstElementPtr config_set, bool check_only=false) override final
 Processes the given configuration.
 
NetconfCfgMgrPtr getNetconfCfgMgr ()
 Returns a pointer to the configuration manager.
 
void init () override final
 Initialize the Netconf process.
 
void run () override final
 Implements the process's event loop.
 
isc::data::ConstElementPtr shutdown (isc::data::ConstElementPtr args) override final
 Initiates the process's shutdown process.
 
- Public Member Functions inherited from isc::process::DProcessBase
 DProcessBase (const char *app_name, asiolink::IOServicePtr io_service, DCfgMgrBasePtr cfg_mgr)
 Constructor.
 
virtual ~DProcessBase ()
 Destructor.
 
virtual isc::data::ConstElementPtr configure (isc::data::ConstElementPtr config_set, bool check_only=false)=0
 Processes the given configuration.
 
const std::string getAppName () const
 Fetches the application name.
 
DCfgMgrBasePtrgetCfgMgr ()
 Fetches the process's configuration manager.
 
asiolink::IOServicePtrgetIOService ()
 Fetches the controller's IOService.
 
virtual void init ()=0
 May be used after instantiation to perform initialization unique to application.
 
virtual void run ()=0
 Implements the process's event loop.
 
void setShutdownFlag (bool value)
 Sets the process shut down flag to the given value.
 
bool shouldShutdown () const
 Checks if the process has been instructed to shut down.
 
virtual isc::data::ConstElementPtr shutdown (isc::data::ConstElementPtr args)=0
 Initiates the process's shutdown process.
 
void stopIOService ()
 Convenience method for stopping IOservice processing.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ NetconfProcess()

isc::netconf::NetconfProcess::NetconfProcess ( const char *  name,
const asiolink::IOServicePtr io_service 
)

Constructor.

Parameters
namename is a text label for the process. Generally used in log statements, but otherwise arbitrary.
io_serviceis the io_service used by the caller for asynchronous event handling.

Definition at line 28 of file netconf_process.cc.

◆ ~NetconfProcess()

virtual isc::netconf::NetconfProcess::~NetconfProcess ( )
virtualdefault

Destructor.

Member Function Documentation

◆ configure()

isc::data::ConstElementPtr isc::netconf::NetconfProcess::configure ( isc::data::ConstElementPtr  config_set,
bool  check_only = false 
)
finaloverridevirtual

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.

Parameters
config_seta new configuration (JSON) for the process
check_onlytrue if configuration is to be verified only, not applied
Returns
an Element that contains the results of configuration composed of an integer status value (0 means successful, non-zero means failure), and a string explanation of the outcome.

Implements isc::process::DProcessBase.

Definition at line 82 of file netconf_process.cc.

References isc::process::DProcessBase::getCfgMgr(), and isc::config::parseAnswer().

+ Here is the call graph for this function:

◆ getNetconfCfgMgr()

NetconfCfgMgrPtr isc::netconf::NetconfProcess::getNetconfCfgMgr ( )

Returns a pointer to the configuration manager.

Definition at line 92 of file netconf_process.cc.

References isc::process::DProcessBase::getCfgMgr().

Referenced by run().

+ Here is the call graph for this function:

◆ init()

void isc::netconf::NetconfProcess::init ( )
finaloverridevirtual

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 34 of file netconf_process.cc.

◆ run()

void isc::netconf::NetconfProcess::run ( )
finaloverridevirtual

◆ shutdown()

isc::data::ConstElementPtr isc::netconf::NetconfProcess::shutdown ( isc::data::ConstElementPtr  args)
finaloverridevirtual

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.

Parameters
argsan Element set of shutdown arguments (if any) that are supported by the process derivation.
Returns
an Element that contains the results of argument processing, consisting of an integer status value (0 means successful, non-zero means failure), and a string explanation of the outcome.
Exceptions
DProcessBaseErrorif an operational error is encountered.

Implements isc::process::DProcessBase.

Definition at line 76 of file netconf_process.cc.

References isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), and isc::process::DProcessBase::setShutdownFlag().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: