![]() |
Kea
1.5.0
|
Exchange Lease6 information between Kea and CQL. More...
Inheritance diagram for isc::dhcp::CqlLease6Exchange:Public Member Functions | |
| CqlLease6Exchange (const CqlConnection &connection) | |
| Constructor. More... | |
| void | createBindForDelete (const IOAddress &address, AnyArray &data, StatementTag statement_tag=NULL) |
| Create CQL_BIND objects for Lease4 Pointer. More... | |
| void | createBindForInsert (const Lease6Ptr &lease, AnyArray &data) |
| Create CQL_BIND objects for Lease6 Pointer. More... | |
| virtual void | createBindForSelect (AnyArray &data, StatementTag statement_tag=NULL) override |
| Create BIND array to receive data. More... | |
| void | createBindForUpdate (const Lease6Ptr &lease, AnyArray &data, StatementTag statement_tag=NULL) |
| Create CQL_BIND objects for Lease6 Pointer. More... | |
| void | getExpiredLeases (const size_t &max_leases, Lease6Collection &expired_leases) |
| Returns expired leases. More... | |
| void | getLease (StatementTag &statement_tag, AnyArray &data, Lease6Ptr &result) |
| Retrieves one IPv6 lease. More... | |
| void | getLeaseCollection (StatementTag &statement_tag, AnyArray &data, Lease6Collection &result) |
| Retrieves zero or more IPv6 leases. More... | |
| virtual boost::any | retrieve () override |
| Retrieves the Lease6 object in Kea format. More... | |
Public Member Functions inherited from isc::dhcp::CqlLeaseExchange | |
| CqlLeaseExchange (const CqlConnection &connection) | |
| Constructor. More... | |
Public Member Functions inherited from isc::db::CqlExchange | |
| CqlExchange () | |
| Constructor. More... | |
| virtual | ~CqlExchange () |
| Destructor. More... | |
| void | executeMutation (const CqlConnection &connection, const AnyArray &assigned_values, StatementTag statement_tag) |
| Executes INSERT, UPDATE or DELETE statements. More... | |
| AnyArray | executeSelect (const CqlConnection &connection, const AnyArray &where_values, StatementTag statement_tag, const bool &single=false) |
| Executes SELECT statements. More... | |
| bool | statementApplied (CassFuture *future, size_t *row_count=NULL, size_t *column_count=NULL) |
| Check if CQL statement has been applied. More... | |
Public Member Functions inherited from isc::db::SqlExchange | |
| SqlExchange () | |
| Constructor. More... | |
| virtual | ~SqlExchange () |
| Destructor. More... | |
Static Public Attributes | |
| static StatementMap | tagged_statements_ |
| Cassandra statements. More... | |
| static constexpr StatementTag | INSERT_LEASE6 = "INSERT_LEASE6" |
| Statement tags definitions. More... | |
| static constexpr StatementTag | UPDATE_LEASE6 = "UPDATE_LEASE6" |
| static constexpr StatementTag | DELETE_LEASE6 = "DELETE_LEASE6" |
| static constexpr StatementTag | GET_LEASE6_EXPIRE = "GET_LEASE6_EXPIRE" |
| static constexpr StatementTag | GET_LEASE6_ADDR = "GET_LEASE6_ADDR" |
| static constexpr StatementTag | GET_LEASE6_DUID = "GET_LEASE6_DUID" |
| static constexpr StatementTag | GET_LEASE6_DUID_IAID = "GET_LEASE6_DUID_IAID" |
| static constexpr StatementTag | GET_LEASE6_DUID_IAID_SUBID = "GET_LEASE6_DUID_IAID_SUBID" |
| static constexpr StatementTag | GET_LEASE6_LIMIT = "GET_LEASE6_LIMIT" |
| static constexpr StatementTag | GET_LEASE6_PAGE = "GET_LEASE6_PAGE" |
Additional Inherited Members | |
Static Public Member Functions inherited from isc::db::CqlExchange | |
| static void | convertToDatabaseTime (const time_t &cltt, const uint32_t &valid_lifetime, cass_int64_t &expire) |
| static void | convertFromDatabaseTime (const cass_int64_t &expire, const cass_int64_t &valid_lifetime, time_t &cltt) |
| Converts time from Cassandra format. More... | |
Protected Attributes inherited from isc::dhcp::CqlLeaseExchange | |
| const CqlConnection & | connection_ |
| Database connection. More... | |
| cass_int64_t | expire_ |
| Lease expiry time. More... | |
| cass_bool_t | fqdn_fwd_ |
| Has forward DNS update been performed? More... | |
| cass_bool_t | fqdn_rev_ |
| Has reverse DNS update been performed? More... | |
| std::string | hostname_ |
| Client hostname. More... | |
| CassBlob | hwaddr_ |
| Hardware address. More... | |
| cass_int32_t | state_ |
| Lease state. More... | |
| cass_int32_t | subnet_id_ |
| Subnet identifier. More... | |
| std::string | user_context_ |
| User context. More... | |
| cass_int64_t | valid_lifetime_ |
| Lease timer. More... | |
Exchange Lease6 information between Kea and CQL.
On any CQL operation, arrays of CQL BIND structures must be built to describe the parameters in the prepared statements. Where information is inserted or retrieved - INSERT, UPDATE, SELECT - a large amount of that structure is identical. This class handles the creation of that array.
Owing to the CQL API, the process requires some intermediate variables to hold things like data length etc. This object holds those variables.
Definition at line 814 of file cql_lease_mgr.cc.
|
explicit |
Constructor.
The initialization of the variables here is only to satisfy cppcheck - all variables are initialized/set in the methods before they are used.
| connection | connection used for this query |
Definition at line 1082 of file cql_lease_mgr.cc.
| void isc::dhcp::CqlLease6Exchange::createBindForDelete | ( | const IOAddress & | address, |
| AnyArray & | data, | ||
| StatementTag | statement_tag = NULL |
||
| ) |
Create CQL_BIND objects for Lease4 Pointer.
Fills in the CQL_BIND array for sending data in the Lease6 object to the database. Used for DELETE statements.
| address | address of the lease to be deleted |
| data | lease info in CQL format will be stored here |
| statement_tag | tag identifying the query (optional) |
Definition at line 1363 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc_throw, isc::asiolink::IOAddress::toText(), and isc::Exception::what().
Here is the call graph for this function:Create CQL_BIND objects for Lease6 Pointer.
Fills in the CQL_BIND array for sending data in the Lease6 object to the database. Used for INSERT statements.
| lease | The lease information to be inserted |
| data | Lease info will be stored here in CQL format |
Definition at line 1088 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::CqlLeaseExchange::expire_, isc::dhcp::CqlLeaseExchange::fqdn_fwd_, isc::dhcp::CqlLeaseExchange::fqdn_rev_, isc::dhcp::CqlLeaseExchange::hostname_, isc::dhcp::CqlLeaseExchange::hwaddr_, isc_throw, isc::dhcp::HWAddr::MAX_HWADDR_LEN, isc::dhcp::CqlLeaseExchange::state_, isc::dhcp::CqlLeaseExchange::subnet_id_, isc::dhcp::CqlLeaseExchange::user_context_, isc::dhcp::CqlLeaseExchange::valid_lifetime_, and isc::Exception::what().
Here is the call graph for this function:
|
overridevirtual |
Create BIND array to receive data.
Creates a CQL_BIND array to receive Lease6 data from the database.
| data | info returned by CQL will be stored here |
| statement_tag | tag identifying the query (optional) |
Implements isc::dhcp::CqlLeaseExchange.
Definition at line 1385 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::CqlLeaseExchange::expire_, isc::dhcp::CqlLeaseExchange::fqdn_fwd_, isc::dhcp::CqlLeaseExchange::fqdn_rev_, isc::dhcp::CqlLeaseExchange::hostname_, isc::dhcp::CqlLeaseExchange::hwaddr_, isc::dhcp::CqlLeaseExchange::state_, isc::dhcp::CqlLeaseExchange::subnet_id_, isc::dhcp::CqlLeaseExchange::user_context_, and isc::dhcp::CqlLeaseExchange::valid_lifetime_.
Here is the call graph for this function:| void isc::dhcp::CqlLease6Exchange::createBindForUpdate | ( | const Lease6Ptr & | lease, |
| AnyArray & | data, | ||
| StatementTag | statement_tag = NULL |
||
| ) |
Create CQL_BIND objects for Lease6 Pointer.
Fills in the CQL_BIND array for sending data in the Lease6 object to the database. Used for UPDATE statements.
| lease | Updated lease information. |
| data | lease info in CQL format will be stored here |
| statement_tag | tag identifying the query (optional) |
Definition at line 1220 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), isc::dhcp::CqlLeaseExchange::expire_, isc::dhcp::CqlLeaseExchange::fqdn_fwd_, isc::dhcp::CqlLeaseExchange::fqdn_rev_, isc::dhcp::CqlLeaseExchange::hostname_, isc::dhcp::CqlLeaseExchange::hwaddr_, isc_throw, isc::dhcp::HWAddr::MAX_HWADDR_LEN, isc::dhcp::CqlLeaseExchange::state_, isc::dhcp::CqlLeaseExchange::subnet_id_, isc::dhcp::CqlLeaseExchange::user_context_, isc::dhcp::CqlLeaseExchange::valid_lifetime_, and isc::Exception::what().
Here is the call graph for this function:| void isc::dhcp::CqlLease6Exchange::getExpiredLeases | ( | const size_t & | max_leases, |
| Lease6Collection & | expired_leases | ||
| ) |
Returns expired leases.
This method returns up to specified number (see max_leases) of expired leases.
| max_leases | at most this number of leases will be returned |
| expired_leases | expired leases will be stored here |
Definition at line 1561 of file cql_lease_mgr.cc.
References isc::db::AnyArray::add(), GET_LEASE6_EXPIRE, getLeaseCollection(), isc::dhcp::Lease::STATE_DEFAULT, and isc::dhcp::Lease::STATE_EXPIRED_RECLAIMED.
Here is the call graph for this function:| void isc::dhcp::CqlLease6Exchange::getLease | ( | StatementTag & | statement_tag, |
| AnyArray & | data, | ||
| Lease6Ptr & | result | ||
| ) |
Retrieves one IPv6 lease.
| statement_tag | query to be executed |
| data | parameters for the query |
| result | pointer to the lease being returned (or null) |
Definition at line 1539 of file cql_lease_mgr.cc.
References getLeaseCollection(), and isc_throw.
Here is the call graph for this function:| void isc::dhcp::CqlLease6Exchange::getLeaseCollection | ( | StatementTag & | statement_tag, |
| AnyArray & | data, | ||
| Lease6Collection & | result | ||
| ) |
Retrieves zero or more IPv6 leases.
| statement_tag | query to be executed |
| data | parameters for the query |
| result | this lease collection will be updated |
Definition at line 1528 of file cql_lease_mgr.cc.
References isc::dhcp::CqlLeaseExchange::connection_, and isc::db::CqlExchange::executeSelect().
Referenced by getExpiredLeases(), and getLease().
Here is the call graph for this function:
|
overridevirtual |
Retrieves the Lease6 object in Kea format.
Implements isc::dhcp::CqlLeaseExchange.
Definition at line 1443 of file cql_lease_mgr.cc.
References isc::dhcp::CqlLeaseExchange::expire_, isc::dhcp::CqlLeaseExchange::fqdn_fwd_, isc::dhcp::CqlLeaseExchange::fqdn_rev_, isc::dhcp::CqlLeaseExchange::hostname_, isc::dhcp::CqlLeaseExchange::hwaddr_, isc_throw, isc::dhcp::DUID::MAX_DUID_LEN, isc::dhcp::HWAddr::MAX_HWADDR_LEN, isc::dhcp::CqlLeaseExchange::state_, isc::dhcp::CqlLeaseExchange::subnet_id_, isc::dhcp::Lease::TYPE_NA, isc::dhcp::Lease::TYPE_PD, isc::dhcp::Lease::TYPE_TA, isc::dhcp::CqlLeaseExchange::user_context_, isc::dhcp::CqlLeaseExchange::valid_lifetime_, and isc::Exception::what().
Here is the call graph for this function:
|
static |
Definition at line 903 of file cql_lease_mgr.cc.
Referenced by isc::dhcp::CqlLeaseMgr::deleteLease().
|
static |
Definition at line 905 of file cql_lease_mgr.cc.
Referenced by isc::dhcp::CqlLeaseMgr::getLease6().
|
static |
Definition at line 906 of file cql_lease_mgr.cc.
Referenced by isc::dhcp::CqlLeaseMgr::getLeases6().
|
static |
Definition at line 907 of file cql_lease_mgr.cc.
Referenced by isc::dhcp::CqlLeaseMgr::getLeases6().
|
static |
Definition at line 908 of file cql_lease_mgr.cc.
Referenced by isc::dhcp::CqlLeaseMgr::getLeases6().
|
static |
Definition at line 904 of file cql_lease_mgr.cc.
Referenced by isc::dhcp::CqlLeaseMgr::deleteExpiredReclaimedLeases6(), and getExpiredLeases().
|
static |
Definition at line 909 of file cql_lease_mgr.cc.
Referenced by isc::dhcp::CqlLeaseMgr::getLeases6().
|
static |
Definition at line 910 of file cql_lease_mgr.cc.
Referenced by isc::dhcp::CqlLeaseMgr::getLeases6().
|
static |
Statement tags definitions.
Definition at line 901 of file cql_lease_mgr.cc.
Referenced by isc::dhcp::CqlLeaseMgr::addLease().
|
static |
Cassandra statements.
Definition at line 897 of file cql_lease_mgr.cc.
Referenced by isc::dhcp::CqlLeaseMgr::CqlLeaseMgr().
|
static |
Definition at line 902 of file cql_lease_mgr.cc.
Referenced by isc::dhcp::CqlLeaseMgr::updateLease6().