Kea
1.9.9-git
|
Cassandra Lease Manager. More...
#include <cql_lease_mgr.h>
Public Member Functions | |
CqlLeaseMgr (const db::DatabaseConnection::ParameterMap ¶meters) | |
Constructor. More... | |
virtual | ~CqlLeaseMgr () |
Destructor (closes database) More... | |
virtual bool | addLease (const Lease4Ptr &lease) override |
Adds an IPv4 lease. More... | |
virtual bool | addLease (const Lease6Ptr &lease) override |
Adds an IPv6 lease. More... | |
virtual void | commit () override |
Commit Transactions. More... | |
virtual uint64_t | deleteExpiredReclaimedLeases4 (const uint32_t secs) override |
Deletes all expired and reclaimed DHCPv4 leases. More... | |
virtual uint64_t | deleteExpiredReclaimedLeases6 (const uint32_t secs) override |
Deletes all expired and reclaimed DHCPv6 leases. More... | |
bool | deleteLease (const Lease4Ptr &lease) overridefinal |
Deletes an IPv4 lease. More... | |
bool | deleteLease (const Lease6Ptr &lease) overridefinal |
Deletes an IPv6 lease. More... | |
virtual std::string | getDescription () const override |
Returns description of the backend. More... | |
virtual std::string | getName () const override |
Returns name of the database. More... | |
virtual std::string | getType () const override |
Return backend type. More... | |
virtual VersionPair | getVersion () const override |
Returns backend version. More... | |
virtual void | rollback () override |
Rollback Transactions. More... | |
virtual LeaseStatsQueryPtr | startLeaseStatsQuery4 () override |
Creates and runs the IPv4 lease stats query. More... | |
virtual LeaseStatsQueryPtr | startLeaseStatsQuery6 () override |
Creates and runs the IPv6 lease stats query. More... | |
virtual LeaseStatsQueryPtr | startSubnetLeaseStatsQuery4 (const SubnetID &subnet_id) override |
Creates and runs the IPv4 lease stats query for a single subnet. More... | |
virtual LeaseStatsQueryPtr | startSubnetLeaseStatsQuery6 (const SubnetID &subnet_id) override |
Creates and runs the IPv6 lease stats query for a single subnet. More... | |
virtual LeaseStatsQueryPtr | startSubnetRangeLeaseStatsQuery4 (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id) override |
Creates and runs the IPv4 lease stats query for a single subnet. More... | |
virtual LeaseStatsQueryPtr | startSubnetRangeLeaseStatsQuery6 (const SubnetID &first_subnet_id, const SubnetID &last_subnet_id) override |
Creates and runs the IPv6 lease stats query for a single subnet. More... | |
virtual void | updateLease4 (const Lease4Ptr &lease4) override |
Updates IPv4 lease. More... | |
virtual void | updateLease6 (const Lease6Ptr &lease6) override |
Updates IPv6 lease. More... | |
virtual size_t | wipeLeases4 (const SubnetID &subnet_id) override |
Removes specified IPv4 leases. More... | |
virtual size_t | wipeLeases6 (const SubnetID &subnet_id) override |
Removed specified IPv6 leases. More... | |
virtual Lease4Ptr | getLease4 (const isc::asiolink::IOAddress &addr) const override |
Basic lease access methods. More... | |
virtual Lease4Collection | getLease4 (const isc::dhcp::HWAddr &hwaddr) const override |
Returns existing IPv4 leases for specified hardware address. More... | |
virtual Lease4Ptr | getLease4 (const isc::dhcp::HWAddr &hwaddr, SubnetID subnet_id) const override |
Returns existing IPv4 leases for specified hardware address and a subnet. More... | |
virtual Lease4Collection | getLease4 (const ClientId &clientid) const override |
Returns existing IPv4 leases for specified client-id. More... | |
virtual Lease4Ptr | getLease4 (const ClientId &clientid, SubnetID subnet_id) const override |
Returns existing IPv4 lease for specified client-id. More... | |
virtual Lease4Collection | getLeases4 (SubnetID subnet_id) const override |
Returns all IPv4 leases for the particular subnet identifier. More... | |
virtual Lease4Collection | getLeases4 (const std::string &hostname) const override |
Returns all IPv4 leases for the particular hostname. More... | |
virtual Lease4Collection | getLeases4 () const override |
Returns all IPv4 leases. More... | |
virtual Lease4Collection | getLeases4 (const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size) const override |
Returns range of IPv4 leases using paging. More... | |
virtual Lease6Ptr | getLease6 (Lease::Type type, const isc::asiolink::IOAddress &addr) const override |
Returns existing IPv6 lease for a given IPv6 address. More... | |
virtual Lease6Collection | getLeases6 (Lease::Type type, const DUID &duid, uint32_t iaid) const override |
Returns existing IPv6 leases for a given DUID+IA combination. More... | |
virtual Lease6Collection | getLeases6 (Lease::Type type, const DUID &duid, uint32_t iaid, SubnetID subnet_id) const override |
Returns existing IPv6 lease for a given DUID+IA combination. More... | |
virtual Lease6Collection | getLeases6 (SubnetID subnet_id) const override |
Returns all IPv6 leases for the particular subnet identifier. More... | |
virtual Lease6Collection | getLeases6 (const std::string &hostname) const override |
Returns all IPv6 leases for the particular hostname. More... | |
virtual Lease6Collection | getLeases6 () const override |
Returns all IPv6 leases. More... | |
virtual Lease6Collection | getLeases6 (const DUID &duid) const override |
Returns all IPv6 leases. More... | |
virtual Lease6Collection | getLeases6 (const asiolink::IOAddress &lower_bound_address, const LeasePageSize &page_size) const override |
Returns range of IPv6 leases using paging. More... | |
virtual void | getExpiredLeases4 (Lease4Collection &expired_leases, const size_t max_leases) const override |
Returns a collection of expired DHCPv4 leases. More... | |
virtual void | getExpiredLeases6 (Lease6Collection &expired_leases, const size_t max_leases) const override |
Returns a collection of expired DHCPv6 leases. More... | |
Public Member Functions inherited from isc::dhcp::LeaseMgr | |
LeaseMgr () | |
Constructor. More... | |
virtual | ~LeaseMgr () |
Destructor. More... | |
Lease6Ptr | getLease6 (Lease::Type type, const DUID &duid, uint32_t iaid, SubnetID subnet_id) const |
returns zero or one IPv6 lease for a given duid+iaid+subnet_id More... | |
void | recountLeaseStats4 () |
Recalculates per-subnet and global stats for IPv4 leases. More... | |
void | recountLeaseStats6 () |
Recalculates per-subnet and global stats for IPv6 leases. More... | |
Static Public Member Functions | |
static std::string | getDBVersion () |
Local version of getDBVersion() class method. More... | |
Static Public Member Functions inherited from isc::dhcp::LeaseMgr | |
static std::string | getDBVersion () |
Class method to return extended version info This class method must be redeclared and redefined in derived classes. More... | |
static isc::asiolink::IOServicePtr & | getIOService () |
Returns pointer to the IO service. More... | |
static void | setIOService (const isc::asiolink::IOServicePtr &io_service) |
Sets IO service to be used by the Lease Manager. More... | |
Cassandra Lease Manager.
This class provides the isc::dhcp::LeaseMgr interface to the Cassandra database. Use of this backend implies that a CQL database is available and that the Kea schema has been created within it.
Definition at line 42 of file cql_lease_mgr.h.
|
explicit |
Constructor.
Uses the following keywords in the parameters passed to it to connect to the Cassandra cluster (if omitted, defaults specified in parentheses):
Finally, all the CQL commands are pre-compiled.
parameters | a data structure relating keywords and values concerned with the database. |
isc::db::NoDatabaseName | Mandatory database name not given |
isc::db::DbOpenError | Error opening the database or the schema version is invalid. |
isc::db::DbOperationError | An operation on the open database has failed. |
Definition at line 2100 of file cql_lease_mgr.cc.
References isc::db::CQL_SCHEMA_VERSION_MAJOR, isc::db::CQL_SCHEMA_VERSION_MINOR, getVersion(), isc_throw, isc::db::CqlConnection::openDatabase(), isc::db::CqlConnection::prepareStatements(), isc::dhcp::CqlLease4Exchange::tagged_statements_, and isc::dhcp::CqlLeaseStatsQuery::tagged_statements_.
|
virtual |
Destructor (closes database)
Definition at line 2122 of file cql_lease_mgr.cc.
|
overridevirtual |
Adds an IPv4 lease.
lease | lease to be added |
isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2137 of file cql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_CQL_ADD_ADDR4, isc::dhcp::DHCPSRV_CQL_LEASE_EXCEPTION_THROWN, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, LOG_DEBUG, and isc::Exception::what().
|
overridevirtual |
Adds an IPv6 lease.
lease | lease to be added |
isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2161 of file cql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_CQL_ADD_ADDR6, isc::dhcp::DHCPSRV_CQL_LEASE_EXCEPTION_THROWN, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, LOG_DEBUG, and isc::Exception::what().
|
overridevirtual |
Commit Transactions.
This is a no-op for Cassandra.
Implements isc::dhcp::LeaseMgr.
Definition at line 2837 of file cql_lease_mgr.cc.
References isc::db::CqlConnection::commit(), isc::dhcp::DHCPSRV_CQL_COMMIT, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, and LOG_DEBUG.
|
overridevirtual |
Deletes all expired and reclaimed DHCPv4 leases.
secs | number of seconds since expiration of leases before they can be removed. Leases which have expired later than this time will not be deleted. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2684 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), deleteLease(), isc::dhcp::DHCPSRV_CQL_DELETE_EXPIRED_RECLAIMED4, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, LOG_DEBUG, and isc::dhcp::Lease::STATE_EXPIRED_RECLAIMED.
|
overridevirtual |
Deletes all expired and reclaimed DHCPv6 leases.
secs | number of seconds since expiration of leases before they can be removed. Leases which have expired later than this time will not be deleted. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2715 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), deleteLease(), isc::dhcp::DHCPSRV_CQL_DELETE_EXPIRED_RECLAIMED6, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, LOG_DEBUG, and isc::dhcp::Lease::STATE_EXPIRED_RECLAIMED.
|
finaloverridevirtual |
Deletes an IPv4 lease.
lease | IPv4 lease being deleted. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2636 of file cql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_CQL_DELETE_ADDR, isc::dhcp::DHCPSRV_CQL_LEASE_EXCEPTION_THROWN, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, LOG_DEBUG, isc::asiolink::IOAddress::toText(), and isc::Exception::what().
Referenced by deleteExpiredReclaimedLeases4(), and deleteExpiredReclaimedLeases6().
|
finaloverridevirtual |
Deletes an IPv6 lease.
lease | IPv6 lease being deleted. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2660 of file cql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_CQL_DELETE_ADDR, isc::dhcp::DHCPSRV_CQL_LEASE_EXCEPTION_THROWN, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, LOG_DEBUG, isc::asiolink::IOAddress::toText(), and isc::Exception::what().
|
static |
Local version of getDBVersion() class method.
Definition at line 2128 of file cql_lease_mgr.cc.
References isc::db::CQL_SCHEMA_VERSION_MAJOR, and isc::db::CQL_SCHEMA_VERSION_MINOR.
Referenced by isc::dhcp::Dhcpv6Srv::getVersion(), and isc::dhcp::Dhcpv4Srv::getVersion().
|
overridevirtual |
Returns description of the backend.
This description may be multiline text that describes the backend.
Implements isc::dhcp::LeaseMgr.
Definition at line 2825 of file cql_lease_mgr.cc.
|
overridevirtual |
Returns a collection of expired DHCPv4 leases.
This method returns at most max_leases
expired leases. The leases returned haven't been reclaimed, i.e. the database query must exclude reclaimed leases from the results returned.
[out] | expired_leases | A container to which expired leases returned by the database backend are added. |
max_leases | A maximum number of leases to be returned. If this value is set to 0, all expired (but not reclaimed) leases are returned. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2578 of file cql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_CQL_GET_EXPIRED4, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, and LOG_DEBUG.
|
overridevirtual |
Returns a collection of expired DHCPv6 leases.
This method returns at most max_leases
expired leases. The leases returned haven't been reclaimed, i.e. the database query must exclude reclaimed leases from the results returned.
[out] | expired_leases | A container to which expired leases returned by the database backend are added. |
max_leases | A maximum number of leases to be returned. If this value is set to 0, all expired (but not reclaimed) leases are returned. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2588 of file cql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_CQL_GET_EXPIRED6, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, and LOG_DEBUG.
|
overridevirtual |
Basic lease access methods.
Obtain leases from the database using various criteria.Returns an IPv4 lease for specified IPv4 address
This method return a lease that is associated with a given address. For other query types (by hardware addr, by Client ID) there can be several leases in different subnets (e.g. for mobile clients that got address in different subnets). However, for a single address there can be only one lease, so this method returns a pointer to a single lease, not a container of leases.
addr | address of the searched lease |
isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2185 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::DHCPSRV_CQL_GET_ADDR4, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, LOG_DEBUG, isc::asiolink::IOAddress::toText(), and isc::asiolink::IOAddress::toUint32().
|
overridevirtual |
Returns existing IPv4 leases for specified hardware address.
Although in the usual case there will be only one lease, for mobile clients or clients with multiple static/fixed/reserved leases there can be more than one. Thus return type is a container, not a single pointer.
hwaddr | hardware address of the client |
isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2205 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::DHCPSRV_CQL_GET_HWADDR, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::HWAddr::hwaddr_, LOG_DEBUG, and isc::dhcp::HWAddr::toText().
|
overridevirtual |
Returns existing IPv4 leases for specified hardware address and a subnet.
There can be at most one lease for a given HW address in a single subnet, so this method with either return a single lease or NULL.
hwaddr | hardware address of the client |
subnet_id | identifier of the subnet that lease must belong to |
isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2224 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::DHCPSRV_CQL_GET_SUBID_HWADDR, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::HWAddr::hwaddr_, LOG_DEBUG, and isc::dhcp::HWAddr::toText().
|
overridevirtual |
Returns existing IPv4 leases for specified client-id.
Although in the usual case there will be only one lease, for mobile clients or clients with multiple static/fixed/reserved leases there can be more than one. Thus return type is a container, not a single pointer.
clientid | client identifier |
isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2248 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::DHCPSRV_CQL_GET_CLIENTID, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::ClientId::getClientId(), LOG_DEBUG, and isc::dhcp::ClientId::toText().
|
overridevirtual |
Returns existing IPv4 lease for specified client-id.
There can be at most one lease for a given HW address in a single pool, so this method with either return a single lease or NULL.
clientid | client identifier |
subnet_id | identifier of the subnet that lease must belong to |
isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2267 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::DHCPSRV_CQL_GET_SUBID_CLIENTID, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::ClientId::getClientId(), LOG_DEBUG, and isc::dhcp::ClientId::toText().
|
overridevirtual |
Returns existing IPv6 lease for a given IPv6 address.
For a given address, we assume that there will be only one lease. The assumption here is that there will not be site or link-local addresses used, so there is no way of having address duplication.
type | specifies lease type: (NA, TA or PD) |
addr | address of the searched lease |
isc::BadValue | record retrieved from database had an invalid lease type field. |
isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2388 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::DHCPSRV_CQL_GET_ADDR6, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc_throw, LOG_DEBUG, and isc::asiolink::IOAddress::toText().
|
overridevirtual |
Returns all IPv4 leases for the particular subnet identifier.
subnet_id | subnet identifier. |
NotImplemented | because this method is currently not implemented for this backend. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2290 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::DHCPSRV_CQL_GET_SUBID4, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, and LOG_DEBUG.
|
overridevirtual |
Returns all IPv4 leases for the particular hostname.
hostname | hostname in lower case. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2309 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::DHCPSRV_CQL_GET_HOSTNAME4, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, and LOG_DEBUG.
|
overridevirtual |
Returns all IPv4 leases.
NotImplemented | because this method is currently not implemented for this backend. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2328 of file cql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_CQL_GET4, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, and LOG_DEBUG.
|
overridevirtual |
Returns range of IPv4 leases using paging.
This method implements paged browsing of the lease database. The first parameter specifies a page size. The second parameter is optional and specifies the starting address of the range. This address is excluded from the returned range. The IPv4 zero address (default) denotes that the first page should be returned. There is no guarantee about the order of returned leases.
The typical usage of this method is as follows:
lower_bound_address | IPv4 address used as lower bound for the returned range. |
page_size | maximum size of the page returned. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2343 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::DHCPSRV_CQL_GET_PAGE4, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlLease4Exchange::GET_LEASE4_PAGE, isc_throw, isc::asiolink::IOAddress::isV4(), isc::asiolink::IOAddress::isV4Zero(), LOG_DEBUG, isc::dhcp::LeasePageSize::page_size_, isc::asiolink::IOAddress::toText(), and isc::asiolink::IOAddress::toUint32().
|
overridevirtual |
Returns existing IPv6 leases for a given DUID+IA combination.
Although in the usual case there will be only one lease, for mobile clients or clients with multiple static/fixed/reserved leases there can be more than one. Thus return type is a container, not a single pointer.
type | specifies lease type: (NA, TA or PD) |
duid | client DUID |
iaid | IA identifier |
isc::BadValue | record retrieved from database had an invalid lease type field. |
isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2437 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::DHCPSRV_CQL_GET_IAID_DUID, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::DUID::getDuid(), LOG_DEBUG, and isc::dhcp::DUID::toText().
|
overridevirtual |
Returns existing IPv6 lease for a given DUID+IA combination.
type | specifies lease type: (NA, TA or PD) |
duid | client DUID |
iaid | IA identifier |
subnet_id | subnet id of the subnet the lease belongs to |
isc::BadValue | record retrieved from database had an invalid lease type field. |
isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2464 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::DHCPSRV_CQL_GET_IAID_SUBID_DUID, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::DUID::getDuid(), LOG_DEBUG, and isc::dhcp::DUID::toText().
|
overridevirtual |
Returns all IPv6 leases for the particular subnet identifier.
subnet_id | subnet identifier. |
NotImplemented | because this method is currently not implemented for this backend. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2496 of file cql_lease_mgr.cc.
References isc_throw.
|
overridevirtual |
Returns all IPv6 leases for the particular hostname.
hostname | hostname in lower case. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2501 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::DHCPSRV_CQL_GET_HOSTNAME6, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, and LOG_DEBUG.
|
overridevirtual |
Returns all IPv6 leases.
NotImplemented | because this method is currently not implemented for this backend. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2520 of file cql_lease_mgr.cc.
References isc_throw.
|
overridevirtual |
Returns all IPv6 leases.
Implements isc::dhcp::LeaseMgr.
Definition at line 2418 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), and isc::dhcp::DUID::getDuid().
|
overridevirtual |
Returns range of IPv6 leases using paging.
This method implements paged browsing of the lease database. The first parameter specifies a page size. The second parameter is optional and specifies the starting address of the range. This address is excluded from the returned range. The IPv6 zero address (default) denotes that the first page should be returned. There is no guarantee about the order of returned leases.
The typical usage of this method is as follows:
lower_bound_address | IPv6 address used as lower bound for the returned range. |
page_size | maximum size of the page returned. |
isc::NotImplemented |
Implements isc::dhcp::LeaseMgr.
Definition at line 2525 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::DHCPSRV_CQL_GET_PAGE6, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::dhcp::CqlLease6Exchange::GET_LEASE6_PAGE, isc_throw, isc::asiolink::IOAddress::isV6(), isc::asiolink::IOAddress::isV6Zero(), LOG_DEBUG, isc::dhcp::LeasePageSize::page_size_, and isc::asiolink::IOAddress::toText().
|
overridevirtual |
Returns name of the database.
Implements isc::dhcp::LeaseMgr.
Definition at line 2814 of file cql_lease_mgr.cc.
References isc::db::DatabaseConnection::getParameter().
|
inlineoverridevirtual |
Return backend type.
Implements isc::dhcp::LeaseMgr.
Definition at line 570 of file cql_lease_mgr.h.
|
overridevirtual |
Returns backend version.
isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2830 of file cql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_CQL_GET_VERSION, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc::db::CqlConnection::getVersion(), and LOG_DEBUG.
Referenced by CqlLeaseMgr().
|
overridevirtual |
Rollback Transactions.
This is a no-op for Cassandra.
Implements isc::dhcp::LeaseMgr.
Definition at line 2843 of file cql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_CQL_ROLLBACK, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, LOG_DEBUG, and isc::db::CqlConnection::rollback().
|
overridevirtual |
Creates and runs the IPv4 lease stats query.
It creates an instance of a CqlLeaseStatsQuery4 and then invokes its start method, which fetches its statistical data result set by executing the ALL_LEASE_STATS4 query. The query object is then returned.
Reimplemented from isc::dhcp::LeaseMgr.
Definition at line 2746 of file cql_lease_mgr.cc.
|
overridevirtual |
Creates and runs the IPv6 lease stats query.
It creates an instance of a CqlLeaseStatsQuery and then invokes its start method, which fetches its statistical data result set by executing the ALL_LEASE_STATS6 query. The query object is then returned.
Reimplemented from isc::dhcp::LeaseMgr.
Definition at line 2774 of file cql_lease_mgr.cc.
|
overridevirtual |
Creates and runs the IPv4 lease stats query for a single subnet.
It creates an instance of a CqlLeaseStatsQuery4 for a single subnet query and then invokes its start method in which the query constructs its statistical data result set. The query object is then returned.
subnet_id | id of the subnet for which stats are desired |
Reimplemented from isc::dhcp::LeaseMgr.
Definition at line 2755 of file cql_lease_mgr.cc.
|
overridevirtual |
Creates and runs the IPv6 lease stats query for a single subnet.
It creates an instance of a CqlLeaseStatsQuery6 for a single subnet query and then invokes its start method in which the query constructs its statistical data result set. The query object is then returned.
subnet_id | id of the subnet for which stats are desired |
Reimplemented from isc::dhcp::LeaseMgr.
Definition at line 2783 of file cql_lease_mgr.cc.
|
overridevirtual |
Creates and runs the IPv4 lease stats query for a single subnet.
It creates an instance of a CqlLeaseStatsQuery4 for a subnet range query and then invokes its start method in which the query constructs its statistical data result set. The query object is then returned.
first_subnet_id | first subnet in the range of subnets |
last_subnet_id | last subnet in the range of subnets |
Reimplemented from isc::dhcp::LeaseMgr.
Definition at line 2764 of file cql_lease_mgr.cc.
|
overridevirtual |
Creates and runs the IPv6 lease stats query for a single subnet.
It creates an instance of a CqlLeaseStatsQuery6 for a subnet range query and then invokes its start method in which the query constructs its statistical data result set. The query object is then returned.
first_subnet_id | first subnet in the range of subnets |
last_subnet_id | last subnet in the range of subnets |
Reimplemented from isc::dhcp::LeaseMgr.
Definition at line 2792 of file cql_lease_mgr.cc.
|
overridevirtual |
Updates IPv4 lease.
Updates the record of the lease in the database (as identified by the address) with the data in the passed lease object.
lease4 | The lease to be updated. |
isc::dhcp::NoSuchLease | Attempt to update a lease that did not exist. |
isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2598 of file cql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_CQL_UPDATE_ADDR4, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc_throw, LOG_DEBUG, and isc::Exception::what().
|
overridevirtual |
Updates IPv6 lease.
Updates the record of the lease in the database (as identified by the address) with the data in the passed lease object.
lease6 | The lease to be updated. |
isc::dhcp::NoSuchLease | Attempt to update a lease that did not |
isc::db::DbOperationError | An operation on the open database has failed. |
Implements isc::dhcp::LeaseMgr.
Definition at line 2617 of file cql_lease_mgr.cc.
References isc::dhcp::DHCPSRV_CQL_UPDATE_ADDR6, isc::dhcp::DHCPSRV_DBG_TRACE_DETAIL, isc::dhcp::dhcpsrv_logger, isc_throw, LOG_DEBUG, and isc::Exception::what().
|
overridevirtual |
Removes specified IPv4 leases.
This rather dangerous method is able to remove all leases from specified subnet.
subnet_id | identifier of the subnet |
Implements isc::dhcp::LeaseMgr.
Definition at line 2802 of file cql_lease_mgr.cc.
References isc_throw.
|
overridevirtual |
Removed specified IPv6 leases.
This rather dangerous method is able to remove all leases from specified subnet.
subnet_id | identifier of the subnet |
Implements isc::dhcp::LeaseMgr.
Definition at line 2808 of file cql_lease_mgr.cc.
References isc_throw.