Kea 3.1.1
isc::subnet_cmds::ConfigDiffManager< SubnetConfigParserType > Class Template Reference

Manager which handles the delta (differences) between two subnets serialized as a JSON tree (usually a user provided subnet configuration and an already existing subnet configuration). More...

Public Member Functions

 ConfigDiffManager (std::string space)
 Constructor.
 
 ~ConfigDiffManager ()=default
 Destructor.
 
void processDelta (UpdateType type, ElementPtr &old_element, ConstElementPtr &subnet_element)
 Process the delta between existing configuration and user provided data.
 

Detailed Description

template<typename SubnetConfigParserType>
class isc::subnet_cmds::ConfigDiffManager< SubnetConfigParserType >

Manager which handles the delta (differences) between two subnets serialized as a JSON tree (usually a user provided subnet configuration and an already existing subnet configuration).

It uses an internal representation of the subnet parameters hierarchy to traverse the JSON tree, and functions to detect elements that match the same configuration element or to detect if the element itself is a key identifier of another configuration element. For more details, see isc::data::mergeDiffAdd isc::data::mergeDiffDel and isc::data::extend.

Template Parameters
SubnetConfigParserTypeOne of the Subnet4ConfigParser or Subnet6ConfigParser.

Definition at line 59 of file subnet_cmds.cc.

Constructor & Destructor Documentation

◆ ConfigDiffManager()

template<typename SubnetConfigParserType>
isc::subnet_cmds::ConfigDiffManager< SubnetConfigParserType >::ConfigDiffManager ( std::string space)
inline

Constructor.

Parameters
spaceThe type of configuration to handle (dhcp4 or dhcp6).

function which returns true if there are no other parameters in the subnet beside the identification keys: 'id' and 'subnet'.

function which returns true if there are no other parameters in the pool beside the identification keys: 'pool' and an empty 'option-data'.

function which returns true if there are no other parameters in the pd-pool beside the identification keys: 'prefix', 'prefix-len', 'delegated-len' and an empty 'option-data'.

function which returns true if there are no other parameters in the option beside the identification keys: 'code' and 'name' and 'space'.

function which returns true for any pair of configuration elements.

function which returns true if the pair of subnet elements refer to the same subnet in the configuration.

function which returns true if the pair of pool elements refer to the same pool in the configuration.

function which returns true if the pair of pd-pool elements refer to the same pd-pool in the configuration.

function which returns true if the pair of option elements refer to the same option in the configuration.

function which returns true if the parameter name is an identification key for the subnet.

function which returns true if the parameter name is an identification key for the pool.

function which returns true if the parameter name is an identification key for the pd-pool.

function which returns true if the parameter name is an identification key for the option.

Definition at line 65 of file subnet_cmds.cc.

References DHCP4_OPTION_SPACE, DHCP6_OPTION_SPACE, and isc_throw.

◆ ~ConfigDiffManager()

template<typename SubnetConfigParserType>
isc::subnet_cmds::ConfigDiffManager< SubnetConfigParserType >::~ConfigDiffManager ( )
default

Destructor.

Member Function Documentation

◆ processDelta()

template<typename SubnetConfigParserType>
void isc::subnet_cmds::ConfigDiffManager< SubnetConfigParserType >::processDelta ( UpdateType type,
ElementPtr & old_element,
ConstElementPtr & subnet_element )
inline

Process the delta between existing configuration and user provided data.

Parameters
typeThe type of merge performed.
old_elementThe configuration element which needs update.
subnet_elementThe user provided data containing only the desired configuration changes.

Definition at line 234 of file subnet_cmds.cc.

References isc::data::extend(), isc::data::mergeDiffAdd(), isc::data::mergeDiffDel(), isc::subnet_cmds::UPDATE_DELTA_ADD, and isc::subnet_cmds::UPDATE_DELTA_DEL.

+ Here is the call graph for this function:

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