From: Jelte Jansen Date: Mon, 22 Oct 2012 13:08:34 +0000 (+0200) Subject: [2210] rename DataSrcClientListsPtr to ClientListMapPtr X-Git-Tag: trac2402_base~4^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=20fdec048d51fa193425ebb284278ffeec37b93f;p=thirdparty%2Fkea.git [2210] rename DataSrcClientListsPtr to ClientListMapPtr --- diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc index 917ef48689..b555ea5025 100644 --- a/src/bin/auth/auth_srv.cc +++ b/src/bin/auth/auth_srv.cc @@ -269,7 +269,7 @@ public: const shared_ptr* keyring_; /// The data source client list - DataSrcClientListsPtr datasrc_client_lists_; + ClientListMapPtr datasrc_client_lists_; shared_ptr 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!"); diff --git a/src/bin/auth/auth_srv.h b/src/bin/auth/auth_srv.h index a70d51c105..94efd08fea 100644 --- a/src/bin/auth/auth_srv.h +++ b/src/bin/auth/auth_srv.h @@ -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. /// diff --git a/src/bin/auth/datasrc_clients_mgr.h b/src/bin/auth/datasrc_clients_mgr.h index ec2188d207..0fdfa814af 100644 --- a/src/bin/auth/datasrc_clients_mgr.h +++ b/src/bin/auth/datasrc_clients_mgr.h @@ -169,7 +169,7 @@ private: std::list 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_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_queue_; CondVarType* cond_; MutexType* queue_mutex_; - datasrc::DataSrcClientListsPtr* clients_map_; + datasrc::ClientListMapPtr* clients_map_; MutexType* map_mutex_; }; diff --git a/src/bin/auth/datasrc_config.cc b/src/bin/auth/datasrc_config.cc index 6452f95768..4869050e6a 100644 --- a/src/bin/auth/datasrc_config.cc +++ b/src/bin/auth/datasrc_config.cc @@ -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)); diff --git a/src/bin/auth/datasrc_config.h b/src/bin/auth/datasrc_config.h index c33a4b0f08..4b67e86e39 100644 --- a/src/bin/auth/datasrc_config.h +++ b/src/bin/auth/datasrc_config.h @@ -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 diff --git a/src/bin/auth/main.cc b/src/bin/auth/main.cc index 47131b1bd3..5d68d16cff 100644 --- a/src/bin/auth/main.cc +++ b/src/bin/auth/main.cc @@ -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 diff --git a/src/bin/auth/tests/auth_srv_unittest.cc b/src/bin/auth/tests/auth_srv_unittest.cc index 11a545025c..732cdcc181 100644 --- a/src/bin/auth/tests/auth_srv_unittest.cc +++ b/src/bin/auth/tests/auth_srv_unittest.cc @@ -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 list(new FakeList(server.getDataSrcClientList(RRClass::IN()), THROW_NEVER, false)); - DataSrcClientListsPtr lists(new std::map); + ClientListMapPtr lists(new std::map); lists->insert(pair(RRClass::IN(), list)); server.swapDataSrcClientLists(lists); } @@ -1475,7 +1475,7 @@ setupThrow(AuthSrv& server, ThrowWhen throw_when, bool isc_exception, boost::shared_ptr list(new FakeList(server.getDataSrcClientList(RRClass::IN()), throw_when, isc_exception, rrset)); - DataSrcClientListsPtr lists(new std::map); + ClientListMapPtr lists(new std::map); lists->insert(pair(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()); diff --git a/src/bin/auth/tests/command_unittest.cc b/src/bin/auth/tests/command_unittest.cc index 764ab116bf..15bd66212d 100644 --- a/src/bin/auth/tests/command_unittest.cc +++ b/src/bin/auth/tests/command_unittest.cc @@ -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); diff --git a/src/bin/auth/tests/datasrc_clients_builder_unittest.cc b/src/bin/auth/tests/datasrc_clients_builder_unittest.cc index 71f4407cae..74216f6794 100644 --- a/src/bin/auth/tests/datasrc_clients_builder_unittest.cc +++ b/src/bin/auth/tests/datasrc_clients_builder_unittest.cc @@ -38,7 +38,7 @@ protected: TestDataSrcClientsBuilder builder; std::list command_queue; // test command queue std::list 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, diff --git a/src/bin/auth/tests/test_datasrc_clients_mgr.cc b/src/bin/auth/tests/test_datasrc_clients_mgr.cc index a06c596616..37c225e081 100644 --- a/src/bin/auth/tests/test_datasrc_clients_mgr.cc +++ b/src/bin/auth/tests/test_datasrc_clients_mgr.cc @@ -28,7 +28,7 @@ std::list 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; diff --git a/src/bin/auth/tests/test_datasrc_clients_mgr.h b/src/bin/auth/tests/test_datasrc_clients_mgr.h index a5e015e1d9..98c76827f9 100644 --- a/src/bin/auth/tests/test_datasrc_clients_mgr.h +++ b/src/bin/auth/tests/test_datasrc_clients_mgr.h @@ -131,7 +131,7 @@ public: static std::list* 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_queue_copy; static TestCondVar cond_copy; @@ -149,7 +149,7 @@ public: std::list* command_queue, TestCondVar* cond, TestMutex* queue_mutex, - isc::datasrc::DataSrcClientListsPtr* clients_map, + isc::datasrc::ClientListMapPtr* clients_map, TestMutex* map_mutex) { FakeDataSrcClientsBuilder::started = false; diff --git a/src/lib/datasrc/client_list.h b/src/lib/datasrc/client_list.h index 97d7483f76..8694b4a8eb 100644 --- a/src/lib/datasrc/client_list.h +++ b/src/lib/datasrc/client_list.h @@ -393,7 +393,7 @@ protected: /// \brief Shortcut typedef for maps of client_lists. typedef boost::shared_ptr > > - DataSrcClientListsPtr; + ClientListMapPtr; } // namespace datasrc } // namespace isc