Commit fb441884 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[1067] Rename getIteratorContext to getAllRecords

This will be better for consistency, when we change the searchForRecords
to return an iterator object, it will be called getRecords.
parent 6f5ca0bd
......@@ -393,7 +393,7 @@ DatabaseClient::getIterator(const isc::dns::Name& name) const {
}
// Request the context
DatabaseAccessor::IteratorContextPtr
context(database_->getIteratorContext(name, zone.second));
context(database_->getAllRecords(name, zone.second));
// It must not return NULL, that's a bug of the implementation
if (context == DatabaseAccessor::IteratorContextPtr()) {
isc_throw(isc::Unexpected, "Iterator context null at " +
......
......@@ -120,7 +120,7 @@ public:
typedef boost::shared_ptr<IteratorContext> IteratorContextPtr;
/**
* \brief Creates an iterator context for given zone.
* \brief Creates an iterator context for the whole zone.
*
* This should create a new iterator context to be used by
* DatabaseConnection's ZoneIterator. It can be created based on the name
......@@ -136,8 +136,8 @@ public:
* \param id The ID of the zone, returned from getZone().
* \return Newly created iterator context. Must not be NULL.
*/
virtual IteratorContextPtr getIteratorContext(const isc::dns::Name& name,
int id) const
virtual IteratorContextPtr getAllRecords(const isc::dns::Name& name,
int id) const
{
/*
* This is a compromise. We need to document the parameters in doxygen,
......
......@@ -375,7 +375,7 @@ private:
};
DatabaseAccessor::IteratorContextPtr
SQLite3Database::getIteratorContext(const isc::dns::Name&, int id) const {
SQLite3Database::getAllRecords(const isc::dns::Name&, int id) const {
return (IteratorContextPtr(new Context(shared_from_this(), id)));
}
......
......@@ -91,8 +91,8 @@ public:
*/
virtual std::pair<bool, int> getZone(const isc::dns::Name& name) const;
/// \brief Implementation of DatabaseAbstraction::getIteratorContext
virtual IteratorContextPtr getIteratorContext(const isc::dns::Name&,
/// \brief Implementation of DatabaseAbstraction::getAllRecords
virtual IteratorContextPtr getAllRecords(const isc::dns::Name&,
int id) const;
/**
* \brief Start a new search for the given name in the given zone.
......
......@@ -171,7 +171,7 @@ private:
}
};
public:
virtual IteratorContextPtr getIteratorContext(const Name&, int id) const {
virtual IteratorContextPtr getAllRecords(const Name&, int id) const {
if (id == 42) {
return (IteratorContextPtr(new MockIteratorContext()));
} else if (id == 13) {
......@@ -391,10 +391,10 @@ private:
}
};
// This tests the default getIteratorContext behaviour, throwing NotImplemented
TEST(DatabaseConnectionTest, getIteratorContext) {
// This tests the default getAllRecords behaviour, throwing NotImplemented
TEST(DatabaseConnectionTest, getAllRecords) {
// The parameters don't matter
EXPECT_THROW(NopAccessor().getIteratorContext(Name("."), 1),
EXPECT_THROW(NopAccessor().getAllRecords(Name("."), 1),
isc::NotImplemented);
}
......
......@@ -110,7 +110,7 @@ TEST_F(SQLite3Access, iterator) {
// Get the iterator context
DatabaseAccessor::IteratorContextPtr
context(db->getIteratorContext(Name("example2.com"), 1));
context(db->getAllRecords(Name("example2.com"), 1));
ASSERT_NE(DatabaseAccessor::IteratorContextPtr(),
context);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment