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

[1331] Add journaling parameter to getUpdater

As the application can't call the constructor directly, it will be
passed from here.

Defaults to false as a backward compatibility (might be temporary)
parent 8cea64b6
...@@ -278,11 +278,16 @@ public: ...@@ -278,11 +278,16 @@ public:
/// ///
/// \param name The zone name to be updated /// \param name The zone name to be updated
/// \param replace Whether to delete existing RRs before making updates /// \param replace Whether to delete existing RRs before making updates
/// \param journaling The zone updater should store a journal of the
/// changes (such journal can be used, for example, by IXFR-out).
/// This is a hint only (the updater might be unable to store or
/// not store the journal).
/// ///
/// \return A pointer to the updater; it will be NULL if the specified /// \return A pointer to the updater; it will be NULL if the specified
/// zone isn't found. /// zone isn't found.
virtual ZoneUpdaterPtr getUpdater(const isc::dns::Name& name, virtual ZoneUpdaterPtr getUpdater(const isc::dns::Name& name,
bool replace) const = 0; bool replace, bool journaling = false)
const = 0;
}; };
} }
} }
......
...@@ -975,7 +975,10 @@ DatabaseUpdater::commit() { ...@@ -975,7 +975,10 @@ DatabaseUpdater::commit() {
// The updater factory // The updater factory
ZoneUpdaterPtr ZoneUpdaterPtr
DatabaseClient::getUpdater(const isc::dns::Name& name, bool replace) const { DatabaseClient::getUpdater(const isc::dns::Name& name, bool replace,
bool) const
{
// TODO: Handle journaling (pass it to the updater)
shared_ptr<DatabaseAccessor> update_accessor(accessor_->clone()); shared_ptr<DatabaseAccessor> update_accessor(accessor_->clone());
const std::pair<bool, int> zone(update_accessor->startUpdateZone( const std::pair<bool, int> zone(update_accessor->startUpdateZone(
name.toText(), replace)); name.toText(), replace));
......
...@@ -872,7 +872,8 @@ public: ...@@ -872,7 +872,8 @@ public:
/// accessor. The returned updater will be able to work separately from /// accessor. The returned updater will be able to work separately from
/// the original client. /// the original client.
virtual ZoneUpdaterPtr getUpdater(const isc::dns::Name& name, virtual ZoneUpdaterPtr getUpdater(const isc::dns::Name& name,
bool replace) const; bool replace,
bool journaling = false) const;
private: private:
/// \brief The RR class that this client handles. /// \brief The RR class that this client handles.
......
...@@ -811,7 +811,7 @@ InMemoryClient::getIterator(const Name& name) const { ...@@ -811,7 +811,7 @@ InMemoryClient::getIterator(const Name& name) const {
} }
ZoneUpdaterPtr ZoneUpdaterPtr
InMemoryClient::getUpdater(const isc::dns::Name&, bool) const { InMemoryClient::getUpdater(const isc::dns::Name&, bool, bool) const {
isc_throw(isc::NotImplemented, "Update attempt on in memory data source"); isc_throw(isc::NotImplemented, "Update attempt on in memory data source");
} }
......
...@@ -283,7 +283,8 @@ public: ...@@ -283,7 +283,8 @@ public:
/// to update via its updater (this may or may not be a good idea and /// to update via its updater (this may or may not be a good idea and
/// is subject to further discussions). /// is subject to further discussions).
virtual ZoneUpdaterPtr getUpdater(const isc::dns::Name& name, virtual ZoneUpdaterPtr getUpdater(const isc::dns::Name& name,
bool replace) const; bool replace, bool journaling = false)
const;
private: private:
// TODO: Do we still need the PImpl if nobody should manipulate this class // TODO: Do we still need the PImpl if nobody should manipulate this class
......
...@@ -32,7 +32,9 @@ public: ...@@ -32,7 +32,9 @@ public:
virtual FindResult findZone(const isc::dns::Name&) const { virtual FindResult findZone(const isc::dns::Name&) const {
return (FindResult(result::NOTFOUND, ZoneFinderPtr())); return (FindResult(result::NOTFOUND, ZoneFinderPtr()));
} }
virtual ZoneUpdaterPtr getUpdater(const isc::dns::Name&, bool) const { virtual ZoneUpdaterPtr getUpdater(const isc::dns::Name&, bool, bool)
const
{
return (ZoneUpdaterPtr()); return (ZoneUpdaterPtr());
} }
}; };
......
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