]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#92,!13] Moved CqlConnection and CqlExchange classes to libkea-cql.
authorMarcin Siodelski <marcin@isc.org>
Thu, 30 Aug 2018 10:49:34 +0000 (12:49 +0200)
committerMarcin Siodelski <marcin@isc.org>
Mon, 3 Sep 2018 07:31:34 +0000 (03:31 -0400)
32 files changed:
configure.ac
src/bin/d2/Makefile.am
src/bin/d2/tests/Makefile.am
src/bin/dhcp4/Makefile.am
src/bin/dhcp4/tests/Makefile.am
src/bin/dhcp6/Makefile.am
src/bin/dhcp6/tests/Makefile.am
src/bin/lfc/Makefile.am
src/bin/lfc/tests/Makefile.am
src/lib/Makefile.am
src/lib/cql/Makefile.am [new file with mode: 0644]
src/lib/cql/cql_connection.cc [moved from src/lib/dhcpsrv/cql_connection.cc with 99% similarity]
src/lib/cql/cql_connection.h [moved from src/lib/dhcpsrv/cql_connection.h with 99% similarity]
src/lib/cql/cql_exchange.cc [moved from src/lib/dhcpsrv/cql_exchange.cc with 99% similarity]
src/lib/cql/cql_exchange.h [moved from src/lib/dhcpsrv/cql_exchange.h with 98% similarity]
src/lib/cql/sql_common.h [moved from src/lib/dhcpsrv/sql_common.h with 94% similarity]
src/lib/cql/tests/.gitignore [new file with mode: 0644]
src/lib/cql/tests/Makefile.am [new file with mode: 0644]
src/lib/cql/tests/cql_connection_unittest.cc [moved from src/lib/dhcpsrv/tests/cql_connection_unittest.cc with 86% similarity]
src/lib/cql/tests/run_unittests.cc [new file with mode: 0644]
src/lib/dhcpsrv/Makefile.am
src/lib/dhcpsrv/cql_host_data_source.cc
src/lib/dhcpsrv/cql_host_data_source.h
src/lib/dhcpsrv/cql_lease_mgr.h
src/lib/dhcpsrv/lease_mgr.h
src/lib/dhcpsrv/tests/Makefile.am
src/lib/dhcpsrv/tests/cql_host_data_source_unittest.cc
src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc
src/lib/dhcpsrv/testutils/cql_schema.cc
src/lib/mysql/Makefile.am
src/lib/pgsql/Makefile.am
src/lib/process/Makefile.am

index 707c65e249e9cf76be19be79e315d8a10bfbeb7b..0dc860ea61a780a55544414a504ceccf756d064a 100644 (file)
@@ -1575,6 +1575,8 @@ AC_CONFIG_FILES([Makefile
                  src/lib/mysql/Makefile
                  src/lib/pgsql/Makefile
                  src/lib/pgsql/tests/Makefile
+                 src/lib/cql/Makefile
+                 src/lib/cql/tests/Makefile
                  src/lib/process/Makefile
                  src/lib/process/tests/Makefile
                  src/lib/process/testutils/Makefile
index f529ae55a8961117d75b3f8a429df7e26518c62c..2cea3a72329416546d84c774ffed1b731026fa56 100644 (file)
@@ -104,6 +104,9 @@ endif
 if HAVE_PGSQL
 kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
 endif
+if HAVE_CQL
+kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
 
 kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
 kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
index 609ca8ed579189d9273b0bb91101e712272a6630..ac2962469e942957f7b9f5e6bb72a69cff17b0e4 100644 (file)
@@ -92,6 +92,9 @@ endif
 if HAVE_PGSQL
 d2_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
 endif
+if HAVE_CQL
+d2_unittests_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
 
 d2_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
index b2376041f025dc8d06a0c53731b469ff7ab31727..c975976aa4af45f3ed502b5d35cc4a71fc47db62 100644 (file)
@@ -91,6 +91,9 @@ endif
 if HAVE_PGSQL
 kea_dhcp4_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
 endif
+if HAVE_CQL
+kea_dhcp4_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
 
 kea_dhcp4_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
 kea_dhcp4_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
index f913edf33039ac612e5cc109c39487096058e414..c2361434384bd8120493daf4caa7f5b66e25b467 100644 (file)
@@ -138,6 +138,9 @@ endif
 if HAVE_PGSQL
 dhcp4_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
 endif
+if HAVE_CQL
+dhcp4_unittests_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
 
 dhcp4_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
 dhcp4_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
index a6247078248e8232e4f322a517fddcaecd9582e5..e752b93b546c719cd773b605773f16930606073a 100644 (file)
@@ -91,6 +91,9 @@ endif
 if HAVE_PGSQL
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
 endif
+if HAVE_CQL
+kea_dhcp6_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
 
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
index 119fa169bccbb80445ed52384d0d858993645e71..e6af5b61f6c0933d15dc5c414501e684e9fccaa2 100644 (file)
@@ -142,6 +142,9 @@ endif
 if HAVE_PGSQL
 dhcp6_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
 endif
+if HAVE_CQL
+dhcp6_unittests_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
 
 dhcp6_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
 dhcp6_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
index 33c3db56e4856e4d4bcb84859e22ac458d2bfbdd..463c7be8c25921745c988ebc37bfaceb1cb56413 100644 (file)
@@ -68,6 +68,9 @@ endif
 if HAVE_PGSQL
 kea_lfc_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
 endif
+if HAVE_CQL
+kea_lfc_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
 
 kea_lfc_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
 kea_lfc_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
index 6f7a95576403d16c89407a98ed6517e31bc3d5a3..59b7465b6f20dee6f8da5f078ed17f2b8b9507a6 100644 (file)
@@ -68,6 +68,9 @@ endif
 if HAVE_PGSQL
 lfc_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
 endif
+if HAVE_CQL
+lfc_unittests_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
 
 
 lfc_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
index 14ecc0bb928eef90e1959625e82acfe5cbe82939..0373e3f820d1df48289b5b6e8c2fdb9b7318fc72 100644 (file)
@@ -9,6 +9,10 @@ if HAVE_PGSQL
 SUBDIRS += pgsql
 endif
 
+if HAVE_CQL
+SUBDIRS += cql
+endif
+
 SUBDIRS += testutils hooks dhcp config stats asiodns dhcp_ddns eval \
        dhcpsrv cfgrpt \
        process http
diff --git a/src/lib/cql/Makefile.am b/src/lib/cql/Makefile.am
new file mode 100644 (file)
index 0000000..28856fd
--- /dev/null
@@ -0,0 +1,33 @@
+SUBDIRS = . tests
+
+AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES) $(CQL_CPPFLAGS)
+
+AM_CXXFLAGS = $(KEA_CXXFLAGS)
+
+CLEANFILES = *.gcno *.gcda
+
+lib_LTLIBRARIES = libkea-cql.la
+libkea_cql_la_SOURCES  = cql_connection.cc cql_connection.h
+libkea_cql_la_SOURCES += cql_exchange.cc cql_exchange.h
+libkea_cql_la_SOURCES += sql_common.h
+
+libkea_cql_la_LIBADD  = $(top_builddir)/src/lib/database/libkea-database.la
+libkea_cql_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
+libkea_cql_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
+libkea_cql_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
+libkea_cql_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
+libkea_cql_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
+libkea_cql_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
+libkea_cql_la_LIBADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS)
+
+libkea_cql_la_LDFLAGS = -no-undefined -version-info 0:0:0
+
+libkea_cql_la_LDFLAGS += $(CQL_LIBS)
+
+# Specify the headers for copying into the installation directory tree.
+libkea_cql_includedir = $(pkgincludedir)/cql
+libkea_cql_include_HEADERS = \
+       cql_connection.h \
+       cql_exchange.h \
+       sql_common.h
similarity index 99%
rename from src/lib/dhcpsrv/cql_connection.cc
rename to src/lib/cql/cql_connection.cc
index 3c32cff8208b20c74e2e3988274290089fa16c96..e60da1d8b22567f83c1b5c07e430a8c07d0d687f 100644 (file)
 
 #include <config.h>
 
+#include <cql/cql_connection.h>
+#include <cql/cql_exchange.h>
 #include <database/db_exceptions.h>
 #include <database/db_log.h>
-#include <dhcpsrv/cql_connection.h>
-#include <dhcpsrv/cql_exchange.h>
 
 #include <string>
 
-using namespace isc::db;
-
 namespace isc {
-namespace dhcp {
+namespace db {
 
 CqlConnection::CqlConnection(const ParameterMap& parameters)
     : DatabaseConnection(parameters), statements_(), cluster_(NULL),
similarity index 99%
rename from src/lib/dhcpsrv/cql_connection.h
rename to src/lib/cql/cql_connection.h
index f7bb96313352612e50f90d6f65030611adc032ca..fa70ff90cf84d6d40c2f326e92c752c4666d547d 100644 (file)
@@ -32,7 +32,7 @@
 #include <vector>
 
 namespace isc {
-namespace dhcp {
+namespace db {
 
 /// @brief Pair containing major and minor versions
 /// @todo: This is already defined in lease_mgr.h. Need to have one
@@ -211,7 +211,7 @@ public:
 
 typedef std::shared_ptr<CqlConnection> CqlConnectionPtr;
 
-}  // namespace dhcp
+}  // namespace db
 }  // namespace isc
 
 #endif  // CQL_CONNECTION_H
similarity index 99%
rename from src/lib/dhcpsrv/cql_exchange.cc
rename to src/lib/cql/cql_exchange.cc
index 75a5a8911cf254cddd85e2f74c5fa80007147b07..41d82f5df09459c7e98c19ce535f31095a7dbb02 100644 (file)
 
 #include <config.h>
 
+#include <cql/cql_connection.h>
+#include <cql/cql_exchange.h>
+#include <cql/sql_common.h>
 #include <database/db_exceptions.h>
-#include <dhcpsrv/cql_connection.h>
-#include <dhcpsrv/cql_exchange.h>
-#include <dhcpsrv/sql_common.h>
 
 #include <boost/multi_index/hashed_index.hpp>
 #include <boost/multi_index/member.hpp>
 #include <utility>
 #include <vector>
 
-using namespace isc::db;
-
 namespace isc {
-namespace dhcp {
+namespace db {
 
 /// @brief Macro to return directly from caller function
 #define KEA_CASS_CHECK(cass_error)   \
@@ -1007,5 +1005,5 @@ CqlVersionExchange::retrieveVersion(const CqlConnection& connection) {
     return VersionPair();
 }
 
-}  // namespace dhcp
+}  // namespace db
 }  // namespace isc
similarity index 98%
rename from src/lib/dhcpsrv/cql_exchange.h
rename to src/lib/cql/cql_exchange.h
index c99f762e41a67f7c8f74d5937ebcc881053c4721..f30413e6c80e9c83f7bc3b19e7d783125faef27c 100644 (file)
@@ -1,3 +1,4 @@
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
 // Copyright (C) 2016-2017 Deutsche Telekom AG.
 //
 // Authors: Razvan Becheriu <razvan.becheriu@qualitance.com>
@@ -18,8 +19,8 @@
 #ifndef CQL_EXCHANGE_H
 #define CQL_EXCHANGE_H
 
-#include <dhcpsrv/cql_connection.h>
-#include <dhcpsrv/sql_common.h>
+#include <cql/cql_connection.h>
+#include <cql/sql_common.h>
 
 #include <boost/any.hpp>  // for boost::any
 
@@ -30,7 +31,7 @@
 #include <vector>
 
 namespace isc {
-namespace dhcp {
+namespace db {
 
 /// @brief Host identifier converted to Cassandra data type
 typedef std::vector<cass_byte_t> CassBlob;
@@ -318,7 +319,7 @@ exchangeType(const boost::any& object);
 ExchangeDataType
 exchangeType(const CassValueType& type);
 
-}  // namespace dhcp
+}  // namespace db
 }  // namespace isc
 
 #endif  // CQL_EXCHANGE_H
similarity index 94%
rename from src/lib/dhcpsrv/sql_common.h
rename to src/lib/cql/sql_common.h
index 610abd62e105fc7a344b58d52adada9d69147278..a9e7e3865dd6dcc5884205b88bc99ccb2562768c 100644 (file)
@@ -1,3 +1,4 @@
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
 // Copyright (C) 2016-2017 Deutsche Telekom AG.
 //
 // Author: Cristian Secăreanu <cristian.secareanu@qualitance.com>
@@ -18,7 +19,7 @@
 #define SQL_COMMON_H
 
 namespace isc {
-namespace dhcp {
+namespace db {
 
 /// @brief Used to map server data types with internal backend storage data
 /// types.
@@ -49,7 +50,7 @@ public:
     }
 };
 
-}  // namespace dhcp
+}  // namespace db
 }  // namespace isc
 
 #endif  // SQL_COMMON_H
diff --git a/src/lib/cql/tests/.gitignore b/src/lib/cql/tests/.gitignore
new file mode 100644 (file)
index 0000000..248092a
--- /dev/null
@@ -0,0 +1 @@
+/libcql_unittests
diff --git a/src/lib/cql/tests/Makefile.am b/src/lib/cql/tests/Makefile.am
new file mode 100644 (file)
index 0000000..cc96dfb
--- /dev/null
@@ -0,0 +1,38 @@
+SUBDIRS = .
+
+AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
+
+AM_CXXFLAGS = $(KEA_CXXFLAGS)
+
+if USE_STATIC_LINK
+AM_LDFLAGS = -static
+endif
+
+CLEANFILES = *.gcno *.gcda
+
+TESTS_ENVIRONMENT = \
+       $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+
+TESTS =
+if HAVE_GTEST
+TESTS += libcql_unittests
+
+libcql_unittests_SOURCES  = cql_connection_unittest.cc
+libcql_unittests_SOURCES += run_unittests.cc
+
+libcql_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(CQL_CPPFLAGS)
+libcql_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) $(CQL_LIBS)
+
+libcql_unittests_LDADD  = $(top_builddir)/src/lib/cql/libkea-cql.la
+libcql_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
+libcql_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
+libcql_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+libcql_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
+libcql_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
+libcql_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
+libcql_unittests_LDADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
+
+endif
+
+noinst_PROGRAMS = $(TESTS)
similarity index 86%
rename from src/lib/dhcpsrv/tests/cql_connection_unittest.cc
rename to src/lib/cql/tests/cql_connection_unittest.cc
index 5d66802431c9a6a2f1048dbe1f2e26cd6893aa55..a35717db392cf615d0ff6cc0c5158c2a0cfb9c80 100644 (file)
@@ -1,3 +1,4 @@
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
 // Copyright (C) 2017 Deutsche Telekom AG.
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
@@ -6,8 +7,8 @@
 
 #include <config.h>
 
