7 #ifndef BASE_HOST_DATA_SOURCE_H
8 #define BASE_HOST_DATA_SOURCE_H
14 #include <boost/shared_ptr.hpp>
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;
198 size_t& source_index,
199 uint64_t lower_host_id,
221 size_t& source_index,
222 uint64_t lower_host_id,
243 uint64_t lower_host_id,
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;
438 const uint8_t* identifier_begin,
const size_t identifier_len) = 0;
453 const uint8_t* identifier_begin,
const size_t identifier_len) = 0;
460 virtual std::string
getType()
const = 0;
522 #endif // BASE_HOST_DATA_SOURCE_H
virtual isc::db::DatabaseConnection::ParameterMap getParameters() const
Return backend parameters.
virtual bool setIPReservationsUnique(const bool unique)=0
Controls whether IP reservations are unique or non-unique.
virtual std::string getType() const =0
Return backend type.
Wraps value holding size of the page with host reservations.
virtual ConstHostCollection getAllbyHostname4(const std::string &hostname, const SubnetID &subnet_id) const =0
Return all hosts with a hostname in a DHCPv4 subnet.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
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.
virtual ConstHostCollection getAllbyHostname6(const std::string &hostname, const SubnetID &subnet_id) const =0
Return all hosts with a hostname in a DHCPv6 subnet.
virtual ConstHostCollection getAll4(const SubnetID &subnet_id) const =0
Return all hosts in a DHCPv4 subnet.
boost::shared_ptr< BaseHostDataSource > HostDataSourcePtr
HostDataSource pointer.
HostPageSize(const size_t page_size)
Constructor.
virtual bool del4(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len)=0
Attempts to delete a host by (subnet-id4, identifier, identifier-type)
virtual ConstHostCollection getPage6(const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const =0
Returns range of hosts in a DHCPv6 subnet.
#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...
virtual bool del(const SubnetID &subnet_id, const asiolink::IOAddress &addr)=0
Attempts to delete hosts by (subnet-id, address)
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 ConstHostCollection getAll(const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const =0
Return all hosts connected to any subnet for which reservations have been made using a specified iden...
virtual void rollback()
Rollback Transactions.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
virtual ConstHostPtr get4(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const =0
Returns a host connected to the IPv4 subnet.
virtual bool del6(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len)=0
Attempts to delete a host by (subnet-id6, identifier, identifier-type)
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual ConstHostPtr get6(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const =0
Returns a host connected to the IPv6 subnet.
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)
virtual void add(const HostPtr &host)=0
Adds a new host to the collection.
Exception thrown when an address is already reserved by a Host object (DuplicateHost is same identity...
virtual ConstHostCollection getAllbyHostname(const std::string &hostname) const =0
Return all hosts with a hostname.
virtual ConstHostCollection getAll6(const SubnetID &subnet_id) const =0
Return all hosts in a DHCPv6 subnet.
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
virtual ConstHostCollection getPage4(const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const =0
Returns range of hosts in a DHCPv4 subnet.