summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/pgsql_lease_mgr.h
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2022-06-24 18:05:35 +0200
committerFrancis Dupont <fdupont@isc.org>2022-06-24 18:07:23 +0200
commit6296b84c9492c087b669f5f9bdd661b088491f4e (patch)
tree42a995c870b07ef0eb34b0a11217933d53b6584a /src/lib/dhcpsrv/pgsql_lease_mgr.h
parent[#1614] Added a ChangeLog entry (diff)
downloadkea-6296b84c9492c087b669f5f9bdd661b088491f4e.tar.xz
kea-6296b84c9492c087b669f5f9bdd661b088491f4e.zip
[#2438] Added override keywords to lease manager API instances
Diffstat (limited to 'src/lib/dhcpsrv/pgsql_lease_mgr.h')
-rw-r--r--src/lib/dhcpsrv/pgsql_lease_mgr.h90
1 files changed, 46 insertions, 44 deletions
diff --git a/src/lib/dhcpsrv/pgsql_lease_mgr.h b/src/lib/dhcpsrv/pgsql_lease_mgr.h
index e96cf885ce..66522fa678 100644
--- a/src/lib/dhcpsrv/pgsql_lease_mgr.h
+++ b/src/lib/dhcpsrv/pgsql_lease_mgr.h
@@ -161,7 +161,7 @@ public:
///
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
- virtual bool addLease(const Lease4Ptr& lease);
+ virtual bool addLease(const Lease4Ptr& lease) override;
/// @brief Adds an IPv6 lease
///
@@ -172,7 +172,7 @@ public:
///
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
- virtual bool addLease(const Lease6Ptr& lease);
+ virtual bool addLease(const Lease6Ptr& lease) override;
/// @brief Returns an IPv4 lease for specified IPv4 address
///
@@ -189,7 +189,7 @@ public:
///
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
- virtual Lease4Ptr getLease4(const isc::asiolink::IOAddress& addr) const;
+ virtual Lease4Ptr getLease4(const isc::asiolink::IOAddress& addr) const override;
/// @brief Returns existing IPv4 leases for specified hardware address.
///
@@ -204,7 +204,7 @@ public:
///
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
- virtual Lease4Collection getLease4(const isc::dhcp::HWAddr& hwaddr) const;
+ virtual Lease4Collection getLease4(const isc::dhcp::HWAddr& hwaddr) const override;
/// @brief Returns existing IPv4 leases for specified hardware address
/// and a subnet
@@ -220,7 +220,7 @@ public:
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
virtual Lease4Ptr getLease4(const isc::dhcp::HWAddr& hwaddr,
- SubnetID subnet_id) const;
+ SubnetID subnet_id) const override;
/// @brief Returns existing IPv4 leases for specified client-id
///
@@ -235,7 +235,7 @@ public:
///
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
- virtual Lease4Collection getLease4(const ClientId& clientid) const;
+ virtual Lease4Collection getLease4(const ClientId& clientid) const override;
/// @brief Returns existing IPv4 lease for specified client-id
///
@@ -250,26 +250,26 @@ public:
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
virtual Lease4Ptr getLease4(const ClientId& clientid,
- SubnetID subnet_id) const;
+ SubnetID subnet_id) const override;
/// @brief Returns all IPv4 leases for the particular subnet identifier.
///
/// @param subnet_id subnet identifier.
///
/// @return Lease collection (may be empty if no IPv4 lease found).
- virtual Lease4Collection getLeases4(SubnetID subnet_id) const;
+ virtual Lease4Collection getLeases4(SubnetID subnet_id) const override;
/// @brief Returns all IPv4 leases for the particular hostname.
///
/// @param hostname hostname in lower case.
///
/// @return Lease collection (may be empty if no IPv4 lease found).
- virtual Lease4Collection getLeases4(const std::string& hostname) const;
+ virtual Lease4Collection getLeases4(const std::string& hostname) const override;
/// @brief Returns all IPv4 leases.
///
/// @return Lease collection (may be empty if no IPv4 lease found).
- virtual Lease4Collection getLeases4() const;
+ virtual Lease4Collection getLeases4() const override;
/// @brief Returns range of IPv4 leases using paging.
///
@@ -297,7 +297,7 @@ public:
/// @return Lease collection (may be empty if no IPv4 lease found).
virtual Lease4Collection
getLeases4(const asiolink::IOAddress& lower_bound_address,
- const LeasePageSize& page_size) const;
+ const LeasePageSize& page_size) const override;
/// @brief Returns existing IPv6 lease for a given IPv6 address.
///
@@ -315,7 +315,7 @@ public:
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
virtual Lease6Ptr getLease6(Lease::Type type,
- const isc::asiolink::IOAddress& addr) const;
+ const isc::asiolink::IOAddress& addr) const override;
/// @brief Returns existing IPv6 leases for a given DUID+IA combination
///
@@ -335,7 +335,7 @@ public:
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
virtual Lease6Collection getLeases6(Lease::Type type, const DUID& duid,
- uint32_t iaid) const;
+ uint32_t iaid) const override;
/// @brief Returns existing IPv6 lease for a given DUID+IA combination
///
@@ -351,33 +351,33 @@ public:
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
virtual Lease6Collection getLeases6(Lease::Type type, const DUID& duid,
- uint32_t iaid, SubnetID subnet_id) const;
+ uint32_t iaid, SubnetID subnet_id) const override;
/// @brief Returns all IPv6 leases for the particular subnet identifier.
///
/// @param subnet_id subnet identifier.
///
/// @return Lease collection (may be empty if no IPv6 lease found).
- virtual Lease6Collection getLeases6(SubnetID subnet_id) const;
+ virtual Lease6Collection getLeases6(SubnetID subnet_id) const override;
/// @brief Returns all IPv6 leases for the particular hostname.
///
/// @param hostname hostname in lower case.
///
/// @return Lease collection (may be empty if no IPv6 lease found).
- virtual Lease6Collection getLeases6(const std::string& hostname) const;
+ virtual Lease6Collection getLeases6(const std::string& hostname) const override;
/// @brief Returns all IPv6 leases.
///
/// @return Lease collection (may be empty if no IPv6 lease found).
- virtual Lease6Collection getLeases6() const;
+ virtual Lease6Collection getLeases6() const override;
/// @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;
+ virtual Lease6Collection getLeases6(const DUID& duid) const override;
/// @brief Returns range of IPv6 leases using paging.
///
@@ -405,7 +405,7 @@ public:
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection
getLeases6(const asiolink::IOAddress& lower_bound_address,
- const LeasePageSize& page_size) const;
+ const LeasePageSize& page_size) const override;
/// @brief Returns a collection of expired DHCPv4 leases.
///
@@ -418,7 +418,7 @@ public:
/// @param 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.
virtual void getExpiredLeases4(Lease4Collection& expired_leases,
- const size_t max_leases) const;
+ const size_t max_leases) const override;
/// @brief Returns a collection of expired DHCPv6 leases.
///
@@ -431,7 +431,7 @@ public:
/// @param 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.
virtual void getExpiredLeases6(Lease6Collection& expired_leases,
- const size_t max_leases) const;
+ const size_t max_leases) const override;
/// @brief Updates IPv4 lease.
///
@@ -453,7 +453,7 @@ public:
/// the value matches the one received on the SELECT query, effectively
/// enforcing no update on the lease between SELECT and UPDATE with
/// different expiration time.
- virtual void updateLease4(const Lease4Ptr& lease4);
+ virtual void updateLease4(const Lease4Ptr& lease4) override;
/// @brief Updates IPv6 lease.
///
@@ -475,7 +475,7 @@ public:
/// the value matches the one received on the SELECT query, effectively
/// enforcing no update on the lease between SELECT and UPDATE with
/// different expiration time.
- virtual void updateLease6(const Lease6Ptr& lease6);
+ virtual void updateLease6(const Lease6Ptr& lease6) override;
/// @brief Deletes an IPv4 lease.
///
@@ -491,7 +491,7 @@ public:
/// the value matches the one received on the SELECT query, effectively
/// enforcing no update on the lease between SELECT and DELETE with
/// different expiration time.
- virtual bool deleteLease(const Lease4Ptr& lease);
+ virtual bool deleteLease(const Lease4Ptr& lease) override;
/// @brief Deletes an IPv6 lease.
///
@@ -507,7 +507,7 @@ public:
/// the value matches the one received on the SELECT query, effectively
/// enforcing no update on the lease between SELECT and DELETE with
/// different expiration time.
- virtual bool deleteLease(const Lease6Ptr& lease);
+ virtual bool deleteLease(const Lease6Ptr& lease) override;
/// @brief Deletes all expired-reclaimed DHCPv4 leases.
///
@@ -516,7 +516,7 @@ public:
/// time will not be deleted.
///
/// @return Number of leases deleted.
- virtual uint64_t deleteExpiredReclaimedLeases4(const uint32_t secs);
+ virtual uint64_t deleteExpiredReclaimedLeases4(const uint32_t secs) override;
/// @brief Deletes all expired-reclaimed DHCPv6 leases.
///
@@ -525,7 +525,7 @@ public:
/// time will not be deleted.
///
/// @return Number of leases deleted.
- virtual uint64_t deleteExpiredReclaimedLeases6(const uint32_t secs);
+ virtual uint64_t deleteExpiredReclaimedLeases6(const uint32_t secs) override;
/// @brief Creates and runs the IPv4 lease stats query
///
@@ -535,7 +535,7 @@ public:
/// The query object is then returned.
///
/// @return The populated query as a pointer to an LeaseStatsQuery
- virtual LeaseStatsQueryPtr startLeaseStatsQuery4();
+ virtual LeaseStatsQueryPtr startLeaseStatsQuery4() override;
/// @brief Creates and runs the IPv4 lease stats query for a single subnet
///
@@ -545,7 +545,7 @@ public:
///
/// @param subnet_id id of the subnet for which stats are desired
/// @return A populated LeaseStatsQuery
- virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery4(const SubnetID& subnet_id);
+ virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery4(const SubnetID& subnet_id) override;
/// @brief Creates and runs the IPv4 lease stats query for a single subnet
///
@@ -557,7 +557,7 @@ public:
/// @param last_subnet_id last subnet in the range of subnets
/// @return A populated LeaseStatsQuery
virtual LeaseStatsQueryPtr startSubnetRangeLeaseStatsQuery4(const SubnetID& first_subnet_id,
- const SubnetID& last_subnet_id);
+ const SubnetID& last_subnet_id) override;
/// @brief Creates and runs the IPv6 lease stats query
///
@@ -567,7 +567,7 @@ public:
/// The query object is then returned.
///
/// @return The populated query as a pointer to an LeaseStatsQuery
- virtual LeaseStatsQueryPtr startLeaseStatsQuery6();
+ virtual LeaseStatsQueryPtr startLeaseStatsQuery6() override;
/// @brief Creates and runs the IPv6 lease stats query for a single subnet
///
@@ -577,7 +577,7 @@ public:
///
/// @param subnet_id id of the subnet for which stats are desired
/// @return A populated LeaseStatsQuery
- virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery6(const SubnetID& subnet_id);
+ virtual LeaseStatsQueryPtr startSubnetLeaseStatsQuery6(const SubnetID& subnet_id) override;
/// @brief Creates and runs the IPv6 lease stats query for a single subnet
///
@@ -589,7 +589,7 @@ public:
/// @param last_subnet_id last subnet in the range of subnets
/// @return A populated LeaseStatsQuery
virtual LeaseStatsQueryPtr startSubnetRangeLeaseStatsQuery6(const SubnetID& first_subnet_id,
- const SubnetID& last_subnet_id);
+ const SubnetID& last_subnet_id) override;
/// @brief Removes specified IPv4 leases.
///
@@ -600,7 +600,7 @@ public:
///
/// @param subnet_id identifier of the subnet
/// @return number of leases removed.
- virtual size_t wipeLeases4(const SubnetID& subnet_id);
+ virtual size_t wipeLeases4(const SubnetID& subnet_id) override;
/// @brief Removed specified IPv6 leases.
///
@@ -611,20 +611,20 @@ public:
///
/// @param subnet_id identifier of the subnet
/// @return number of leases removed.
- virtual size_t wipeLeases6(const SubnetID& subnet_id);
+ virtual size_t wipeLeases6(const SubnetID& subnet_id) override;
/// @brief Checks if JSON support is enabled in the database.
/// PostgreSQL implementation.
///
/// @return true if there is JSON support, false otherwise
- bool isJsonSupported() const override;
+ virtual bool isJsonSupported() const override;
/// @brief Return backend type
///
/// Returns the type of the backend (e.g. "mysql", "memfile" etc.)
///
/// @return Type of the backend.
- virtual std::string getType() const {
+ virtual std::string getType() const override {
return (std::string("postgresql"));
}
@@ -633,14 +633,14 @@ public:
/// Each backend have specific name.
///
/// @return Name of the backend.
- virtual std::string getName() const;
+ virtual std::string getName() const override;
/// @brief Returns description of the backend.
///
/// This description may be multiline text that describes the backend.
///
/// @return Description of the backend.
- virtual std::string getDescription() const;
+ virtual std::string getDescription() const override;
/// @brief Returns backend version.
///
@@ -649,7 +649,7 @@ public:
///
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
- virtual std::pair<uint32_t, uint32_t> getVersion() const;
+ virtual std::pair<uint32_t, uint32_t> getVersion() const override;
/// @brief Commit Transactions
///
@@ -657,7 +657,7 @@ public:
/// support transactions, this is a no-op.
///
/// PostgreSQL supports transactions but this manager does not use them.
- virtual void commit();
+ virtual void commit() override;
/// @brief Rollback Transactions
///
@@ -665,7 +665,7 @@ public:
/// support transactions, this is a no-op.
///
/// PostgreSQL supports transactions but this manager does not use them.
- virtual void rollback();
+ virtual void rollback() override;
/// @brief Statement Tags
///
@@ -932,7 +932,8 @@ private:
///
/// @return a string describing a limit that is being exceeded, or an empty
/// string if no limits are exceeded
- std::string checkLimits4(isc::data::ConstElementPtr const& user_context) const override;
+ virtual std::string
+ checkLimits4(isc::data::ConstElementPtr const& user_context) const override;
/// @brief Checks if the IPv6 lease limits set in the given user context are exceeded.
/// MySQL implementation.
@@ -945,7 +946,8 @@ private:
///
/// @return a string describing a limit that is being exceeded, or an empty
/// string if no limits are exceeded
- std::string checkLimits6(isc::data::ConstElementPtr const& user_context) const override;
+ virtual std::string
+ checkLimits6(isc::data::ConstElementPtr const& user_context) const override;
/// @brief Context RAII Allocator.
class PgSqlLeaseContextAlloc {