]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2210] rename DataSrcClientListsPtr to ClientListMapPtr
authorJelte Jansen <jelte@isc.org>
Mon, 22 Oct 2012 13:08:34 +0000 (15:08 +0200)
committerJelte Jansen <jelte@isc.org>
Mon, 22 Oct 2012 13:08:34 +0000 (15:08 +0200)
12 files changed:
src/bin/auth/auth_srv.cc
src/bin/auth/auth_srv.h
src/bin/auth/datasrc_clients_mgr.h
src/bin/auth/datasrc_config.cc
src/bin/auth/datasrc_config.h
src/bin/auth/main.cc
src/bin/auth/tests/auth_srv_unittest.cc
src/bin/auth/tests/command_unittest.cc
src/bin/auth/tests/datasrc_clients_builder_unittest.cc
src/bin/auth/tests/test_datasrc_clients_mgr.cc
src/bin/auth/tests/test_datasrc_clients_mgr.h
src/lib/datasrc/client_list.h

index 917ef48689c65a93d37cd3cce2baba75ebac8e3d..b555ea50253e52070c88e35d2358f47ae58f332e 100644 (file)
@@ -269,7 +269,7 @@ public:
     const shared_ptr<TSIGKeyRing>* keyring_;
 
     /// The data source client list
-    DataSrcClientListsPtr datasrc_client_lists_;
+    ClientListMapPtr datasrc_client_lists_;
 
     shared_ptr<ConfigurableClientList> getDataSrcClientList(
         const RRClass& rrclass)
@@ -933,8 +933,8 @@ AuthSrv::destroyDDNSForwarder() {
     }
 }
 
