Kea  2.1.7-git
isc::dhcp::PgSqlLeaseExchange Class Reference

Base class for marshalling leases to and from PostgreSQL. More...

+ Inheritance diagram for isc::dhcp::PgSqlLeaseExchange:

Public Member Functions

 PgSqlLeaseExchange ()
 
virtual ~PgSqlLeaseExchange ()
 
- Public Member Functions inherited from isc::db::PgSqlExchange
 PgSqlExchange (const size_t num_columns=0)
 Constructor. More...
 
virtual ~PgSqlExchange ()
 Destructor. More...
 

Protected Attributes

std::string addr_str_
 Common Instance members used for binding and conversion. More...
 
size_t hwaddr_length_
 
std::vector< uint8_t > hwaddr_
 
uint8_t hwaddr_buffer_ [HWAddr::MAX_HWADDR_LEN]
 
uint32_t valid_lifetime_
 
std::string valid_lifetime_str_
 
time_t expire_
 
std::string expire_str_
 
uint32_t subnet_id_
 
std::string subnet_id_str_
 
time_t cltt_
 
bool fqdn_fwd_
 
bool fqdn_rev_
 
std::string hostname_
 
std::string state_str_
 
std::string user_context_
 
- Protected Attributes inherited from isc::db::PgSqlExchange
std::vector< std::string > columns_
 Stores text labels for columns, currently only used for logging and errors. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from isc::db::PgSqlExchange
static void convertFromBytea (const PgSqlResult &r, const int row, const size_t col, uint8_t *buffer, const size_t buffer_size, size_t &bytes_converted)
 Converts a column in a row in a result set to a binary bytes. More...
 
static void convertFromBytea (const PgSqlResult &r, const int row, const size_t col, std::vector< uint8_t > &value)
 Converts a column in a row in a result set to a binary bytes. More...
 
static time_t convertFromDatabaseTime (const std::string &db_time_val)
 Converts time stamp from the database to a time_t. More...
 
static void convertFromDatabaseTime (const std::string &db_time_val, boost::posix_time::ptime &conv_time)
 Converts time stamp from the database to a boost::posix::ptime. More...
 
static std::string convertLocalToDatabaseTime (const time_t input_time)
 Converts local time_t value to a text representation in local time. More...
 
static std::string convertToDatabaseTime (const time_t input_time)
 Converts UTC time_t value to a text representation in local time. More...
 
static std::string convertToDatabaseTime (const time_t cltt, const uint32_t valid_lifetime)
 Converts lease expiration time to a text representation in local time. More...
 
static std::string dumpRow (const PgSqlResult &r, int row)
 Diagnostic tool which dumps the Result row contents as a string. More...
 
static std::string getColumnLabel (const PgSqlResult &r, const size_t col)
 Fetches the name of the column in a result set. More...
 
static void getColumnValue (const PgSqlResult &r, const int row, const size_t col, std::string &value)
 Fetches text column value as a string. More...
 
static void getColumnValue (const PgSqlResult &r, const int row, const size_t col, bool &value)
 Fetches boolean text ('t' or 'f') as a bool. More...
 
static void getColumnValue (const PgSqlResult &r, const int row, const size_t col, uint8_t &value)
 Fetches an integer text column as a uint8_t. More...
 
template<typename T >
static void getColumnValue (const PgSqlResult &r, const int row, const size_t col, T &value)
 Fetches a text column as the given value type. More...
 
static void getColumnValue (const PgSqlResult &r, const int row, const size_t col, boost::posix_time::ptime &value)
 Fetches a timestamp column as a ptime. More...
 
static void getColumnValue (const PgSqlResult &r, const int row, const size_t col, data::ElementPtr &value)
 Fetches a JSON column as an ElementPtr. More...
 
static isc::asiolink::IOAddress getInetValue4 (const PgSqlResult &r, const int row, const size_t col)
 Converts a column in a row in a result set into IPv4 address. More...
 
static isc::asiolink::IOAddress getInetValue6 (const PgSqlResult &r, const int row, const size_t col)
 Converts a column in a row in a result set into IPv6 address. More...
 
static isc::asiolink::IOAddress getIPv6Value (const PgSqlResult &r, const int row, const size_t col)
 Converts a column in a row in a result set into IPv6 address. More...
 
static const char * getRawColumnValue (const PgSqlResult &r, const int row, const size_t col)
 Gets a pointer to the raw column value in a result set row. More...
 
