16 ConfigDbInfo::setAccessString(
const std::string& access_str) {
17 access_str_ = access_str;
18 access_params_.clear();
24 return (access_params_ == other.access_params_);
28 ConfigDbInfo::toElement()
const {
33 ConfigDbInfo::getParameterValue(
const std::string& name, std::string& value)
const {
34 auto param = access_params_.find(name);
35 if (param == access_params_.end()) {
39 value = param->second;
46 for (
auto db : other.db_infos_) {
47 addConfigDatabase(db.getAccessString());
52 ConfigControlInfo::addConfigDatabase(
const std::string& access_str) {
56 for (
auto db : db_infos_) {
60 << access_str <<
" already exists");
64 db_infos_.push_back(new_db);
68 ConfigControlInfo::findConfigDb(
const std::string& param_name,
69 const std::string& param_value) {
70 for (ConfigDbInfoList::iterator db = db_infos_.begin();
71 db != db_infos_.end(); ++db) {
73 if (db->getParameterValue(param_name, db_value) &&
74 (param_value == db_value)) {
83 ConfigControlInfo::EMPTY_DB() {
89 ConfigControlInfo::clear() {
94 ConfigControlInfo::toElement()
const {
97 for (
auto db_info : db_infos_) {
98 db_list->add(db_info.toElement());
101 result->set(
"config-databases", db_list);
107 return (db_infos_ == other.db_infos_);
Embodies configuration information used during a server's configuration process.
boost::shared_ptr< Element > ElementPtr
void setAccessString(const std::string &access_str)
Set the access string.
static ParameterMap parse(const std::string &dbaccess)
Parse database access string.
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
static isc::data::ElementPtr toElementDbAccessString(const std::string &dbaccess)
Unparse an access string.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Provides configuration information used during a server's configuration process.