BIND 10 #2541: add addZone() interface for data source
BIND 10 Development
do-not-reply at isc.org
Thu Dec 6 03:48:34 UTC 2012
#2541: add addZone() interface for data source
-------------------------------------+-------------------------------------
Reporter: | Owner:
jinmei | Status: new
Type: task | Milestone: New Tasks
Priority: | Keywords:
medium | Sensitive: 0
Component: data | Sub-Project: DNS
source | Estimated Difficulty: 0
CVSS Scoring: | Total Hours: 0
Defect Severity: N/A |
Feature Depending on Ticket: |
loadzone-ng |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
To complete the loadzone-ng tool (#2380), we need some way to add a
new zone to the "zones" table of the sqlite3 DB file (or in general
any backend of data sources, but in practice it means sqlite3 for the
moment); otherwise we cannot load a new zone from the scratch.
A tentative proposal to do this is to extend the `DataSourceClient`
class, adding the new `addZone()` method:
{{{#!cpp
class DataSourceClient : boost::noncopyable {
public:
// It first checks if the specified name of the zone exists. If it
// exists it returns false; otherwise it adds information of the
// new zone in backend-dependent manner and returns true.
// The DB-based version of this method would perform the check and add
in
// a single transaction.
//
// Throws on any unexpected failure.
virtual bool addZone(const dns::Name& zone_name) = 0;
};
}}}
And, for the DB-backend data sources, extend the `DatabaseAccessor`
class:
{{{#!cpp
class DatabaseAccessor : boost::noncopyable {
public:
// add the specified name of zone, return the zone ID.
virtual int addZone(const std::string& name) = 0;
};
}}}
and implement it for `SQLite3Accessor`.
We may have to heavily revisit the interface later (in which case some
of the things done in this ticket will become a waste), but it's still
probably better to add ad-hoc SQLite3-specific code to loadzone-ng
itself.
--
Ticket URL: <http://bind10.isc.org/ticket/2541>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list