Kea
1.9.9-git
|
Exchange MySQL and Lease6 Data. More...
Public Member Functions | |
MySqlLease6Exchange () | |
Constructor. More... | |
std::vector< MYSQL_BIND > | createBindForReceive () |
Create BIND array to receive data. More... | |
std::vector< MYSQL_BIND > | createBindForSend (const Lease6Ptr &lease) |
Create MYSQL_BIND objects for Lease6 Pointer. More... | |
std::string | getErrorColumns () |
Return columns in error. More... | |
Lease6Ptr | getLeaseData () |
Copy Received Data into Lease6 Object. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from isc::dhcp::MySqlLeaseExchange | |
static std::string | getColumnsInError (my_bool *error, std::string *names, size_t count) |
Return columns in error. More... | |
static void | setErrorIndicators (MYSQL_BIND *bind, my_bool *error, size_t count) |
Set error indicators. More... | |
Exchange MySQL and Lease6 Data.
On any MySQL operation, arrays of MYSQL_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 MySQL API, the process requires some intermediate variables to hold things like data length etc. This object holds those variables.
Definition at line 886 of file mysql_lease_mgr.cc.
|
inline |
Constructor.
The initialization of the variables here is only to satisfy cppcheck - all variables are initialized/set in the methods before they are used.
Definition at line 896 of file mysql_lease_mgr.cc.
References isc::db::MLM_FALSE.
|
inline |
Create BIND array to receive data.
Creates a MYSQL_BIND array to receive Lease6 data from the database. After data is successfully received, getLeaseData() is used to copy it to a Lease6 object.
Definition at line 1196 of file mysql_lease_mgr.cc.
References isc::db::MLM_FALSE, and isc::db::MLM_TRUE.
|
inline |
Create MYSQL_BIND objects for Lease6 Pointer.
Fills in the MYSQL_BIND array for sending data in the Lease4 object to the database.
lease | Lease object to be added to the database. |
Definition at line 940 of file mysql_lease_mgr.cc.
References isc_throw, isc::db::MLM_TRUE, isc::dhcp::USER_CONTEXT_MAX_LEN, and isc::Exception::what().
|
inline |
Return columns in error.
If an error is returned from a fetch (in particular, a truncated status), this method can be called to get the names of the fields in error. It returns a string comprising the names of the fields separated by commas. In the case of there being no error indicators set, it returns the string "(None)".
Definition at line 1456 of file mysql_lease_mgr.cc.
|
inline |
Copy Received Data into Lease6 Object.
Called after the MYSQL_BIND array created by createBindForReceive() has been used, this copies data from the internal member variables into a Lease6 object.
isc::BadValue | Unable to convert Lease Type value in database |
Definition at line 1354 of file mysql_lease_mgr.cc.
References isc_throw, and isc::db::MLM_FALSE.