18 #ifndef CQL_HOST_DATA_SOURCE_H
19 #define CQL_HOST_DATA_SOURCE_H
31 class CqlHostDataSourceImpl;
106 virtual void add(
const HostPtr& host)
override;
135 const uint8_t* identifier_begin,
136 const size_t identifier_len)
override;
153 const uint8_t* identifier_begin,
154 const size_t identifier_len)
override;
171 const uint8_t* identifier_begin,
172 const size_t identifier_len)
const override;
244 size_t& source_index,
245 uint64_t lower_host_id,
259 size_t& source_index,
260 uint64_t lower_host_id,
273 uint64_t lower_host_id,
286 uint64_t lower_host_id,
314 const uint8_t* identifier_begin,
315 const size_t identifier_len)
const override;
358 const uint8_t* identifier_begin,
359 const size_t identifier_len)
const override;
371 const uint8_t prefix_len)
const override;
417 virtual std::string
getName()
const;
422 virtual std::string
getType()
const override;
437 virtual void commit()
override;
470 #endif // CQL_HOST_DATA_SOURCE_H
virtual bool del(const SubnetID &subnet_id, const asiolink::IOAddress &addr) override
Attempts to delete hosts by (subnet-id, address)
virtual bool del6(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) override
Attempts to delete a host by (subnet-id6, identifier-type, identifier).
Wraps value holding size of the page with host reservations.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
virtual ConstHostCollection getAllbyHostname4(const std::string &hostname, const SubnetID &subnet_id) const override
Return all hosts with a hostname in a DHCPv4 subnet.
virtual ConstHostCollection getAll6(const SubnetID &subnet_id) const override
Return all hosts in a DHCPv6 subnet.
virtual ConstHostCollection getPage4(const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const override
Returns range of hosts in a DHCPv4 subnet.
virtual ConstHostCollection getPage6(const SubnetID &subnet_id, size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const override
Returns range of hosts in a DHCPv6 subnet.
virtual bool setIPReservationsUnique(const bool unique) override
Controls whether IP reservations are unique or non-unique.
std::vector< ConstHostPtr > ConstHostCollection
Collection of the const Host objects.
Implementation of the CqlHostDataSource.
virtual void commit() override
Commit Transactions.
virtual ConstHostPtr get6(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const override
Returns a Host connected to an IPv6 subnet.
virtual bool del4(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) override
Attempts to delete a host by (subnet-id4, identifier-type, identifier).
virtual void rollback() override
Rollback Transactions.
boost::shared_ptr< const Host > ConstHostPtr
Const pointer to the Host object.
std::pair< uint32_t, uint32_t > VersionPair
Pair containing major and minor versions.
CqlHostDataSource(const db::DatabaseConnection::ParameterMap ¶meters)
Constructor.
virtual void add(const HostPtr &host) override
Adds a new host to the collection.
virtual std::string getName() const
Returns the name of the database.
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual ConstHostCollection getAll(const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const override
Return all hosts connected to any subnet for which reservations have been made using a specified iden...
virtual db::VersionPair getVersion() const
Retrieves schema version from the DB.
Base interface for the classes implementing simple data source for host reservations.
virtual std::string getDescription() const
Returns textual description of the backend.
virtual ConstHostCollection getAllbyHostname6(const std::string &hostname, const SubnetID &subnet_id) const override
Return all hosts with a hostname in a DHCPv6 subnet.
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 ~CqlHostDataSource()
Virtual destructor.
virtual std::string getType() const override
Return backend type.
Cassandra host data source.
virtual ConstHostCollection getAllHosts() const
Returns a collection of all the hosts.
virtual ConstHostCollection getAllbyHostname(const std::string &hostname) const override
Return all hosts with a hostname.
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
virtual ConstHostCollection getAll4(const SubnetID &subnet_id) const override
Return all hosts in a DHCPv4 subnet.
virtual ConstHostPtr get4(const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const override
Retrieves a Host connected to an IPv4 subnet.