7 #ifndef PGSQL_HOST_DATA_SOURCE_H
8 #define PGSQL_HOST_DATA_SOURCE_H
144 const uint8_t* identifier_begin,
145 const size_t identifier_len);
161 const uint8_t* identifier_begin,
162 const size_t identifier_len);
178 const uint8_t* identifier_begin,
179 const size_t identifier_len)
const;
257 size_t& source_index,
258 uint64_t lower_host_id,
279 size_t& source_index,
280 uint64_t lower_host_id,
300 uint64_t lower_host_id,
320 uint64_t lower_host_id,
345 const uint8_t* identifier_begin,
346 const size_t identifier_len)
const;
404 const uint8_t* identifier_begin,
405 const size_t identifier_len)
const;
414 const uint8_t prefix_len)
const;
460 return (std::string(
"postgresql"));
466 virtual std::string
getName()
const;
488 virtual std::pair<uint32_t, uint32_t>
getVersion()
const;
551 PgSqlHostDataSourceImplPtr impl_;
557 #endif // PGSQL_HOST_DATA_SOURCE_H
virtual ConstHostPtr get4(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const
Returns a host connected to the IPv4 subnet.
virtual ConstHostCollection getAllbyHostname4(const std::string &hostname, const SubnetID &subnet_id) const
Return all hosts with a hostname in a DHCPv4 subnet.
virtual ConstHostCollection getAll(const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const
Return all hosts connected to any subnet for which reservations have been made using a specified iden...
Wraps value holding size of the page with host reservations.
virtual void add(const HostPtr &host)
Adds a new host to the collection.
virtual std::string getType() const
Return backend type.
virtual ConstHostCollection getAll4(const SubnetID &subnet_id) const
Return all hosts in a DHCPv4 subnet.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
~PgSqlHostContextAlloc()
Destructor.
virtual bool setIPReservationsUnique(const bool unique)
Controls whether IP reservations are unique or non-unique.
PgSqlHostDataSource(const db::DatabaseConnection::ParameterMap ¶meters)
Constructor.
virtual bool del6(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len)
Attempts to delete a host by (subnet6-id, identifier type, identifier)
virtual ConstHostCollection getAll6(const SubnetID &subnet_id) const
Return all hosts in a DHCPv6 subnet.
std::vector< ConstHostPtr > ConstHostCollection
Collection of the const Host objects.
virtual std::string getName() const
Returns the name of the open database.
virtual ConstHostCollection getAllbyHostname(const std::string &hostname) const
Return all hosts with a hostname.
virtual ConstHostCollection getPage6(const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const
Returns range of hosts in a DHCPv6 subnet.
PgSqlHostContextPtr ctx_
The context.
virtual std::pair< uint32_t, uint32_t > getVersion() const
Returns backend version.
boost::shared_ptr< const Host > ConstHostPtr
Const pointer to the Host object.
virtual bool del4(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len)
Attempts to delete a host by (subnet4-id, identifier type, identifier)
virtual ConstHostPtr get6(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const
Returns a host connected to the IPv6 subnet.
virtual ~PgSqlHostDataSource()
Virtual destructor.
virtual bool del(const SubnetID &subnet_id, const asiolink::IOAddress &addr)
Attempts to delete hosts by (subnet-id, address)
virtual ConstHostCollection getPage4(const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const
Returns range of hosts in a DHCPv4 subnet.
boost::shared_ptr< PgSqlHostContext > PgSqlHostContextPtr
Type of pointers to contexts.
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual std::string getDescription() const
Returns description of the backend.
Implementation of the PgSqlHostDataSource.
PgSqlHostContextAlloc(PgSqlHostDataSourceImpl &mgr)
Constructor.
virtual bool isUnusable()
Flag which indicates if the host manager has at least one unusable connection.
Base interface for the classes implementing simple data source for host reservations.
virtual void rollback()
Rollback Transactions.
PostgreSQL Host Data Source.
virtual isc::db::DatabaseConnection::ParameterMap getParameters() const
Return backend parameters.
virtual void commit()
Commit Transactions.
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 ConstHostCollection getAllbyHostname6(const std::string &hostname, const SubnetID &subnet_id) const
Return all hosts with a hostname in a DHCPv6 subnet.
boost::shared_ptr< PgSqlHostDataSourceImpl > PgSqlHostDataSourceImplPtr
Type of pointers to PgSqlHostDataSourceImpl.
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)