Commit 20fdec04 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[2210] rename DataSrcClientListsPtr to ClientListMapPtr

parent 3a5e410f
......@@ -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!");
......
......@@ -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.
///
......
......@@ -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_;
};
......
......@@ -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));
......
......@@ -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
......
......@@ -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
......
......@@ -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());
......
......@@ -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);
......
......@@ -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,
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment