return (*col.begin());
}
+std::string
+LeaseMgr::getDBVersion() {
+ isc_throw(NotImplemented, "LeaseMgr::getDBVersion() called");
+}
+
} // namespace isc::dhcp
} // namespace isc
virtual ~LeaseMgr()
{}
+ /// @brief Class method to return extended version info
+ /// This class method must be redeclared and redefined in derived classes
+ static std::string getDBVersion();
+
/// @brief Adds an IPv4 lease.
///
/// @param lease lease to be added
}
}
+std::string
+Memfile_LeaseMgr::getDBVersion() {
+ std::stringstream tmp;
+ tmp << "Memfile backend " << MAJOR_VERSION;
+ tmp << "." << MINOR_VERSION;
+ return (tmp.str());
+}
+
bool
Memfile_LeaseMgr::addLease(const Lease4Ptr& lease) {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
/// @brief Destructor (closes file)
virtual ~Memfile_LeaseMgr();
+ /// @brief Local version of getDBVersion() class method
+ static std::string getDBVersion();
+
/// @brief Adds an IPv4 lease.
///
/// @param lease lease to be added
// closed in the destructor of the mysql_ member variable.
}
+std::string
+MySqlLeaseMgr::getDBVersion() {
+ std::stringstream tmp;
+ tmp << "MySQL backend " << CURRENT_VERSION_VERSION;
+ tmp << "." << CURRENT_VERSION_MINOR;
+ tmp << " library " << mysql_get_client_info();
+ return (tmp.str());
+}
+
// Time conversion methods.
//
/// @brief Destructor (closes database)
virtual ~MySqlLeaseMgr();
+ /// @brief Local version of getDBVersion() class method
+ static std::string getDBVersion();
+
/// @brief Adds an IPv4 lease
///
/// @param lease lease to be added
}
}
+std::string
+PgSqlLeaseMgr::getDBVersion() {
+ std::stringstream tmp;
+ tmp << "PostgreSQL backend " << PG_CURRENT_VERSION;
+ tmp << "." << PG_CURRENT_MINOR;
+ tmp << " library " << PQlibVersion();
+ return (tmp.str());
+}
+
void
PgSqlLeaseMgr::prepareStatements() {
for(int i = 0; tagged_statements[i].text != NULL; ++ i) {
/// @brief Destructor (closes database)
virtual ~PgSqlLeaseMgr();
+ /// @brief Local version of getDBVersion() class method
+ static std::string getDBVersion();
+
/// @brief Adds an IPv4 lease
///
/// @param lease lease to be added