Browse Source

[2268] Move EmptyZone exception to InMemoryClient class

Mukund Sivaraman 12 years ago
parent
commit
ef49adadf6

+ 1 - 1
src/lib/datasrc/memory/memory_client.cc

@@ -92,7 +92,7 @@ InMemoryClient::load(const Name& zone_name,
     // an SOA RR. This condition should be avoided, and hence load()
     // should throw when an empty zone is loaded.
     if (RdataSet::find(set, RRType::SOA()) == NULL) {
-        isc_throw(ZoneDataUpdater::EmptyZone,
+        isc_throw(EmptyZone,
                   "Won't create an empty zone for: " << zone_name);
     }
 

+ 10 - 0
src/lib/datasrc/memory/memory_client.h

@@ -87,6 +87,16 @@ public:
     /// \return The number of zones stored in the client.
     virtual unsigned int getZoneCount() const;
 
+    /// \brief Zone is empty exception.
+    ///
+    /// This is thrown if we have an empty zone created as a result of
+    /// load().
+    struct EmptyZone : public InvalidParameter {
+        EmptyZone(const char* file, size_t line, const char* what) :
+            InvalidParameter(file, line, what)
+        {}
+    };
+
     /// \brief Load zone from masterfile.
     ///
     /// This loads data from masterfile specified by filename. It replaces

+ 0 - 10
src/lib/datasrc/memory/zone_data_updater.h

@@ -57,16 +57,6 @@ public:
         {}
     };
 
-    /// \brief Zone is empty exception.
-    ///
-    /// This is thrown if we have an empty zone created as a result of
-    /// load().
-    struct EmptyZone : public InvalidParameter {
-        EmptyZone(const char* file, size_t line, const char* what) :
-            InvalidParameter(file, line, what)
-        {}
-    };
-
     /// \brief General failure exception for \c add().
     ///
     /// This is thrown against general error cases in adding an RRset

+ 1 - 1
src/lib/datasrc/tests/memory/memory_client_unittest.cc

@@ -189,7 +189,7 @@ TEST_F(MemoryClientTest, loadEmptyZoneFileThrows) {
 
     EXPECT_THROW(client_->load(Name("."),
                                TEST_DATA_DIR "/empty.zone"),
-                 ZoneDataUpdater::EmptyZone);
+                 InMemoryClient::EmptyZone);
 
     EXPECT_EQ(0, client_->getZoneCount());