From: JINMEI Tatuya Date: Mon, 16 Apr 2012 21:43:14 +0000 (-0700) Subject: [1781] renamed the new NSEC3 methods. X-Git-Tag: trac2351_base~226^2~116^2~26^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4a7381b8b8a03c010372c7a62192bec325a40a8a;p=thirdparty%2Fkea.git [1781] renamed the new NSEC3 methods. so it will be clearer that they are used only for NSEC3-related records. as suggested in review. --- diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc index 49c8ecf874..b13f7998d5 100644 --- a/src/lib/datasrc/database.cc +++ b/src/lib/datasrc/database.cc @@ -1310,7 +1310,7 @@ DatabaseUpdater::addRRset(const AbstractRRset& rrset) { const string nsec3_columns[Accessor::ADD_NSEC3_COLUMN_COUNT] = { cvtr.getNSEC3Name(), cvtr.getTTL(), cvtr.getType(), rdata_txt }; - accessor_->addRecordToNSEC3Zone(nsec3_columns); + accessor_->addNSEC3RecordToZone(nsec3_columns); } else { const string columns[Accessor::ADD_COLUMN_COUNT] = { cvtr.getName(), cvtr.getRevName(), cvtr.getTTL(), @@ -1356,7 +1356,7 @@ DatabaseUpdater::deleteRRset(const AbstractRRset& rrset) { { nsec3_type ? cvtr.getNSEC3Name() : cvtr.getName(), cvtr.getType(), rdata_txt }; if (nsec3_type) { - accessor_->deleteRecordInNSEC3Zone(params); + accessor_->deleteNSEC3RecordInZone(params); } else { accessor_->deleteRecordInZone(params); } diff --git a/src/lib/datasrc/database.h b/src/lib/datasrc/database.h index ca05d0a826..24953c9138 100644 --- a/src/lib/datasrc/database.h +++ b/src/lib/datasrc/database.h @@ -95,9 +95,9 @@ public: ADD_COLUMN_COUNT = 6 ///< Number of columns }; - /// \brief Definitions of the fields to be passed to addRecordToNSEC3Zone() + /// \brief Definitions of the fields to be passed to addNSEC3RecordToZone() /// - /// Each derived implementation of addRecordToNSEC3Zone() should expect + /// Each derived implementation of addNSEC3RecordToZone() should expect /// the "columns" array to be filled with the values as described in this /// enumeration, in this order. /// @@ -117,14 +117,14 @@ public: }; /// \brief Definitions of the fields to be passed to deleteRecordInZone() - /// and deleteRecordInNSEC3Zone() + /// and deleteNSEC3RecordInZone() /// /// Each derived implementation of deleteRecordInZone() should expect /// the "params" array to be filled with the values as described in this /// enumeration, in this order. enum DeleteRecordParams { DEL_NAME = 0, ///< The owner name of the record (a domain name) - ///< or the hash label for deleteRecordInNSEC3Zone() + ///< or the hash label for deleteNSEC3RecordInZone() DEL_TYPE = 1, ///< The RRType of the record (A/NS/TXT etc.) DEL_RDATA = 2, ///< Full text representation of the record's RDATA DEL_PARAM_COUNT = 3 ///< Number of parameters @@ -492,7 +492,7 @@ public: /// /// \param columns An array of strings that defines a record to be added /// to the NSEC3 namespace of the zone. - virtual void addRecordToNSEC3Zone( + virtual void addNSEC3RecordToZone( const std::string (&columns)[ADD_NSEC3_COLUMN_COUNT]) = 0; /// \brief Delete a single record from the zone to be updated. @@ -538,14 +538,14 @@ public: /// This method is similar to \c deleteRecordInZone(), but is expected to /// be only used for NSEC3 RRs or RRSIG RRs that cover NSEC3. The /// relationship between these two methods is similar to that between - /// \c addRecordToZone() and \c addRecordToNSEC3Zone(), and the same + /// \c addRecordToZone() and \c addNSEC3RecordToZone(), and the same /// notes apply to this method. /// /// This method uses the same set of parameters to specify the record /// to be deleted as \c deleteRecordInZone(), but the \c DEL_NAME column /// is expected to only store the hash label of the owner name. /// This is the same as \c ADD_NSEC3_HASH column for - /// \c addRecordToNSEC3Zone(). + /// \c addNSEC3RecordToZone(). /// /// \exception DataSourceError Invalid call without starting a transaction, /// or other internal database error. @@ -554,7 +554,7 @@ public: /// /// \param params An array of strings that defines a record to be deleted /// from the NSEC3 namespace of the zone. - virtual void deleteRecordInNSEC3Zone( + virtual void deleteNSEC3RecordInZone( const std::string (¶ms)[DEL_PARAM_COUNT]) = 0; /// \brief Start a general transaction. diff --git a/src/lib/datasrc/sqlite3_accessor.cc b/src/lib/datasrc/sqlite3_accessor.cc index 96e964e3dc..50713b0c67 100644 --- a/src/lib/datasrc/sqlite3_accessor.cc +++ b/src/lib/datasrc/sqlite3_accessor.cc @@ -1122,7 +1122,7 @@ SQLite3Accessor::addRecordToZone(const string (&columns)[ADD_COLUMN_COUNT]) { } void -SQLite3Accessor::addRecordToNSEC3Zone( +SQLite3Accessor::addNSEC3RecordToZone( const string (&/*columns*/)[ADD_NSEC3_COLUMN_COUNT]) { isc_throw(NotImplemented, "not yet implemented"); @@ -1139,7 +1139,7 @@ SQLite3Accessor::deleteRecordInZone(const string (¶ms)[DEL_PARAM_COUNT]) { } void -SQLite3Accessor::deleteRecordInNSEC3Zone( +SQLite3Accessor::deleteNSEC3RecordInZone( const string (&/*params*/)[DEL_PARAM_COUNT]) { isc_throw(NotImplemented, "not yet implemented"); diff --git a/src/lib/datasrc/sqlite3_accessor.h b/src/lib/datasrc/sqlite3_accessor.h index cf9f394e8a..3e44d5b71c 100644 --- a/src/lib/datasrc/sqlite3_accessor.h +++ b/src/lib/datasrc/sqlite3_accessor.h @@ -214,13 +214,13 @@ public: virtual void addRecordToZone( const std::string (&columns)[ADD_COLUMN_COUNT]); - virtual void addRecordToNSEC3Zone( + virtual void addNSEC3RecordToZone( const std::string (&columns)[ADD_NSEC3_COLUMN_COUNT]); virtual void deleteRecordInZone( const std::string (¶ms)[DEL_PARAM_COUNT]); - virtual void deleteRecordInNSEC3Zone( + virtual void deleteNSEC3RecordInZone( const std::string (¶ms)[DEL_PARAM_COUNT]); /// This derived version of the method prepares an SQLite3 statement diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc index ac6776bb0b..eead1e78d4 100644 --- a/src/lib/datasrc/tests/database_unittest.cc +++ b/src/lib/datasrc/tests/database_unittest.cc @@ -250,10 +250,10 @@ public: virtual void commit() {} virtual void rollback() {} virtual void addRecordToZone(const string (&)[ADD_COLUMN_COUNT]) {} - virtual void addRecordToNSEC3Zone(const string (&)[ADD_NSEC3_COLUMN_COUNT]) + virtual void addNSEC3RecordToZone(const string (&)[ADD_NSEC3_COLUMN_COUNT]) {} virtual void deleteRecordInZone(const string (&)[DEL_PARAM_COUNT]) {} - virtual void deleteRecordInNSEC3Zone(const string (&)[DEL_PARAM_COUNT]) {} + virtual void deleteNSEC3RecordInZone(const string (&)[DEL_PARAM_COUNT]) {} virtual void addRecordDiff(int, uint32_t, DiffOperation, const std::string (&)[DIFF_PARAM_COUNT]) {} @@ -714,7 +714,7 @@ public: } private: - // Common subroutine for addRecordToZone and addRecordToNSEC3Zone. + // Common subroutine for addRecordToZone and addNSEC3RecordToZone. void addRecord(Domains& domains, const string (&columns)[ADD_COLUMN_COUNT]) { @@ -743,7 +743,7 @@ public: addRecord(*update_records_, columns); } - virtual void addRecordToNSEC3Zone( + virtual void addNSEC3RecordToZone( const string (&columns)[ADD_NSEC3_COLUMN_COUNT]) { // Convert the NSEC3 parameters in the normal (non NSEC3) style so @@ -772,7 +772,7 @@ private: const string& rdata_; }; - // Common subroutine for deleteRecordinZone and deleteRecordInNSEC3Zone. + // Common subroutine for deleteRecordinZone and deleteNSEC3RecordInZone. void deleteRecord(Domains& domains, const string (¶ms)[DEL_PARAM_COUNT]) { @@ -793,7 +793,7 @@ public: deleteRecord(*update_records_, params); } - virtual void deleteRecordInNSEC3Zone( + virtual void deleteNSEC3RecordInZone( const string (¶ms)[DEL_PARAM_COUNT]) { deleteRecord(*update_nsec3_namespace_, params);