7 #ifndef BASE_HOST_DATA_SOURCE_H 8 #define BASE_HOST_DATA_SOURCE_H 14 #include <boost/shared_ptr.hpp> 53 explicit HostPageSize(
const size_t page_size) : page_size_(page_size) {
54 if (page_size_ == 0) {
57 if (page_size_ > std::numeric_limits<uint32_t>::max()) {
59 << std::numeric_limits<uint32_t>::max());
115 const uint8_t* identifier_begin,
116 const size_t identifier_len)
const = 0;
127 getAll4(
const SubnetID& subnet_id)
const = 0;
138 getAll6(
const SubnetID& subnet_id)
const = 0;
153 getAllbyHostname(
const std::string& hostname)
const = 0;
165 getAllbyHostname4(
const std::string& hostname,
const SubnetID& subnet_id)
const = 0;
177 getAllbyHostname6(
const std::string& hostname,
const SubnetID& subnet_id)
const = 0;
198 size_t& source_index,
199 uint64_t lower_host_id,
221 size_t& source_index,
222 uint64_t lower_host_id,
242 getPage4(
size_t& source_index,
243 uint64_t lower_host_id,
263 getPage6(
size_t& source_index,
264 uint64_t lower_host_id,
291 const uint8_t* identifier_begin,
292 const size_t identifier_len)
const = 0;
354 const uint8_t* identifier_begin,
355 const size_t identifier_len)
const = 0;
413 virtual void add(
const HostPtr& host) = 0;
436 virtual bool del4(
const SubnetID& subnet_id,
438 const uint8_t* identifier_begin,
const size_t identifier_len) = 0;
451 virtual bool del6(
const SubnetID& subnet_id,
453 const uint8_t* identifier_begin,
const size_t identifier_len) = 0;
460 virtual std::string getType()
const = 0;
501 virtual bool setIPReservationsUnique(
const bool unique) = 0;
522 #endif // BASE_HOST_DATA_SOURCE_H Wraps value holding size of the page with host reservations.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
virtual isc::db::DatabaseConnection::ParameterMap getParameters() const
Return backend parameters.
IdType
Specifies the type of an identifier.
virtual bool isUnusable()
Flag which indicates if the host manager has at least one unusable connection.
const size_t page_size_
Holds page size.
boost::shared_ptr< BaseHostDataSource > HostDataSourcePtr
HostDataSource pointer.
HostPageSize(const size_t page_size)
Constructor.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
DuplicateHost(const char *file, size_t line, const char *what)
std::vector< ConstHostPtr > ConstHostCollection
Collection of the const Host objects.
boost::shared_ptr< const Host > ConstHostPtr
Const pointer to the Host object.
virtual void rollback()
Rollback Transactions.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-lfc.
ReservedAddress(const char *file, size_t line, const char *what)
Exception thrown when the duplicate Host object is detected.
virtual void commit()
Commit Transactions.
Base interface for the classes implementing simple data source for host reservations.
std::vector< HostDataSourcePtr > HostDataSourceList
HostDataSource list.
virtual ~BaseHostDataSource()
Default destructor implementation.
A generic exception that is thrown if a parameter given to a method would refer to or modify out-of-r...
Exception thrown when invalid IP address has been specified for Host.
BadHostAddress(const char *file, size_t line, const char *what)
IdentifierType
Type of the host identifier.
std::map< std::string, std::string > ParameterMap
Database configuration parameter map.
The IOAddress class represents an IP addresses (version agnostic)
Exception thrown when an address is already reserved by a Host object (DuplicateHost is same identity...
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.