|
@@ -14,6 +14,8 @@
|
|
|
|
|
|
#include "client.h"
|
|
#include "client.h"
|
|
#include "memory_datasrc.h"
|
|
#include "memory_datasrc.h"
|
|
|
|
+#include <datasrc/memory/memory_client.h>
|
|
|
|
+#include <datasrc/memory/zone_table_segment.h>
|
|
|
|
|
|
#include <cc/data.h>
|
|
#include <cc/data.h>
|
|
#include <dns/rrclass.h>
|
|
#include <dns/rrclass.h>
|
|
@@ -32,16 +34,16 @@ namespace datasrc {
|
|
DataSourceClient*
|
|
DataSourceClient*
|
|
createInstance(ConstElementPtr config, string& error) {
|
|
createInstance(ConstElementPtr config, string& error) {
|
|
try {
|
|
try {
|
|
|
|
+ shared_ptr<memory::ZoneTableSegment> ztable_segment(
|
|
|
|
+ memory::ZoneTableSegment::create(*config, RRClass::CH()));
|
|
// Create the data source
|
|
// Create the data source
|
|
- auto_ptr<InMemoryClient> client(new InMemoryClient());
|
|
|
|
- // Hardcode the origin and class
|
|
|
|
- shared_ptr<InMemoryZoneFinder>
|
|
|
|
- finder(new InMemoryZoneFinder(RRClass::CH(), Name("BIND")));
|
|
|
|
|
|
+ auto_ptr<memory::InMemoryClient> client
|
|
|
|
+ (new memory::InMemoryClient(ztable_segment, RRClass::CH()));
|
|
|
|
+
|
|
// Fill it with data
|
|
// Fill it with data
|
|
const string path(config->stringValue());
|
|
const string path(config->stringValue());
|
|
- finder->load(path);
|
|
|
|
- // And put the zone inside
|
|
|
|
- client->addZone(finder);
|
|
|
|
|
|
+ client->load(Name("BIND"), path);
|
|
|
|
+
|
|
return (client.release());
|
|
return (client.release());
|
|
}
|
|
}
|
|
catch (const std::exception& e) {
|
|
catch (const std::exception& e) {
|