Kea  1.9.9-git
isc::dhcp::MemfileLeaseStatsQuery6 Class Reference

Memfile derivation of the IPv6 statistical lease data query. More...

+ Inheritance diagram for isc::dhcp::MemfileLeaseStatsQuery6:

Public Member Functions

 MemfileLeaseStatsQuery6 (Lease6Storage &storage6)
 Constructor. More...
 
 MemfileLeaseStatsQuery6 (Lease6Storage &storage6, const SubnetID &subnet_id)
 Constructor for a single subnet query. More...
 
 MemfileLeaseStatsQuery6 (Lease6Storage &storage6, const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
 Constructor for a subnet range query. More...
 
virtual ~MemfileLeaseStatsQuery6 ()
 Destructor. More...
 
virtual void start ()
 Creates the IPv6 lease statistical data result set. More...
 
- Public Member Functions inherited from isc::dhcp::MemfileLeaseStatsQuery
 MemfileLeaseStatsQuery ()
 Constructor for all subnets query. More...
 
 MemfileLeaseStatsQuery (const SubnetID &subnet_id)
 Constructor for single subnet query. More...
 
 MemfileLeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
 Constructor for subnet range query. More...
 
virtual ~MemfileLeaseStatsQuery ()
 Destructor. More...
 
virtual bool getNextRow (LeaseStatsRow &row)
 Fetches the next row in the result set. More...
 
int getRowCount () const
 Returns the number of rows in the result set. More...
 
- Public Member Functions inherited from isc::dhcp::LeaseStatsQuery
 LeaseStatsQuery ()
 Default constructor The query created will return statistics for all subnets. More...
 
 LeaseStatsQuery (const SubnetID &subnet_id)
 Constructor to query for a single subnet's stats. More...
 
 LeaseStatsQuery (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id)
 Constructor to query for the stats for a range of subnets. More...
 
virtual ~LeaseStatsQuery ()
 virtual destructor More...
 
SubnetID getFirstSubnetID () const
 Returns the value of first subnet ID specified (or zero) More...
 
SubnetID getLastSubnetID () const
 Returns the value of last subnet ID specified (or zero) More...
 
SelectMode getSelectMode () const
 Returns the selection criteria mode The value returned is based upon the constructor variant used and it indicates which query variant will be executed. More...
 

Additional Inherited Members

- Public Types inherited from isc::dhcp::LeaseStatsQuery
enum  SelectMode { ALL_SUBNETS, SINGLE_SUBNET, SUBNET_RANGE }
 Defines the types of selection criteria supported. More...
 
- Protected Attributes inherited from isc::dhcp::MemfileLeaseStatsQuery
std::vector< LeaseStatsRow >::iterator next_pos_
 An iterator for accessing the next row within the result set. More...
 
std::vector< LeaseStatsRowrows_
 A vector containing the "result set". More...
 
- Protected Attributes inherited from isc::dhcp::LeaseStatsQuery
SubnetID first_subnet_id_
 First (or only) subnet_id in the selection criteria. More...
 
SubnetID last_subnet_id_
 Last subnet_id in the selection criteria when a range is given. More...
 

Detailed Description

Memfile derivation of the IPv6 statistical lease data query.

This class is used to recalculate IPv6 lease statistics for Memfile lease storage. It does so by iterating over the given storage, accumulating counts of leases in each of the monitored lease states for each subnet and storing these counts in an internal collection. The populated result set will contain one entry per monitored state per subnet.

Definition at line 469 of file memfile_lease_mgr.cc.

Constructor & Destructor Documentation

isc::dhcp::MemfileLeaseStatsQuery6::MemfileLeaseStatsQuery6 ( Lease6Storage storage6)
inline

Constructor.

Parameters
storage6A pointer to the v6 lease storage to be counted

Definition at line 474 of file memfile_lease_mgr.cc.

isc::dhcp::MemfileLeaseStatsQuery6::MemfileLeaseStatsQuery6 ( Lease6Storage storage6,
const SubnetID subnet_id 
)
inline

Constructor for a single subnet query.

Parameters
storage6A pointer to the v6 lease storage to be counted
subnet_idID of the desired subnet

Definition at line 482 of file memfile_lease_mgr.cc.

isc::dhcp::MemfileLeaseStatsQuery6::MemfileLeaseStatsQuery6 ( Lease6Storage storage6,
const SubnetID first_subnet_id,
const SubnetID last_subnet_id 
)
inline

Constructor for a subnet range query.

Parameters
storage6A pointer to the v6 lease storage to be counted
first_subnet_idID of the first subnet in the desired range
last_subnet_idID of the last subnet in the desired range

Definition at line 491 of file memfile_lease_mgr.cc.

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

Destructor.

Definition at line 497 of file memfile_lease_mgr.cc.

Member Function Documentation

virtual void isc::dhcp::MemfileLeaseStatsQuery6::start ( )
inlinevirtual

Creates the IPv6 lease statistical data result set.

The result set is populated by iterating over the IPv6 leases in storage, in ascending order by subnet id, accumulating the lease state counts per subnet. At the completion of all entries for a given subnet, the counts are used to create LeaseStatsRow instances which are appended to an internal vector. The process results in a vector containing one entry per state per lease type per subnet.

Currently the states counted are:

Reimplemented from isc::dhcp::LeaseStatsQuery.

Definition at line 512 of file memfile_lease_mgr.cc.

References isc::dhcp::LeaseStatsQuery::ALL_SUBNETS, isc::dhcp::LeaseStatsQuery::getFirstSubnetID(), isc::dhcp::LeaseStatsQuery::getLastSubnetID(), isc::dhcp::LeaseStatsQuery::getSelectMode(), isc::dhcp::MemfileLeaseStatsQuery::next_pos_, isc::dhcp::MemfileLeaseStatsQuery::rows_, isc::dhcp::LeaseStatsQuery::SINGLE_SUBNET, isc::dhcp::Lease::STATE_DECLINED, isc::dhcp::Lease::STATE_DEFAULT, isc::dhcp::LeaseStatsQuery::SUBNET_RANGE, isc::dhcp::Lease::TYPE_NA, and isc::dhcp::Lease::TYPE_PD.

+ Here is the call graph for this function:


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