[svn] commit: r611 - in /experiments/each-query/src/lib/auth/cpp: data_source.cc data_source.h

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Jan 29 00:15:30 UTC 2010


Author: each
Date: Fri Jan 29 00:15:29 2010
New Revision: 611

Log:
checkpoint

Modified:
    experiments/each-query/src/lib/auth/cpp/data_source.cc
    experiments/each-query/src/lib/auth/cpp/data_source.h

Modified: experiments/each-query/src/lib/auth/cpp/data_source.cc
==============================================================================
--- experiments/each-query/src/lib/auth/cpp/data_source.cc (original)
+++ experiments/each-query/src/lib/auth/cpp/data_source.cc Fri Jan 29 00:15:29 2010
@@ -10,7 +10,7 @@
 namespace isc {
 namespace dns {
 
-DataSourceResult
+DSResult
 DataSource::runQuery(Query query)
 {
         return (NOT_IMPLEMENTED);

Modified: experiments/each-query/src/lib/auth/cpp/data_source.h
==============================================================================
--- experiments/each-query/src/lib/auth/cpp/data_source.h (original)
+++ experiments/each-query/src/lib/auth/cpp/data_source.h Fri Jan 29 00:15:29 2010
@@ -24,7 +24,7 @@
 namespace isc {
 namespace dns {
 
-enum DataSourceResult {
+enum DSResult {
     SUCCESS,
     NOT_IMPLEMENTED,
     ERROR,
@@ -39,57 +39,24 @@
 public:
     virtual ~AbstractDataSource();
 
-    //
-    // 'high-level' methods, these may or may not be overwritten;
-    // depending on the data source the default implementation
-    // may not be most efficient, but should at least provide
-    // the needed functionality
-    //
-    virtual DataSourceResult runQuery(Query query) = 0;
+    // 'High-level' methods.  These will be implemented by the
+    // general DataSource class, but MAY be overwritten by subclasses.
+    virtual DSResult runQuery(Query query) = 0;
 
-    // how to provide highlevel update data?
-    //result handleUpdate()
-    
-    //
-    // mandatory 'low-level' methods, an implementation must overwrite these
-    //
-    //
-    // for a 'catch-all' datasource, we need to be able to find
-    // out if it has a zone for a given name
-    //
-    // perhaps this should not set a zone Name, but rather a specific
-    // ZoneRef option (which could be datasource-specific, as it will
-    // only be used to pass along to other calls)
-    // Or even more abstract;
-    // SomeHandler initFind(name, whatever else);
-    virtual bool hasZoneFor(const Name& name, Name& zone_name) = 0;
+    // Mandatory 'low-level' methods: These will NOT be implemented by
+    // the general DataSource class; subclasses MUST implement them.
+    virtual DSResult findClosestEnclosure(const Name& qname,
+                                          Name& container) = 0;
 
-    // for the zone_name, see getZoneFor, perhaps this needs to be a more
-    // general handle
-    // And perhaps we need a function that does not have that argument too
-    virtual DataSourceResult findRRsets(Query &query) = 0;
+    virtual DSResult findRRset(const Name& qname,
+                               const RRClass& qclass,
+                               const RRType& qtype,
+                               RRset& target, RRset& sigs) = 0;
 
-    //
-    // optional 'low-level' methods, an implementation may overwrite these,
-    // by default they return NOT_IMPLEMENTED
-    //
-    virtual DataSourceResult init() = 0;
-    virtual DataSourceResult close() = 0;
-
-    //virtual result addRR(Name name, int clas, int type,
-    //                     int ttl, Rdata::RdataPtr data)
-    //                    { return NOT_IMPLEMENTED; };
-    //virtual result delRR(isc::dns::Name name, int clas, int type) = 0;
-    // on name/class/type again? or use an already constructed object?
-    //virtual result getRRSigs(RRsetPtr target, const RRsetPtr rrset)
-    //                        { return NOT_IMPLEMENTED; };
-    //virtual result getNSECs(RRsetPtr target, const RRsetPtr rrset)
-    //                        { return NOT_IMPLEMENTED; };
-
-    // check if the zone exists, and if so, return something that could
-    // be used as a pointer for the rest of these functions?
-    // do we need this? do we want this?
-    //virtual int getZone(void* zone, isc::dns::Name name);
+    // Optional 'low-level' methods.  These will have stub implementations
+    // in the general DataSource class but MAY be overwritten by subclasses
+    virtual DSResult init() = 0;
+    virtual DSResult close() = 0;
 };
 
 // Base class for a DNS Data Source
@@ -98,10 +65,18 @@
     DataSource() {};
     virtual ~DataSource() {};
 
-    DataSourceResult runQuery(Query q);
+    DSResult runQuery(Query q);
 
-    DataSourceResult init() { return NOT_IMPLEMENTED; }
-    DataSourceResult close() { return NOT_IMPLEMENTED; }
+    virtual DSResult findClosestEnclosure(const Name& qname,
+                                          Name& container) = 0;
+
+    virtual DSResult findRRset(const Name& qname,
+                               const RRClass& qclass,
+                               const RRType& qtype,
+                               RRset& target, RRset& sigs) = 0;
+
+    DSResult init() { return NOT_IMPLEMENTED; }
+    DSResult close() { return NOT_IMPLEMENTED; }
 };
 
 }




More information about the bind10-changes mailing list