Commit 6afa2376 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[github88] getLeases6(DUID) removed.

parent 808ce380
......@@ -901,7 +901,6 @@ public:
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";
......@@ -942,7 +941,6 @@ constexpr StatementTag CqlLease6Exchange::UPDATE_LEASE6;
constexpr StatementTag CqlLease6Exchange::DELETE_LEASE6;
constexpr StatementTag CqlLease6Exchange::GET_LEASE6_EXPIRE;
constexpr StatementTag CqlLease6Exchange::GET_LEASE6_ADDR;
constexpr StatementTag CqlLease6Exchange::GET_LEASE6_DUID;
constexpr StatementTag CqlLease6Exchange::GET_LEASE6_DUID_IAID;
constexpr StatementTag CqlLease6Exchange::GET_LEASE6_DUID_IAID_SUBID;
constexpr StatementTag CqlLease6Exchange::GET_LEASE6_LIMIT;
......@@ -1017,17 +1015,6 @@ StatementMap CqlLease6Exchange::tagged_statements_ = {
"AND lease_type = ? "
"ALLOW FILTERING "}},
// Gets an IPv6 lease with specified duid
{GET_LEASE6_DUID,
{GET_LEASE6_DUID,
"SELECT "
"address, valid_lifetime, expire, subnet_id, pref_lifetime, duid, iaid, "
"lease_type, prefix_len, fqdn_fwd, fqdn_rev, hostname, hwaddr, hwtype, "
"hwaddr_source, state "
"FROM lease6 "
"WHERE duid = ? "
"ALLOW FILTERING "}},
// Gets an IPv6 lease(s) with specified duid and iaid
{GET_LEASE6_DUID_IAID,
{GET_LEASE6_DUID_IAID,
......@@ -2293,25 +2280,6 @@ CqlLeaseMgr::getLease6(Lease::Type lease_type, const IOAddress &addr) const {
return (result);
}
Lease6Collection
CqlLeaseMgr::getLeases6(const DUID& duid) const {
// Set up the WHERE clause value
AnyArray data;
CassBlob duid_data(duid.getDuid());
data.add(&duid_data);
// Get the data.
Lease6Collection result;
std::unique_ptr<CqlLease6Exchange> exchange6(new CqlLease6Exchange(dbconn_));
exchange6->getLeaseCollection(CqlLease6Exchange::GET_LEASE6_DUID, data, result);
return (result);
}
Lease6Collection
CqlLeaseMgr::getLeases6(Lease::Type lease_type, const DUID &duid, uint32_t iaid) const {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_CQL_GET_IAID_DUID)
......
......@@ -353,11 +353,6 @@ public:
getLeases6(const asiolink::IOAddress& lower_bound_address,
const LeasePageSize& page_size) const override;
/// @brief Returns all IPv6 leases.
///
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection getLeases6(const DUID& duid) const;
/// @brief Returns a collection of expired DHCPv4 leases.
///
/// This method returns at most @c max_leases expired leases. The leases
......
......@@ -499,11 +499,6 @@ public:
virtual Lease6Collection
getLeases6(const asiolink::IOAddress& lower_bound_address,
const LeasePageSize& page_size) const = 0;
/// @brief Returns collection of lease for matching DUID
///
/// @return Lease collection (may be empty if no IPv6 lease found for the DUID).
virtual Lease6Collection getLeases6(const DUID& duid) const = 0;
/// @brief Returns a collection of expired DHCPv4 leases.
///
......
......@@ -1015,20 +1015,6 @@ Memfile_LeaseMgr::getLeases6() const {
return (collection);
}
Lease6Collection
Memfile_LeaseMgr::getLeases6(const DUID& duid) const {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MEMFILE_GET6_DUID)
.arg(duid.toText());
Lease6Collection collection;
for (auto lease = storage6_.begin(); lease != storage6_.end(); ++lease ) {
if ( (**lease).duid_->getDuid() == duid.getDuid() )
collection.push_back(Lease6Ptr(new Lease6(**lease)));
}
return (collection);
}
Lease6Collection
Memfile_LeaseMgr::getLeases6(const asiolink::IOAddress& lower_bound_address,
const LeasePageSize& page_size) const {
......
......@@ -311,12 +311,6 @@ public:
///
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection getLeases6() const;
/// @brief Returns IPv6 leases for the DUID.
///
/// @todo: implement an optimised of the query using index.
/// @return Lease collection (may be empty if no IPv6 lease found) for the DUID.
virtual Lease6Collection getLeases6(const DUID& duid) const;
/// @brief Returns range of IPv6 leases using paging.
///
......
......@@ -308,12 +308,6 @@ public:
///
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection getLeases6() const;
/// @brief Returns all IPv6 leases for the DUID.
///
/// @todo: implement an optimised of the query using index.
/// @return Lease collection (may be empty if no IPv6 lease found) for the DUID.
virtual Lease6Collection getLeases6(const DUID& duid) const;
/// @brief Returns range of IPv6 leases using paging.
///
......
......@@ -1506,25 +1506,6 @@ PgSqlLeaseMgr::getLeases6(SubnetID subnet_id) const {
return (result);
}
Lease6Collection
PgSqlLeaseMgr::getLeases6( const DUID& duid ) const {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
DHCPSRV_PGSQL_GET_DUID)
.arg(duid.toText());
Lease6Collection result = getLeases6();
//erase the ones not containing the matching DUID
for (auto iter = result.begin(); iter != result.end();
iter++) {
if ((*iter)->duid_->getDuid() != duid.getDuid()) {
result.erase(iter);
}
}
return (result);
}
Lease6Collection
PgSqlLeaseMgr::getLeases6() const {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_PGSQL_GET6);
......
......@@ -280,12 +280,6 @@ public:
///
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection getLeases6() const;
/// @brief Returns IPv6 leases for the DUID.
///
/// @todo: implement an optimised of the query using index.
/// @return Lease collection (may be empty if no IPv6 lease found) for the DUID
virtual Lease6Collection getLeases6(const DUID& duid) const;
/// @brief Returns range of IPv6 leases using paging.
///
......@@ -315,11 +309,6 @@ public:
getLeases6(const asiolink::IOAddress& lower_bound_address,
const LeasePageSize& page_size) const;
/// @brief Returns all IPv6 leases.
///
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection getLeases6(const DUID& duid) const;
/// @brief Returns a collection of expired DHCPv4 leases.
///
/// This method returns at most @c max_leases expired leases. The leases
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment