from AuthSrv:: (in auth_srv.h) to isc:datasrc:: (in client_list.h), the previous location wasn't really relevant now that it is used elsewhere, and this seemed the most logical location
const shared_ptr<TSIGKeyRing>* keyring_;
/// The data source client list
- AuthSrv::DataSrcClientListsPtr datasrc_client_lists_;
+ DataSrcClientListsPtr datasrc_client_lists_;
shared_ptr<ConfigurableClientList> getDataSrcClientList(
const RRClass& rrclass)
}
}
-AuthSrv::DataSrcClientListsPtr
+DataSrcClientListsPtr
AuthSrv::swapDataSrcClientLists(DataSrcClientListsPtr new_lists) {
// TODO: Debug-build only check
if (!impl_->mutex_.locked()) {
#include <datasrc/factory.h>
#include <datasrc/client_list.h>
+#include <datasrc/datasrc_config.h>
#include <dns/message.h>
#include <dns/opcode.h>
/// If there was no forwarder yet, this method does nothing.
void destroyDDNSForwarder();
- /// \brief Shortcut typedef used for swapDataSrcClientLists().
- typedef boost::shared_ptr<std::map<
- isc::dns::RRClass, boost::shared_ptr<
- isc::datasrc::ConfigurableClientList> > >
- DataSrcClientListsPtr;
-
/// \brief Swap the currently used set of data source client lists with
/// given one.
///
/// \param new_lists Shared pointer to a new set of data source client
/// lists.
/// \return The previous set of lists. It can be NULL.
- DataSrcClientListsPtr swapDataSrcClientLists(DataSrcClientListsPtr
- new_lists);
+ isc::datasrc::DataSrcClientListsPtr
+ swapDataSrcClientLists(isc::datasrc::DataSrcClientListsPtr new_lists);
/// \brief Returns the currently used client list for the class.
///
#include <log/logger_support.h>
#include <log/log_dbglevels.h>
-#include <auth/auth_srv.h>
#include <auth/datasrc_config.h>
#include <cc/data.h>
#include <datasrc/client_list.h>
std::list<datasrc_clientmgr_internal::Command> command_queue_;
CondVarType cond_; // condition variable for queue operations
MutexType queue_mutex_; // mutex to protect the queue
- AuthSrv::DataSrcClientListsPtr clients_map_;
+ isc::datasrc::DataSrcClientListsPtr clients_map_;
MutexType map_mutex_;
BuilderType builder_;
/// \throw None
DataSrcClientsBuilderBase(std::list<Command>* command_queue,
CondVarType* cond, MutexType* queue_mutex,
- AuthSrv::DataSrcClientListsPtr* clients_map,
+ isc::datasrc::DataSrcClientListsPtr* clients_map,
MutexType* map_mutex
) :
command_queue_(command_queue), cond_(cond), queue_mutex_(queue_mutex),
void doReconfigure(const isc::data::ConstElementPtr& config) {
if (config) {
try {
- AuthSrv::DataSrcClientListsPtr new_clients_map =
+ isc::datasrc::DataSrcClientListsPtr new_clients_map =
configureDataSource(config);
typename MutexType::Locker locker(*map_mutex_);
std::swap(new_clients_map, *clients_map_);
std::list<Command>* command_queue_;
CondVarType* cond_;
MutexType* queue_mutex_;
- AuthSrv::DataSrcClientListsPtr* clients_map_;
+ isc::datasrc::DataSrcClientListsPtr* clients_map_;
MutexType* map_mutex_;
};
// PERFORMANCE OF THIS SOFTWARE.
#include <cc/data.h>
-#include "auth_srv.h"
#include "datasrc_config.h"
// This is a trivial specialization for the commonly used version.
// Defined in .cc to avoid accidental creation of multiple copies.
-AuthSrv::DataSrcClientListsPtr
+isc::datasrc::DataSrcClientListsPtr
configureDataSource(const isc::data::ConstElementPtr& config) {
return (configureDataSourceGeneric<
isc::datasrc::ConfigurableClientList>(config));
#include <utility>
#include <set>
+#include <map>
/// \brief Configure data source client lists
///
/// \brief Concrete version of configureDataSource() for the
/// use with authoritative server implementation.
-AuthSrv::DataSrcClientListsPtr
+isc::datasrc::DataSrcClientListsPtr
configureDataSource(const isc::data::ConstElementPtr& config);
#endif // DATASRC_CONFIG_H
{
assert(server != NULL);
if (config->contains("classes")) {
- AuthSrv::DataSrcClientListsPtr lists;
+ isc::datasrc::DataSrcClientListsPtr lists;
if (*first_time) {
// HACK: The default is not passed to the handler in the first
void
installDataSrcClientLists(AuthSrv& server,
- AuthSrv::DataSrcClientListsPtr lists)
+ DataSrcClientListsPtr lists)
{
thread::Mutex::Locker locker(server.getDataSrcClientListMutex());
server.swapDataSrcClientLists(lists);
boost::shared_ptr<isc::datasrc::ConfigurableClientList>
list(new FakeList(server.getDataSrcClientList(RRClass::IN()),
THROW_NEVER, false));
- AuthSrv::DataSrcClientListsPtr lists(new std::map<RRClass, ListPtr>);
+ DataSrcClientListsPtr lists(new std::map<RRClass, ListPtr>);
lists->insert(pair<RRClass, ListPtr>(RRClass::IN(), list));
server.swapDataSrcClientLists(lists);
}
boost::shared_ptr<isc::datasrc::ConfigurableClientList>
list(new FakeList(server.getDataSrcClientList(RRClass::IN()),
throw_when, isc_exception, rrset));
- AuthSrv::DataSrcClientListsPtr lists(new std::map<RRClass, ListPtr>);
+ DataSrcClientListsPtr lists(new std::map<RRClass, ListPtr>);
lists->insert(pair<RRClass, ListPtr>(RRClass::IN(), list));
server.swapDataSrcClientLists(lists);
}
isc::util::thread::Mutex::Locker locker(
server.getDataSrcClientListMutex());
- AuthSrv::DataSrcClientListsPtr lists; // initially empty
+ DataSrcClientListsPtr lists; // initially empty
// The lists don't exist. Therefore, the list of RRClasses is empty.
EXPECT_TRUE(server.swapDataSrcClientLists(lists)->empty());
#include <util/threads/sync.h>
-#include <auth/auth_srv.h>
#include <auth/auth_config.h>
#include <auth/command.h>
#include <auth/datasrc_config.h>
}
void
-installDataSrcClientLists(AuthSrv& server,
- AuthSrv::DataSrcClientListsPtr lists)
+installDataSrcClientLists(AuthSrv& server, DataSrcClientListsPtr lists)
{
isc::util::thread::Mutex::Locker locker(
server.getDataSrcClientListMutex());
#include <boost/function.hpp>
using isc::data::ConstElementPtr;
+using namespace isc::datasrc;
using namespace isc::auth::datasrc_clientmgr_internal;
namespace {
TestDataSrcClientsBuilder builder;
std::list<Command> command_queue; // test command queue
std::list<Command> delayed_command_queue; // commands available after wait
- AuthSrv::DataSrcClientListsPtr clients_map; // 'configured' clients
+ DataSrcClientListsPtr clients_map; // configured clients
TestCondVar cond;
TestMutex queue_mutex;
TestMutex map_mutex;
Command reconfig_cmd(RECONFIGURE, ConstElementPtr());
// Initially, no clients should be there
- EXPECT_EQ(AuthSrv::DataSrcClientListsPtr(), clients_map);
+ EXPECT_EQ(DataSrcClientListsPtr(), clients_map);
// A config that doesn't do much except be accepted
ConstElementPtr good_config = isc::data::Element::fromJSON(
EXPECT_EQ(1, clients_map->size());
// Store the nonempty clients map we now have
- AuthSrv::DataSrcClientListsPtr working_config_clients(clients_map);
+ DataSrcClientListsPtr 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,
TestCondVar* FakeDataSrcClientsBuilder::cond = NULL;
TestCondVar FakeDataSrcClientsBuilder::cond_copy;
TestMutex* FakeDataSrcClientsBuilder::queue_mutex = NULL;
-AuthSrv::DataSrcClientListsPtr* FakeDataSrcClientsBuilder::clients_map = NULL;
+isc::datasrc::DataSrcClientListsPtr*
+ FakeDataSrcClientsBuilder::clients_map = NULL;
TestMutex* FakeDataSrcClientsBuilder::map_mutex = NULL;
TestMutex FakeDataSrcClientsBuilder::queue_mutex_copy;
bool FakeDataSrcClientsBuilder::thread_waited = false;
static std::list<Command>* command_queue;
static TestCondVar* cond;
static TestMutex* queue_mutex;
- static AuthSrv::DataSrcClientListsPtr* clients_map;
+ static isc::datasrc::DataSrcClientListsPtr* clients_map;
static TestMutex* map_mutex;
static std::list<Command> command_queue_copy;
static TestCondVar cond_copy;
std::list<Command>* command_queue,
TestCondVar* cond,
TestMutex* queue_mutex,
- AuthSrv::DataSrcClientListsPtr* clients_map,
+ isc::datasrc::DataSrcClientListsPtr* clients_map,
TestMutex* map_mutex)
{
FakeDataSrcClientsBuilder::started = false;
class DataSourceClientContainer;
typedef boost::shared_ptr<DataSourceClientContainer>
DataSourceClientContainerPtr;
-
// XXX: it's better to even hide the existence of the "memory" namespace.
// We should probably consider pimpl for details of ConfigurableClientList
// and hide real definitions except for itself and tests.
DataSources data_sources_;
};
+/// \brief Shortcut typedef for maps of client_lists.
+typedef boost::shared_ptr<std::map<
+ isc::dns::RRClass, boost::shared_ptr<ConfigurableClientList> > >
+ DataSrcClientListsPtr;
+
} // namespace datasrc
} // namespace isc