summaryrefslogtreecommitdiffstats
path: root/src/lib/database/database_connection.h
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2018-09-26 16:17:04 +0200
committerThomas Markwalder <tmark@isc.org>2018-10-05 15:05:44 +0200
commitd06703a96313ca355e6495b2e40e23555eec54b7 (patch)
tree51d04ebb1f18eb0c1cb4abcea17db7d0a160869a /src/lib/database/database_connection.h
parent[128-netconf-use-libprocess] Final update before merge (diff)
downloadkea-d06703a96313ca355e6495b2e40e23555eec54b7.tar.xz
kea-d06703a96313ca355e6495b2e40e23555eec54b7.zip
[#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
Diffstat (limited to 'src/lib/database/database_connection.h')
-rw-r--r--src/lib/database/database_connection.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/database/database_connection.h b/src/lib/database/database_connection.h
index 515e20c5b5..5770a14366 100644
--- a/src/lib/database/database_connection.h
+++ b/src/lib/database/database_connection.h
@@ -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;