|
@@ -0,0 +1,50 @@
|
|
|
+// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
|
|
|
+//
|
|
|
+// Permission to use, copy, modify, and/or distribute this software for any
|
|
|
+// purpose with or without fee is hereby granted, provided that the above
|
|
|
+// copyright notice and this permission notice appear in all copies.
|
|
|
+//
|
|
|
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
|
|
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
|
|
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
+// PERFORMANCE OF THIS SOFTWARE.
|
|
|
+
|
|
|
+#ifndef DATASRC_LOADER_CALLBACKS_H
|
|
|
+#define DATASRC_LOADER_CALLBACKS_H
|
|
|
+
|
|
|
+#include <dns/loader_callbacks.h>
|
|
|
+
|
|
|
+namespace isc {
|
|
|
+namespace datasrc {
|
|
|
+
|
|
|
+class ZoneUpdater;
|
|
|
+
|
|
|
+/// \brief Create callbacks to fill loaded zone into updater.
|
|
|
+///
|
|
|
+/// This will create set of callbacks for the MasterLoader that
|
|
|
+/// will fill the loaded rrsets into a zone updater. If any issues
|
|
|
+/// are found, it logs them. If any of the issues are errors and
|
|
|
+/// the ok parameter is non-NULL, it is set to false.
|
|
|
+///
|
|
|
+/// \param updater The zone updater used as the destination for the
|
|
|
+/// RRsets. It should be opened in the replace mode and should
|
|
|
+/// be clean (no changes done to it). It is not commited
|
|
|
+/// automatically and it is up to the caller to commit (or not)
|
|
|
+/// when the loading is done.
|
|
|
+/// \param name Name of the zone. Used in logging.
|
|
|
+/// \param rrclass The class of the zone. Used in logging.
|
|
|
+/// \param ok If this is non-NULL and there are any errors during
|
|
|
+/// the loading, it is set to false. Otherwise, it is untouched.
|
|
|
+/// \return Set of callbacks to be passed to the master loader.
|
|
|
+/// \throw std::bad_alloc when allocation fails.
|
|
|
+dns::LoaderCallbacks
|
|
|
+createCallbacks(ZoneUpdater& updater, const dns::Name& name,
|
|
|
+ const dns::RRClass& rrclass, bool* ok);
|
|
|
+
|
|
|
+}
|
|
|
+}
|
|
|
+
|
|
|
+#endif
|