-DataSrcClientListsPtr
-AuthSrv::swapDataSrcClientLists(DataSrcClientListsPtr new_lists) {
+ClientListMapPtr
+AuthSrv::swapDataSrcClientLists(ClientListMapPtr new_lists) {
     // TODO: Debug-build only check
     if (!impl_->mutex_.locked()) {
         isc_throw(isc::Unexpected, "Not locked!");
index a70d51c105890fee5161ceef7037b78304b430f9..94efd08fea6ef6bf3a8f7d31e89900233afe28f9 100644 (file)
@@ -328,8 +328,8 @@ public:
     /// \param new_lists Shared pointer to a new set of data source client
     /// lists.
     /// \return The previous set of lists.  It can be NULL.
-    isc::datasrc::DataSrcClientListsPtr
-        swapDataSrcClientLists(isc::datasrc::DataSrcClientListsPtr new_lists);
+    isc::datasrc::ClientListMapPtr
+        swapDataSrcClientLists(isc::datasrc::ClientListMapPtr new_lists);
 
     /// \brief Returns the currently used client list for the class.
     ///
index ec2188d20706acfb1c02911bc3a76daf7c35535e..0fdfa814afb2703830dcaf7e9c1ac0484832fa4b 100644 (file)
@@ -169,7 +169,7 @@ private:
     std::list<datasrc_clientmgr_internal::Command> command_queue_;
     CondVarType cond_;          // condition variable for queue operations
     MutexType queue_mutex_;     // mutex to protect the queue
-    datasrc::DataSrcClientListsPtr clients_map_;
+    datasrc::ClientListMapPtr clients_map_;
                                 // map of actual data source client objects
     MutexType map_mutex_;       // mutex to protect the clients map
 
@@ -207,7 +207,7 @@ public:
     /// \throw None
     DataSrcClientsBuilderBase(std::list<Command>* command_queue,
                               CondVarType* cond, MutexType* queue_mutex,
-                              datasrc::DataSrcClientListsPtr* clients_map,
+                              datasrc::ClientListMapPtr* clients_map,
                               MutexType* map_mutex
         ) :
         command_queue_(command_queue), cond_(cond), queue_mutex_(queue_mutex),
@@ -242,7 +242,7 @@ private:
                 // the lock is guaranteed to be released before
                 // the old data is destroyed, minimizing the lock
                 // duration.
-                datasrc::DataSrcClientListsPtr new_clients_map =
+                datasrc::ClientListMapPtr new_clients_map =
                     configureDataSource(config);
                 {
                     typename MutexType::Locker locker(*map_mutex_);
@@ -275,7 +275,7 @@ private:
     std::list<Command>* command_queue_;
     CondVarType* cond_;
     MutexType* queue_mutex_;
-    datasrc::DataSrcClientListsPtr* clients_map_;
+    datasrc::ClientListMapPtr* clients_map_;
     MutexType* map_mutex_;
 };
 
index 6452f95768cecdf27d7d46fd4aa3b80dbdc48219..4869050e6a606948b959d1413131d96a7e392f4a 100644 (file)
@@ -17,7 +17,7 @@
 
 // This is a trivial specialization for the commonly used version.
 // Defined in .cc to avoid accidental creation of multiple copies.
-isc::datasrc::DataSrcClientListsPtr
+isc::datasrc::ClientListMapPtr
 configureDataSource(const isc::data::ConstElementPtr& config) {
     return (configureDataSourceGeneric<
             isc::datasrc::ConfigurableClientList>(config));
index c33a4b0f086130280e2486e6790ea2feb57c4fd8..4b67e86e39a07d9edd8312a47a53be5333a5603e 100644 (file)
@@ -74,7 +74,7 @@ configureDataSourceGeneric(const isc::data::ConstElementPtr& config) {
 
 /// \brief Concrete version of configureDataSource() for the
 ///     use with authoritative server implementation.
-isc::datasrc::DataSrcClientListsPtr
+isc::datasrc::ClientListMapPtr
 configureDataSource(const isc::data::ConstElementPtr& config);
 
 #endif  // DATASRC_CONFIG_H
index 47131b1bd3e94f05576a9f39e375bae5bfce78a7..5d68d16cff373bbf0e1c983ad066fa0678bffcb3 100644 (file)
@@ -96,7 +96,7 @@ datasrcConfigHandler(AuthSrv* server, bool* first_time,
 {
     assert(server != NULL);
     if (config->contains("classes")) {
-        isc::datasrc::DataSrcClientListsPtr lists;
+        isc::datasrc::ClientListMapPtr lists;
 
         if (*first_time) {
             // HACK: The default is not passed to the handler in the first
index 11a545025c75f92475b79eaffe628770c50871ad..732cdcc18199ab8377e42d5eaafa565a16978e52 100644 (file)
@@ -727,7 +727,7 @@ TEST_F(AuthSrvTest, notifyWithSessionMessageError) {
 
 void
 installDataSrcClientLists(AuthSrv& server,
-                          DataSrcClientListsPtr lists)
+                          ClientListMapPtr lists)
 {
     thread::Mutex::Locker locker(server.getDataSrcClientListMutex());
     server.swapDataSrcClientLists(lists);
@@ -1444,7 +1444,7 @@ TEST_F(AuthSrvTest,
         boost::shared_ptr<isc::datasrc::ConfigurableClientList>
             list(new FakeList(server.getDataSrcClientList(RRClass::IN()),
                               THROW_NEVER, false));
-        DataSrcClientListsPtr lists(new std::map<RRClass, ListPtr>);
+        ClientListMapPtr lists(new std::map<RRClass, ListPtr>);
         lists->insert(pair<RRClass, ListPtr>(RRClass::IN(), list));
         server.swapDataSrcClientLists(lists);
     }
@@ -1475,7 +1475,7 @@ setupThrow(AuthSrv& server, ThrowWhen throw_when, bool isc_exception,
     boost::shared_ptr<isc::datasrc::ConfigurableClientList>
         list(new FakeList(server.getDataSrcClientList(RRClass::IN()),
                           throw_when, isc_exception, rrset));
-    DataSrcClientListsPtr lists(new std::map<RRClass, ListPtr>);
+    ClientListMapPtr lists(new std::map<RRClass, ListPtr>);
     lists->insert(pair<RRClass, ListPtr>(RRClass::IN(), list));
     server.swapDataSrcClientLists(lists);
 }
@@ -1792,7 +1792,7 @@ TEST_F(AuthSrvTest, clientList) {
     isc::util::thread::Mutex::Locker locker(
         server.getDataSrcClientListMutex());
 
-    DataSrcClientListsPtr lists; // initially empty
+    ClientListMapPtr lists; // initially empty
 
     // The lists don't exist. Therefore, the list of RRClasses is empty.
     EXPECT_TRUE(server.swapDataSrcClientLists(lists)->empty());
index 764ab116bf41d64a13a9b7353a9673bd2c7f4321..15bd66212d44fdae933b390fed23faca18adcfa1 100644 (file)
@@ -191,7 +191,7 @@ zoneChecks(AuthSrv& server) {
 }
 
 void
-installDataSrcClientLists(AuthSrv& server, DataSrcClientListsPtr lists) {
+installDataSrcClientLists(AuthSrv& server, ClientListMapPtr lists) {
     isc::util::thread::Mutex::Locker locker(
         server.getDataSrcClientListMutex());
     server.swapDataSrcClientLists(lists);
index 71f4407cae97a354e81d65ef45336e114201d66b..74216f6794a0121a2b224f46716e70ee38ed8768 100644 (file)
@@ -38,7 +38,7 @@ protected:
     TestDataSrcClientsBuilder builder;
     std::list<Command> command_queue; // test command queue
     std::list<Command> delayed_command_queue; // commands available after wait
-    DataSrcClientListsPtr clients_map; // configured clients
+    ClientListMapPtr clients_map; // configured clients
     TestCondVar cond;
     TestMutex queue_mutex;
     TestMutex map_mutex;
@@ -104,7 +104,7 @@ TEST_F(DataSrcClientsBuilderTest, reconfigure) {
     Command reconfig_cmd(RECONFIGURE, ConstElementPtr());
 
     // Initially, no clients should be there
-    EXPECT_EQ(DataSrcClientListsPtr(), clients_map);
+    EXPECT_EQ(ClientListMapPtr(), clients_map);
 
     // A config that doesn't do much except be accepted
     ConstElementPtr good_config = isc::data::Element::fromJSON(
@@ -135,7 +135,7 @@ TEST_F(DataSrcClientsBuilderTest, reconfigure) {
     EXPECT_EQ(1, map_mutex.lock_count);
 
     // Store the nonempty clients map we now have
-    DataSrcClientListsPtr working_config_clients(clients_map);
+    ClientListMapPtr working_config_clients(clients_map);
 
     // If a 'bad' command argument got here, the config validation should
     // have failed already, but still, the handler should return true,
index a06c596616c18da065691ebe467ad09af9051326..37c225e0815fdf45f46c953f3b13cc6043635928 100644 (file)
@@ -28,7 +28,7 @@ std::list<Command> FakeDataSrcClientsBuilder::command_queue_copy;
 TestCondVar* FakeDataSrcClientsBuilder::cond = NULL;
 TestCondVar FakeDataSrcClientsBuilder::cond_copy;
 TestMutex* FakeDataSrcClientsBuilder::queue_mutex = NULL;
-isc::datasrc::DataSrcClientListsPtr*
+isc::datasrc::ClientListMapPtr*
     FakeDataSrcClientsBuilder::clients_map = NULL;
 TestMutex* FakeDataSrcClientsBuilder::map_mutex = NULL;
 TestMutex FakeDataSrcClientsBuilder::queue_mutex_copy;
index a5e015e1d90def2b04c655b6560380a5e24bfadf..98c76827f91ff7622c1092da8d1e64159344383b 100644 (file)
@@ -131,7 +131,7 @@ public:
     static std::list<Command>* command_queue;
     static TestCondVar* cond;
     static TestMutex* queue_mutex;
-    static isc::datasrc::DataSrcClientListsPtr* clients_map;
+    static isc::datasrc::ClientListMapPtr* clients_map;
     static TestMutex* map_mutex;
     static std::list<Command> command_queue_copy;
     static TestCondVar cond_copy;
@@ -149,7 +149,7 @@ public:
         std::list<Command>* command_queue,
         TestCondVar* cond,
         TestMutex* queue_mutex,
-        isc::datasrc::DataSrcClientListsPtr* clients_map,
+        isc::datasrc::ClientListMapPtr* clients_map,
         TestMutex* map_mutex)
     {
         FakeDataSrcClientsBuilder::started = false;
index 97d7483f766894e66810bd0ac64db626ba1a2916..8694b4a8ebfa5003e19673dd52dd6b20a2ecc80e 100644 (file)
@@ -393,7 +393,7 @@ protected:
 /// \brief Shortcut typedef for maps of client_lists.
 typedef boost::shared_ptr<std::map<
     isc::dns::RRClass, boost::shared_ptr<ConfigurableClientList> > >
-        DataSrcClientListsPtr;
+        ClientListMapPtr;
 
 } // namespace datasrc
 } // namespace isc