static isc::util::Triplet< uint32_t > getTripletValue (const PgSqlResult &r, const int row, const size_t col)
 Fetches a uint32_t value into a Triplet using a single column value. More...
 
static isc::util::Triplet< uint32_t > getTripletValue (const PgSqlResult &r, const int row, const size_t def_col, const size_t min_col, const size_t max_col)
 Fetches a uint32_t value into a Triplet using a three column values: default, minimum, and maximum. More...
 
static bool isColumnNull (const PgSqlResult &r, const int row, const size_t col)
 Returns true if a column within a row is null. More...
 

Detailed Description

Base class for marshalling leases to and from PostgreSQL.

Provides the common functionality to set up binding information between lease objects in the program and their database representation in the database.

Definition at line 388 of file pgsql_lease_mgr.cc.

Constructor & Destructor Documentation

◆ PgSqlLeaseExchange()

isc::dhcp::PgSqlLeaseExchange::PgSqlLeaseExchange ( )
inline

Definition at line 391 of file pgsql_lease_mgr.cc.

◆ ~PgSqlLeaseExchange()

virtual isc::dhcp::PgSqlLeaseExchange::~PgSqlLeaseExchange ( )
inlinevirtual

Definition at line 399 of file pgsql_lease_mgr.cc.

Member Data Documentation

◆ addr_str_

std::string isc::dhcp::PgSqlLeaseExchange::addr_str_
protected

Common Instance members used for binding and conversion.

Definition at line 405 of file pgsql_lease_mgr.cc.

◆ cltt_

time_t isc::dhcp::PgSqlLeaseExchange::cltt_
protected

Definition at line 415 of file pgsql_lease_mgr.cc.

◆ expire_

time_t isc::dhcp::PgSqlLeaseExchange::expire_
protected

Definition at line 411 of file pgsql_lease_mgr.cc.

◆ expire_str_

std::string isc::dhcp::PgSqlLeaseExchange::expire_str_
protected

Definition at line 412 of file pgsql_lease_mgr.cc.

◆ fqdn_fwd_

bool isc::dhcp::PgSqlLeaseExchange::fqdn_fwd_
protected

Definition at line 416 of file pgsql_lease_mgr.cc.

◆ fqdn_rev_

bool isc::dhcp::PgSqlLeaseExchange::fqdn_rev_
protected

Definition at line 417 of file pgsql_lease_mgr.cc.

◆ hostname_

std::string isc::dhcp::PgSqlLeaseExchange::hostname_
protected

Definition at line 418 of file pgsql_lease_mgr.cc.

◆ hwaddr_

std::vector<uint8_t> isc::dhcp::PgSqlLeaseExchange::hwaddr_
protected

Definition at line 407 of file pgsql_lease_mgr.cc.

◆ hwaddr_buffer_

uint8_t isc::dhcp::PgSqlLeaseExchange::hwaddr_buffer_[HWAddr::MAX_HWADDR_LEN]
protected

Definition at line 408 of file pgsql_lease_mgr.cc.

◆ hwaddr_length_

size_t isc::dhcp::PgSqlLeaseExchange::hwaddr_length_
protected

Definition at line 406 of file pgsql_lease_mgr.cc.

◆ state_str_

std::string isc::dhcp::PgSqlLeaseExchange::state_str_
protected

Definition at line 419 of file pgsql_lease_mgr.cc.

◆ subnet_id_

uint32_t isc::dhcp::PgSqlLeaseExchange::subnet_id_
protected

Definition at line 413 of file pgsql_lease_mgr.cc.

◆ subnet_id_str_

std::string isc::dhcp::PgSqlLeaseExchange::subnet_id_str_
protected

Definition at line 414 of file pgsql_lease_mgr.cc.

◆ user_context_

std::string isc::dhcp::PgSqlLeaseExchange::user_context_
protected

Definition at line 420 of file pgsql_lease_mgr.cc.

◆ valid_lifetime_

uint32_t isc::dhcp::PgSqlLeaseExchange::valid_lifetime_
protected

Definition at line 409 of file pgsql_lease_mgr.cc.

◆ valid_lifetime_str_

std::string isc::dhcp::PgSqlLeaseExchange::valid_lifetime_str_
protected

Definition at line 410 of file pgsql_lease_mgr.cc.


The documentation for this class was generated from the following file: