Browse Source

[2108] Add a findZone() variant temporarily to derive from DataSourceClient

Its implementation just throws.
Mukund Sivaraman 12 years ago
parent
commit
99db6f4f61
2 changed files with 25 additions and 3 deletions
  1. 11 2
      src/lib/datasrc/memory/memory_client.cc
  2. 14 1
      src/lib/datasrc/memory/memory_client.h

+ 11 - 2
src/lib/datasrc/memory/memory_client.cc

@@ -666,13 +666,22 @@ InMemoryClient::getZoneCount() const {
     return (impl_->zone_count);
 }
 
-ZoneTable::FindResult
-InMemoryClient::findZone(const isc::dns::Name& zone_name) const {
+isc::datasrc::memory::ZoneTable::FindResult
+InMemoryClient::findZone2(const isc::dns::Name& zone_name) const {
     LOG_DEBUG(logger, DBG_TRACE_DATA, DATASRC_MEM_FIND_ZONE).arg(zone_name);
     ZoneTable::FindResult result(impl_->zone_table_->findZone(zone_name));
     return (result);
 }
 
+isc::datasrc::DataSourceClient::FindResult
+InMemoryClient::findZone(const isc::dns::Name& zone_name) const {
+    // This variant of findZone() is not implemented and should be
+    // removed eventually. It currently throws an exception. It is
+    // required right now to derive from DataSourceClient.
+    isc_throw(isc::NotImplemented,
+	      "This variant of findZone() is not implemented.");
+}
+
 result::Result
 InMemoryClient::load(const isc::dns::Name& zone_name,
                      const std::string& filename) {

+ 14 - 1
src/lib/datasrc/memory/memory_client.h

@@ -17,6 +17,12 @@
 
 #include <datasrc/client.h>
 #include <datasrc/memory/zone_table.h>
+
+// for isc::datasrc::ZoneTable::FindResult returned by findZone(). This
+// variant of findZone() is not implemented and should be removed
+// eventually.
+#include <datasrc/zonetable.h>
+
 #include <string>
 
 namespace isc {
@@ -189,7 +195,14 @@ public:
     ///
     /// This derived version of the method never throws an exception.
     /// For other details see \c DataSourceClient::findZone().
-    virtual ZoneTable::FindResult findZone(const isc::dns::Name& name) const;
+    virtual isc::datasrc::memory::ZoneTable::FindResult
+    findZone2(const isc::dns::Name& name) const;
+
+    // This variant of findZone() is not implemented and should be
+    // removed eventually. It currently throws an exception. It is
+    // required right now to derive from DataSourceClient.
+    virtual isc::datasrc::DataSourceClient::FindResult
+    findZone(const isc::dns::Name& name) const;
 
     /// \brief Implementation of the getIterator method
     virtual ZoneIteratorPtr getIterator(const isc::dns::Name& name,