Kea  2.1.7-git
isc::dhcp::CacheHostDataSource Class Referenceabstract

Abstract interface extending base simple data source for host reservations to host cache. More...

#include <cache_host_data_source.h>

+ Inheritance diagram for isc::dhcp::CacheHostDataSource:

Public Member Functions

virtual ~CacheHostDataSource ()
 Default destructor implementation. More...
 
virtual size_t capacity () const =0
 Return the maximum number of entries. More...
 
virtual void flush (size_t count)=0
 Flush entries. More...
 
virtual size_t insert (const ConstHostPtr &host, bool overwrite)=0
 Insert a host into the cache. More...
 
virtual bool remove (const HostPtr &host)=0
 Remove a host from the cache. More...
 
virtual size_t size () const =0
 Return the number of entries. More...
 
- Public Member Functions inherited from isc::dhcp::BaseHostDataSource
virtual ~BaseHostDataSource ()
 Default destructor implementation. More...
 
virtual void add (const HostPtr &host)=0
 Adds a new host to the collection. More...
 
virtual void commit ()
 Commit Transactions. More...
 
virtual bool del (const SubnetID &subnet_id, const asiolink::IOAddress &addr)=0
 Attempts to delete hosts by (subnet-id, address) More...
 
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) More...
 
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) More...
 
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. More...
 
virtual ConstHostPtr get4 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const =0
 Returns a host connected to the IPv4 subnet and having a reservation for a specified IPv4 address. More...
 
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. More...
 
virtual ConstHostPtr get6 (const asiolink::IOAddress &prefix, const uint8_t prefix_len) const =0
 Returns a host using the specified IPv6 prefix. More...
 
virtual ConstHostPtr get6 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const =0
 Returns a host connected to the IPv6 subnet and having a reservation for a specified IPv6 address or prefix. More...
 
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 identifier. More...
 
virtual ConstHostCollection getAll4 (const SubnetID &subnet_id) const =0
 Return all hosts in a DHCPv4 subnet. More...
 
virtual ConstHostCollection getAll4 (const asiolink::IOAddress &address) const =0
 Returns a collection of hosts using the specified IPv4 address. More...
 
virtual ConstHostCollection getAll4 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const =0
 Returns all hosts connected to the IPv4 subnet and having a reservation for a specified address. More...
 
virtual ConstHostCollection getAll6 (const SubnetID &subnet_id) const =0
 Return all hosts in a DHCPv6 subnet. More...
 
virtual ConstHostCollection getAll6 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const =0
 Returns all hosts connected to the IPv6 subnet and having a reservation for a specified address or delegated prefix (lease). More...
 
virtual ConstHostCollection getAllbyHostname (const std::string &hostname) const =0
 Return all hosts with a hostname. More...
 
virtual ConstHostCollection getAllbyHostname4 (const std::string &hostname, const SubnetID &subnet_id) const =0
 Return all hosts with a hostname in a DHCPv4 subnet. More...
 
virtual ConstHostCollection getAllbyHostname6 (const std::string &hostname, const SubnetID &subnet_id) const =0
 Return all hosts with a hostname in a DHCPv6 subnet. More...
 
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. More...
 
virtual ConstHostCollection getPage4 (size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const =0
 Returns range of hosts. More...
 
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. More...
 
virtual ConstHostCollection getPage6 (size_t &source_index, uint64_t lower_host_id, const HostPageSize &page_size) const =0
 Returns range of hosts. More...
 
virtual isc::db::DatabaseConnection::ParameterMap getParameters () const
 Return backend parameters. More...
 
virtual std::string getType () const =0
 Return backend type. More...
 
virtual bool isUnusable ()
 Flag which indicates if the host manager has at least one unusable connection. More...
 
virtual void rollback ()
 Rollback Transactions. More...
 
virtual bool setIPReservationsUnique (const bool unique)=0
 Controls whether IP reservations are unique or non-unique. More...
 

Additional Inherited Members

- Public Types inherited from isc::dhcp::BaseHostDataSource
enum  IdType { ID_HWADDR = 0, ID_DUID = 1 }
 Specifies the type of an identifier. More...
 

Detailed Description

Abstract interface extending base simple data source for host reservations to host cache.

Only the insert() method is required to use the cache.

Definition at line 18 of file cache_host_data_source.h.

Constructor & Destructor Documentation

◆ ~CacheHostDataSource()

virtual isc::dhcp::CacheHostDataSource::~CacheHostDataSource ( )
inlinevirtual

Default destructor implementation.

Definition at line 22 of file cache_host_data_source.h.

References capacity(), flush(), insert(), and size().

+ Here is the call graph for this function:

Member Function Documentation

◆ capacity()

virtual size_t isc::dhcp::CacheHostDataSource::capacity ( ) const
pure virtual

Return the maximum number of entries.

Returns
the maximum number of entries, 0 means unbound.

Referenced by ~CacheHostDataSource().

◆ flush()

virtual void isc::dhcp::CacheHostDataSource::flush ( size_t  count)
pure virtual

Flush entries.

Parameters
countnumber of entries to remove, 0 means all.

Referenced by ~CacheHostDataSource().

◆ insert()

virtual size_t isc::dhcp::CacheHostDataSource::insert ( const ConstHostPtr host,
bool  overwrite 
)
pure virtual

Insert a host into the cache.

Similar to add() but with a different purpose.

Parameters
hostPointer to the new Host object being inserted.
overwritefalse if doing nothing in case of conflicts (and returning 1), true if removing conflicting entries (and returning their number).
Returns
number of conflicts limited to one if overwrite is false.

Referenced by ~CacheHostDataSource().

◆ remove()

virtual bool isc::dhcp::CacheHostDataSource::remove ( const HostPtr host)
pure virtual

Remove a host from the cache.

Does the same as del, del4 or del6 but with a more uniform interface and a different purpose.

Note
A pointer to a copy does not remove the object.
Parameters
hostPointer to the existing Host object being removed.
Returns
true when found and removed.

◆ size()

virtual size_t isc::dhcp::CacheHostDataSource::size ( ) const
pure virtual

Return the number of entries.

Returns
the current number of active entries in the cache.

Referenced by ~CacheHostDataSource().


The documentation for this class was generated from the following file: