26template<
typename ConfigBackendMgrType>
46 static bool translateName(std::string
const& name, std::string& param_name,
47 std::string& sub_param_name) {
49 sub_param_name = std::string();
50 auto pos = param_name.find(
'.');
51 if (pos != std::string::npos) {
52 sub_param_name = param_name.substr(pos + 1);
53 param_name = param_name.substr(0, pos);
78 for (
auto const& cb_global : index) {
79 if (cb_global->amNull()) {
85 data::ElementPtr mutable_value = boost::const_pointer_cast<data::Element>(value);
86 if (global_lists.count(cb_global->getName())) {
90 std::string param_name;
91 std::string sub_param_name;
92 if (
translateName(cb_global->getName(), param_name, sub_param_name)) {
93 data::ElementPtr sub_param = boost::const_pointer_cast<data::Element>(external_cfg->getConfiguredGlobal(param_name));
97 sub_param->set(sub_param_name, global_value);
98 external_cfg->addConfiguredGlobal(param_name, sub_param);
101 external_cfg->addConfiguredGlobal(param_name, global_value);
static ElementPtr fromJSON(const std::string &in, bool preproc=false)
These functions will parse the given string (JSON) representation of a compound element.
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
static bool translateName(std::string const &name, std::string ¶m_name, std::string &sub_param_name)
It translates the top level map parameters from flat naming format (e.g.
CBControlDHCP()
Constructor.
void translateAndAddGlobalsToConfig(SrvConfigPtr external_cfg, data::StampedValueCollection &cb_globals, data::SimpleKeywords global_lists) const
It translates the top level map parameters from flat naming format (e.g.
Base class for implementing server specific mechanisms to control the use of the Configuration Backen...
CBControlBase()
Constructor.
boost::multi_index_container< StampedValuePtr, boost::multi_index::indexed_by< boost::multi_index::hashed_non_unique< boost::multi_index::tag< StampedValueNameIndexTag >, boost::multi_index::const_mem_fun< StampedValue, std::string, &StampedValue::getName > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< StampedValueModificationTimeIndexTag >, boost::multi_index::const_mem_fun< BaseStampedElement, boost::posix_time::ptime, &BaseStampedElement::getModificationTime > > > > StampedValueCollection
Multi index container for StampedValue.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< Element > ElementPtr
std::map< std::string, isc::data::Element::types > SimpleKeywords
This specifies all accepted keywords with their types.
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
Defines the logger used by the top-level component of kea-lfc.
Tag for the index for access by value name.