2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-05 16:35:23 +00:00

[#32,!23] Added ControlConfigInfo to lib/config

src/lib/config/config_ctl_info.*
    New files, implementing ConfigDbInfo and ConfigControlInfo
    classes use for housing configuration backend and control
    information

src/lib/config/Makefile.am
    Added config_ctl_info.h/cc
    Added libkea-database.la

src/lib/config/tests/config_ctl_info_unitests.cc
    New file which unit tests new classes

src/lib/database/database_connection.*
    DatabaseConnection::toElement(const ParameterMap& params) - new
    static function which turns a parameter map into Elements

    DatabaseConnection::toElementDbAccessString(const std::string& dbaccess)
    - new static function which turns an access string into Elements

src/lib/database/dbaccess_parser.*
    Replaced StringPairMap with DatabaseConnection::ParameterMap

src/lib/database/tests/database_connection_unittest.cc
    TEST(DatabaseConnection, toElementDbAccessStringValid)
    TEST(DatabaseConnection, toElementDbAccessStringInvalid)
    TEST(DatabaseConnection, toElementDbAccessStringEmpty) - new tests

src/lib/dhcpsrv/cfg_db_access.*
    CfgDbAccess::toElementDbAccessString() - moved to
    lib/database/database_connection.cc so it can be shared
This commit is contained in:
Thomas Markwalder
2018-09-26 10:17:04 -04:00
parent 76b1ffb9e9
commit d06703a963
13 changed files with 575 additions and 89 deletions

View File

@@ -7,6 +7,7 @@
#ifndef DATABASE_CONNECTION_H
#define DATABASE_CONNECTION_H
#include <cc/data.h>
#include <boost/noncopyable.hpp>
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
@@ -96,7 +97,7 @@ public:
return (retries_left_ ? --retries_left_ : false);
}
/// @brief Returns the maximum number for retries allowed
/// @brief Returns the maximum number for retries allowed
unsigned int maxRetries() {
return (max_retries_);
}
@@ -215,6 +216,18 @@ public:
/// callback.
bool invokeDbLostCallback() const;
/// @brief Unparse a parameter map
///
/// @param params the parameter map to unparse
/// @return a pointer to configuration
static isc::data::ElementPtr toElement(const ParameterMap& params);
/// @brief Unparse an access string
///
/// @param dbaccess the database access string
/// @return a pointer to configuration
static isc::data::ElementPtr toElementDbAccessString(const std::string& dbaccess);
/// @brief Optional call back function to invoke if a successfully
/// open connection subsequently fails
static DbLostCallback db_lost_callback;