-#include <dhcpsrv/cql_connection.h>
-#include <dhcpsrv/cql_exchange.h>
+#include <cql/cql_connection.h>
+#include <cql/cql_exchange.h>
 
 #include <cstring>
 
 
 namespace {
 
-using isc::dhcp::CqlTaggedStatement;
-using isc::dhcp::StatementMap;
-using isc::dhcp::StatementTag;
-using isc::dhcp::StatementTagHash;
-using isc::dhcp::exchangeType;
+using isc::db::CqlTaggedStatement;
+using isc::db::StatementMap;
+using isc::db::StatementTag;
+using isc::db::StatementTagHash;
+using isc::db::exchangeType;
 
 class CqlConnectionTest {
 public:
diff --git a/src/lib/cql/tests/run_unittests.cc b/src/lib/cql/tests/run_unittests.cc
new file mode 100644 (file)
index 0000000..4e83d4b
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#include <config.h>
+
+#include <log/logger_support.h>
+#include <gtest/gtest.h>
+
+int
+main(int argc, char* argv[]) {
+    ::testing::InitGoogleTest(&argc, argv);
+    isc::log::initLogger();
+
+    int result = RUN_ALL_TESTS();
+
+    return (result);
+}
index f6ccf6217474647b625dc68f993e7a8cde931c0a..d9a6961a933ca876893b37dca4bdfcb702291535 100644 (file)
@@ -134,7 +134,6 @@ libkea_dhcpsrv_la_SOURCES += logging.cc logging.h
 libkea_dhcpsrv_la_SOURCES += logging_info.cc logging_info.h
 libkea_dhcpsrv_la_SOURCES += memfile_lease_mgr.cc memfile_lease_mgr.h
 libkea_dhcpsrv_la_SOURCES += memfile_lease_storage.h
-libkea_dhcpsrv_la_SOURCES += sql_common.h
 
 if HAVE_MYSQL
 libkea_dhcpsrv_la_SOURCES += mysql_lease_mgr.cc mysql_lease_mgr.h
@@ -151,8 +150,6 @@ libkea_dhcpsrv_la_SOURCES += pgsql_lease_mgr.cc pgsql_lease_mgr.h
 endif
 
 if HAVE_CQL
-libkea_dhcpsrv_la_SOURCES += cql_connection.cc cql_connection.h
-libkea_dhcpsrv_la_SOURCES += cql_exchange.cc cql_exchange.h
 libkea_dhcpsrv_la_SOURCES += cql_host_data_source.cc cql_host_data_source.h
 libkea_dhcpsrv_la_SOURCES += cql_lease_mgr.cc cql_lease_mgr.h
 endif
@@ -219,6 +216,9 @@ endif
 if HAVE_PGSQL
 libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
 endif
+if HAVE_CQL
+libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
 
 libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/database/libkea-database.la
 libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/log/libkea-log.la
@@ -302,7 +302,6 @@ libkea_dhcpsrv_include_HEADERS = \
        network_state.h \
        pool.h \
        shared_network.h \
-       sql_common.h \
        srv_config.h \
        subnet.h \
        subnet_id.h \
@@ -314,8 +313,6 @@ libkea_dhcpsrv_include_HEADERS = \
 
 if HAVE_CQL
 libkea_dhcpsrv_include_HEADERS += \
-       cql_connection.h \
-       cql_exchange.h \
        cql_host_data_source.h \
        cql_lease_mgr.h
 endif
index 56ad30ca2045750f52b1f6b5921a574d712261ec..a67d650fd8e818ff823a3956e1eb96fee76d0601 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <config.h>
 
+#include <cql/cql_exchange.h>
 #include <database/db_exceptions.h>
 #include <dhcpsrv/cql_host_data_source.h>
 #include <dhcp/duid.h>
@@ -25,7 +26,6 @@
 #include <dhcp/option_definition.h>
 #include <dhcpsrv/cfg_option.h>
 #include <dhcpsrv/cfgmgr.h>
-#include <dhcpsrv/cql_exchange.h>
 #include <dhcpsrv/dhcpsrv_log.h>
 #include <util/buffer.h>
 #include <util/hash.h>
index 091372bc09a80c23d251cfea585864b73d5358ed..73768929559299a4a211cc7f132233f6e22f81d2 100644 (file)
@@ -18,8 +18,8 @@
 #ifndef CQL_HOST_DATA_SOURCE_H
 #define CQL_HOST_DATA_SOURCE_H
 
+#include <cql/cql_connection.h>
 #include <dhcpsrv/base_host_data_source.h>
-#include <dhcpsrv/cql_connection.h>
 
 #include <string>
 #include <vector>
@@ -281,7 +281,7 @@ public:
     ///
     /// @throw isc::db::DbOperationError An operation on the open database
     ///        has failed.
-    virtual VersionPair getVersion() const;
+    virtual db::VersionPair getVersion() const;
 
     /// @brief Commit Transactions
     ///
index e4789add80eeeb10c4c7ad242f1a91d0aabab797..9292bfe0e92bc5cb5315ee617f0517d74b549c0f 100644 (file)
@@ -19,9 +19,9 @@
 #ifndef CQL_LEASE_MGR_H
 #define CQL_LEASE_MGR_H
 
+#include <cql/cql_connection.h>
+#include <cql/cql_exchange.h>
 #include <dhcp/hwaddr.h>
-#include <dhcpsrv/cql_connection.h>
-#include <dhcpsrv/cql_exchange.h>
 #include <dhcpsrv/dhcpsrv_exceptions.h>
 #include <dhcpsrv/lease_mgr.h>
 
 namespace isc {
 namespace dhcp {
 
-class CqlVersionExchange;
-class CqlLeaseExchange;
-class CqlLease4Exchange;
-class CqlLease6Exchange;
-
 /// @brief Cassandra Lease Manager
 ///
 /// This class provides the @ref isc::dhcp::LeaseMgr interface to the Cassandra
@@ -568,7 +563,7 @@ public:
 
 private:
     /// @brief Database connection object
-    mutable CqlConnection dbconn_;
+    mutable db::CqlConnection dbconn_;
 };
 
 }  // namespace dhcp
index 99e8ec936e774fce98e3a552db8aa882a5010a59..233f3539c88be593cb6eaaf8c6ab7ceafa21db67 100644 (file)
@@ -15,7 +15,6 @@
 #include <dhcp/hwaddr.h>
 #include <dhcpsrv/lease.h>
 #include <dhcpsrv/subnet.h>
-#include <dhcpsrv/sql_common.h>
 
 #include <boost/noncopyable.hpp>
 #include <boost/shared_ptr.hpp>
index 235e7099631cd34e8515adb97193678e73eecd72..a37c27bae9460c7eab94f59c43f1f9d1a862dbc1 100644 (file)
@@ -114,7 +114,6 @@ libdhcpsrv_unittests_SOURCES += pgsql_lease_mgr_unittest.cc
 libdhcpsrv_unittests_SOURCES += pgsql_host_data_source_unittest.cc
 endif
 if HAVE_CQL
-libdhcpsrv_unittests_SOURCES += cql_connection_unittest.cc
 libdhcpsrv_unittests_SOURCES += cql_lease_mgr_unittest.cc
 libdhcpsrv_unittests_SOURCES += cql_host_data_source_unittest.cc
 endif
index 0afdf5dc276c8294735c8a255eb76b853c4c5b10..1dbbd4473fe9752a12ce72b7d28863b1cc7420c2 100644 (file)
 
 #include <config.h>
 
-#include <exceptions/exceptions.h>
 #include <asiolink/io_address.h>
+#include <exceptions/exceptions.h>
+#include <cql/cql_connection.h>
 #include <dhcpsrv/host.h>
 #include <dhcpsrv/host_mgr.h>
 #include <dhcpsrv/host_data_source_factory.h>
-#include <dhcpsrv/cql_connection.h>
 #include <dhcpsrv/cql_lease_mgr.h>
 #include <dhcpsrv/cql_host_data_source.h>
 #include <dhcpsrv/testutils/cql_schema.h>
index 6fb33717bf14099f0f507be116c6b0c9f924f2c3..676116dac8a4e0cb816af3bbcdfa1028875484e8 100644 (file)
@@ -19,8 +19,8 @@
 #include <config.h>
 
 #include <asiolink/io_address.h>
+#include <cql/cql_connection.h>
 #include <dhcpsrv/lease_mgr_factory.h>
-#include <dhcpsrv/cql_connection.h>
 #include <dhcpsrv/cql_lease_mgr.h>
 #include <dhcpsrv/tests/test_utils.h>
 #include <dhcpsrv/tests/generic_lease_mgr_unittest.h>
index abd7c198593e11fde0a74b6601fe80a2c3a91dd7..2df5324530fcaf6179bc6a326dacb84fb5d27d80 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -8,7 +8,7 @@
 
 #include <cassandra.h>
 
-#include <dhcpsrv/cql_connection.h>
+#include <cql/cql_connection.h>
 #include <dhcpsrv/testutils/cql_schema.h>
 
 #include <stdlib.h>
index d1af246aab1f4b72483c79b4f3ca1b69652cfb48..fd2a8336e4e2e33cbe1e904d9fe2ff4faad021c1 100644 (file)
@@ -24,6 +24,6 @@ libkea_mysql_la_LDFLAGS = -no-undefined -version-info 0:0:0
 libkea_mysql_la_LDFLAGS += $(MYSQL_LIBS)
 
 # Specify the headers for copying into the installation directory tree.
-libkea_mysql_includedir = $(pkgincludedir)/database
+libkea_mysql_includedir = $(pkgincludedir)/mysql
 libkea_mysql_include_HEADERS = \
        mysql_connection.h
index 1a86faca3fb17239481e37f3c63b7cecee368a4d..d9dc6515b966f02416c6aedfc3e72428b4f1f1dd 100644 (file)
@@ -26,6 +26,7 @@ libkea_pgsql_la_LDFLAGS = -no-undefined -version-info 0:0:0
 libkea_pgsql_la_LDFLAGS += $(PGSQL_LIBS)
 
 # Specify the headers for copying into the installation directory tree.
-libkea_pgsql_includedir = $(pkgincludedir)/database
+libkea_pgsql_includedir = $(pkgincludedir)/pgsql
 libkea_pgsql_include_HEADERS = \
-       pgsql_connection.h
+       pgsql_connection.h \
+       pgsql_exchange.h
index 33f9692d7cc07d622306c351c27b268f02010478..d65fbb66d655603d8d401830bd1a2be7ab08e1cd 100644 (file)
@@ -62,6 +62,9 @@ endif
 if HAVE_PGSQL
 libkea_process_la_LIBADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
 endif
+if HAVE_CQL
+libkea_process_la_LIBADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
 
 libkea_process_la_LIBADD += $(top_builddir)/src/lib/database/libkea-database.la
 libkea_process_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la