mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 05:55:28 +00:00
[2541] Move method implementations in client.h to client.cc
This commit is contained in:
@@ -31,7 +31,7 @@ libb10_datasrc_la_SOURCES += zonetable.h zonetable.cc
|
|||||||
libb10_datasrc_la_SOURCES += zone.h zone_finder.cc zone_finder_context.cc
|
libb10_datasrc_la_SOURCES += zone.h zone_finder.cc zone_finder_context.cc
|
||||||
libb10_datasrc_la_SOURCES += result.h
|
libb10_datasrc_la_SOURCES += result.h
|
||||||
libb10_datasrc_la_SOURCES += logger.h logger.cc
|
libb10_datasrc_la_SOURCES += logger.h logger.cc
|
||||||
libb10_datasrc_la_SOURCES += client.h iterator.h
|
libb10_datasrc_la_SOURCES += client.h client.cc iterator.h
|
||||||
libb10_datasrc_la_SOURCES += database.h database.cc
|
libb10_datasrc_la_SOURCES += database.h database.cc
|
||||||
libb10_datasrc_la_SOURCES += factory.h factory.cc
|
libb10_datasrc_la_SOURCES += factory.h factory.cc
|
||||||
libb10_datasrc_la_SOURCES += client_list.h client_list.cc
|
libb10_datasrc_la_SOURCES += client_list.h client_list.cc
|
||||||
|
49
src/lib/datasrc/client.cc
Normal file
49
src/lib/datasrc/client.cc
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
#include <datasrc/client.h>
|
||||||
|
|
||||||
|
#include <exceptions/exceptions.h>
|
||||||
|
|
||||||
|
/// This file defines a few default implementations for methods.
|
||||||
|
///
|
||||||
|
/// While some of the detail of the API are worked out, we define
|
||||||
|
/// default implementations to ease development for some of the
|
||||||
|
/// more tentative methods (those that are not (yet) pure virtual)
|
||||||
|
/// They should all throw NotImplemented
|
||||||
|
|
||||||
|
namespace isc {
|
||||||
|
namespace datasrc {
|
||||||
|
|
||||||
|
ZoneIteratorPtr
|
||||||
|
DataSourceClient::getIterator(const isc::dns::Name&, bool) const {
|
||||||
|
isc_throw(isc::NotImplemented,
|
||||||
|
"Data source doesn't support iteration");
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
DataSourceClient::getZoneCount() const {
|
||||||
|
isc_throw(isc::NotImplemented,
|
||||||
|
"Data source doesn't support getZoneCount");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
DataSourceClient::createZone(const dns::Name&) {
|
||||||
|
isc_throw(isc::NotImplemented,
|
||||||
|
"Data source doesn't support addZone");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // end namespace datasrc
|
||||||
|
} // end namespace isc
|
@@ -20,8 +20,6 @@
|
|||||||
#include <boost/noncopyable.hpp>
|
#include <boost/noncopyable.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
#include <exceptions/exceptions.h>
|
|
||||||
|
|
||||||
#include <datasrc/zone.h>
|
#include <datasrc/zone.h>
|
||||||
|
|
||||||
/// \file
|
/// \file
|
||||||
@@ -225,15 +223,7 @@ public:
|
|||||||
/// adjusted to the lowest one found.
|
/// adjusted to the lowest one found.
|
||||||
/// \return Pointer to the iterator.
|
/// \return Pointer to the iterator.
|
||||||
virtual ZoneIteratorPtr getIterator(const isc::dns::Name& name,
|
virtual ZoneIteratorPtr getIterator(const isc::dns::Name& name,
|
||||||
bool separate_rrs = false) const {
|
bool separate_rrs = false) const;
|
||||||
// This is here to both document the parameter in doxygen (therefore it
|
|
||||||
// needs a name) and avoid unused parameter warning.
|
|
||||||
static_cast<void>(name);
|
|
||||||
static_cast<void>(separate_rrs);
|
|
||||||
|
|
||||||
isc_throw(isc::NotImplemented,
|
|
||||||
"Data source doesn't support iteration");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Return an updater to make updates to a specific zone.
|
/// Return an updater to make updates to a specific zone.
|
||||||
///
|
///
|
||||||
@@ -368,16 +358,15 @@ public:
|
|||||||
/// This is an optional convenience method, currently only implemented
|
/// This is an optional convenience method, currently only implemented
|
||||||
/// by the InMemory datasource. By default, it throws NotImplemented
|
/// by the InMemory datasource. By default, it throws NotImplemented
|
||||||
///
|
///
|
||||||
|
/// \note This is a tentative API, and this method is likely to change
|
||||||
|
/// or be removed in the near future. For that reason, it currently
|
||||||
|
/// provides a default implementation that throws NotImplemented.
|
||||||
|
///
|
||||||
/// \exception NotImplemented Thrown if this method is not supported
|
/// \exception NotImplemented Thrown if this method is not supported
|
||||||
/// by the datasource
|
/// by the datasource
|
||||||
///
|
///
|
||||||
/// \note This is a tentative API, and this method may likely to be
|
|
||||||
/// removed in the near future.
|
|
||||||
/// \return The number of zones known to this datasource
|
/// \return The number of zones known to this datasource
|
||||||
virtual unsigned int getZoneCount() const {
|
virtual unsigned int getZoneCount() const;
|
||||||
isc_throw(isc::NotImplemented,
|
|
||||||
"Data source doesn't support getZoneCount");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \brief Create a zone in the database
|
/// \brief Create a zone in the database
|
||||||
///
|
///
|
||||||
@@ -385,7 +374,8 @@ public:
|
|||||||
/// can subsequently be filled with data (through getUpdater()).
|
/// can subsequently be filled with data (through getUpdater()).
|
||||||
///
|
///
|
||||||
/// \note This is a tentative API, and this method is likely to change
|
/// \note This is a tentative API, and this method is likely to change
|
||||||
/// or be removed in the near future.
|
/// or be removed in the near future. For that reason, it currently
|
||||||
|
/// provides a default implementation that throws NotImplemented.
|
||||||
///
|
///
|
||||||
/// Apart from the two exceptions mentioned below, in theory this
|
/// Apart from the two exceptions mentioned below, in theory this
|
||||||
/// call can throw anything, depending on the implementation of
|
/// call can throw anything, depending on the implementation of
|
||||||
@@ -397,10 +387,7 @@ public:
|
|||||||
/// while creating the zone.
|
/// while creating the zone.
|
||||||
/// \param name The (fully qualified) name of the zone to create
|
/// \param name The (fully qualified) name of the zone to create
|
||||||
/// \return True if the zone was added, false if it already existed
|
/// \return True if the zone was added, false if it already existed
|
||||||
virtual bool createZone(const dns::Name&) {
|
virtual bool createZone(const dns::Name& name);
|
||||||
isc_throw(isc::NotImplemented,
|
|
||||||
"Data source doesn't support addZone");
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user