![]() |
Kea
1.5.0
|
Provides mechanisms for sending and retrieving data from the host_reservations table. More...
Inheritance diagram for isc::dhcp::CqlHostExchange:Public Member Functions | |
| CqlHostExchange () | |
| Constructor. More... | |
| virtual | ~CqlHostExchange () |
| Virtual destructor. More... | |
| void | createBindForDelete (const HostPtr &host, const OptionalValue< SubnetID > &subnet_id, const IPv6Resrv *const reservation, const std::string &option_space, const OptionDescriptor &option_descriptor, StatementTag statement_tag, AnyArray &data) |
| Binds Host to data array to send data to the Cassandra database. More... | |
| void | createBindForMutation (const HostPtr &host, const OptionalValue< SubnetID > &subnet_id, const IPv6Resrv *const reservation, const std::string &option_space, const OptionDescriptor &option_descriptor, StatementTag statement_tag, AnyArray &data) |
| Binds Host to data array to send data to the Cassandra database. More... | |
| cass_int64_t | hashIntoId () const |
| Create unique hash for storage in table id. More... | |
| void | prepareExchange (const HostPtr &host, const OptionalValue< SubnetID > &subnet_id, const IPv6Resrv *const reservation, const std::string &option_space, const OptionDescriptor &option_descriptor) |
| Sets the exchange members with data of Host. More... | |
| virtual boost::any | retrieve () override |
| Copy received data into Host object. More... | |
| const OptionWrapper | retrieveOption () const |
| Retrieves option from members. More... | |
| const IPv6Resrv | retrieveReservation () const |
| Creates IPv6 reservation from the data contained in the currently processed row. More... | |
| virtual void | createBindForSelect (AnyArray &data, StatementTag statement_tag=NULL) override |
| Binds member variables to data array to receive Host data. More... | |
Public Member Functions inherited from isc::db::CqlExchange | |
| CqlExchange () | |
| Constructor. More... | |
| virtual | ~CqlExchange () |
| Destructor. More... | |
| void | executeMutation (const CqlConnection &connection, const AnyArray &assigned_values, StatementTag statement_tag) |
| Executes INSERT, UPDATE or DELETE statements. More... | |
| AnyArray | executeSelect (const CqlConnection &connection, const AnyArray &where_values, StatementTag statement_tag, const bool &single=false) |
| Executes SELECT statements. More... | |
| bool | statementApplied (CassFuture *future, size_t *row_count=NULL, size_t *column_count=NULL) |
| Check if CQL statement has been applied. More... | |
Public Member Functions inherited from isc::db::SqlExchange | |
| SqlExchange () | |
| Constructor. More... | |
| virtual | ~SqlExchange () |
| Destructor. More... | |
Static Public Attributes | |
| static StatementMap | tagged_statements_ |
| Cassandra statements. More... | |
| static constexpr StatementTag | INSERT_HOST |
| Statement tags definitions. More... | |
| static constexpr StatementTag | GET_HOST |
| static constexpr StatementTag | GET_HOST_BY_HOST_ID |
| static constexpr StatementTag | GET_HOST_BY_IPV4_ADDRESS |
| static constexpr StatementTag | GET_HOST_BY_IPV4_SUBNET_ID_AND_HOST_ID |
| static constexpr StatementTag | GET_HOST_BY_IPV6_SUBNET_ID_AND_HOST_ID |
| static constexpr StatementTag | GET_HOST_BY_IPV4_SUBNET_ID_AND_ADDRESS |
| static constexpr StatementTag | GET_HOST_BY_IPV6_PREFIX |
| static constexpr StatementTag | GET_HOST_BY_IPV6_SUBNET_ID_AND_ADDRESS |
| static constexpr StatementTag | DELETE_HOST |
Additional Inherited Members | |
Static Public Member Functions inherited from isc::db::CqlExchange | |
| static void | convertToDatabaseTime (const time_t &cltt, const uint32_t &valid_lifetime, cass_int64_t &expire) |
| static void | convertFromDatabaseTime (const cass_int64_t &expire, const cass_int64_t &valid_lifetime, time_t &cltt) |
| Converts time from Cassandra format. More... | |
Provides mechanisms for sending and retrieving data from the host_reservations table.
Definition at line 144 of file cql_host_data_source.cc.
| isc::dhcp::CqlHostExchange::CqlHostExchange | ( | ) |
|
virtual |
Virtual destructor.
Definition at line 785 of file cql_host_data_source.cc.
| void isc::dhcp::CqlHostExchange::createBindForDelete | ( | const HostPtr & | host, |
| const OptionalValue< SubnetID > & | subnet_id, | ||
| const IPv6Resrv *const | reservation, | ||
| const std::string & | option_space, | ||
| const OptionDescriptor & | option_descriptor, | ||
| StatementTag | statement_tag, | ||
| AnyArray & | data | ||
| ) |
Binds Host to data array to send data to the Cassandra database.
Fills in the bind array for sending data stored in the Host object to the database.
| host | Host object being deleted from the Cassandra database |
| subnet_id | identifier of the subnet to which the host belongs |
| reservation | IPv6 reservation belonging to the host |
| option_space | option space |
| option_descriptor | structure used to hold option information |
| statement_tag | tag of the statement being executed |
| data | array being filled with data from to the Host object |
Definition at line 1105 of file cql_host_data_source.cc.
References isc::db::AnyArray::add(), DELETE_HOST, isc_throw, prepareExchange(), and isc::Exception::what().
Referenced by isc::dhcp::CqlHostDataSourceImpl::insertOrDeleteHost().
Here is the call graph for this function:| void isc::dhcp::CqlHostExchange::createBindForMutation | ( | const HostPtr & | host, |
| const OptionalValue< SubnetID > & | subnet_id, | ||
| const IPv6Resrv *const | reservation, | ||
| const std::string & | option_space, | ||
| const OptionDescriptor & | option_descriptor, | ||
| StatementTag | statement_tag, | ||
| AnyArray & | data | ||
| ) |
Binds Host to data array to send data to the Cassandra database.
Fills in the bind array for sending data stored in the Host object to the database.
| host | Host object being added to the Cassandra database |
| subnet_id | identifier of the subnet to which the host belongs |
| reservation | IPv6 reservation belonging to the host |
| option_space | option space |
| option_descriptor | structure used to hold option information |
| statement_tag | tag of the statement being executed |
| data | array being filled with data from to the Host object |
Definition at line 1049 of file cql_host_data_source.cc.
References isc::db::AnyArray::add(), INSERT_HOST, isc_throw, prepareExchange(), and isc::Exception::what().
Referenced by isc::dhcp::CqlHostDataSourceImpl::insertOrDeleteHost().
Here is the call graph for this function:
|
overridevirtual |
Binds member variables to data array to receive Host data.
Creates a bind array to receive Host data from the Cassandra database. After data is successfully received, retrieve() can be called to retrieve the Host object. Called in db::CqlExchange::executeSelect().
| data | array of objects representing data being retrieved |
| statement_tag | prepared statement being executed; defaults to an invalid statement |
Denormalized reservation columns
Implements isc::db::CqlExchange.
Definition at line 789 of file cql_host_data_source.cc.
References isc::db::AnyArray::add().
Here is the call graph for this function:| cass_int64_t isc::dhcp::CqlHostExchange::hashIntoId | ( | ) | const |
Create unique hash for storage in table id.
Hash function used for creating a pseudo-unique hash from member values which uniquely determine an entry in the table. Uses FNV-1a on 64 bits.
The primary key aggregates: host_ipv4_subnet_id, host_ipv6_subnet_id, host_ipv4_address, reserved_ipv6_prefix_address, reserved_ipv6_prefix_length, option_code, option_space.
Definition at line 1130 of file cql_host_data_source.cc.
References isc::dhcp::DUID::MAX_DUID_LEN, and isc::dhcp::DUID::toText().
Referenced by prepareExchange().
Here is the call graph for this function:| void isc::dhcp::CqlHostExchange::prepareExchange | ( | const HostPtr & | host, |
| const OptionalValue< SubnetID > & | subnet_id, | ||
| const IPv6Resrv *const | reservation, | ||
| const std::string & | option_space, | ||
| const OptionDescriptor & | option_descriptor | ||
| ) |
Sets the exchange members with data of Host.
Fills in the members of the exchange with data from Host object.
| host | Host object being modified in the Cassandra database |
| subnet_id | identifier of the subnet to which the host belongs |
| reservation | IPv6 reservation belonging to the host |
| option_space | option space |
| option_descriptor | structure used to hold option information |
Definition at line 858 of file cql_host_data_source.cc.
References isc::dhcp::OptionDescriptor::formatted_value_, isc::data::UserContext::getContext(), isc::dhcp::IPv6Resrv::getPrefix(), isc::dhcp::IPv6Resrv::getPrefixLen(), isc::dhcp::IPv6Resrv::getType(), hashIntoId(), isc_throw, isc::util::OptionalValue< T >::isSpecified(), isc::dhcp::DUID::MAX_DUID_LEN, isc::dhcp::OptionDescriptor::option_, isc::dhcp::OptionDescriptor::persistent_, isc::asiolink::IOAddress::toText(), isc::dhcp::IPv6Resrv::TYPE_NA, and isc::Exception::what().
Referenced by createBindForDelete(), and createBindForMutation().
Here is the call graph for this function:
|
overridevirtual |
Copy received data into Host object.
Copies information about the host into a newly created Host object Called in executeSelect after createBindForSelect().
Implements isc::db::CqlExchange.
Definition at line 1164 of file cql_host_data_source.cc.
References isc::dhcp::Host::addReservation(), isc::dhcp::Host::getCfgOption4(), isc::dhcp::Host::getCfgOption6(), isc::dhcp::Host::hasReservation(), isc_throw, retrieveOption(), retrieveReservation(), isc::data::UserContext::setContext(), isc::dhcp::Host::setHostId(), isc::dhcp::Option::V4, isc::dhcp::Option::V6, and isc::Exception::what().
Here is the call graph for this function:| const OptionWrapper isc::dhcp::CqlHostExchange::retrieveOption | ( | ) | const |
Retrieves option from members.
Called after createBindForSelect().
Definition at line 1254 of file cql_host_data_source.cc.
References DHCP4_OPTION_SPACE, DHCP6_OPTION_SPACE, isc::dhcp::LibDHCP::getOptionDef(), isc::dhcp::LibDHCP::getRuntimeOptionDef(), isc::dhcp::LibDHCP::getVendorOptionDef(), isc_throw, isc::dhcp::LibDHCP::optionSpaceToVendorId(), and isc::Exception::what().
Referenced by retrieve().
Here is the call graph for this function:| const IPv6Resrv isc::dhcp::CqlHostExchange::retrieveReservation | ( | ) | const |
Creates IPv6 reservation from the data contained in the currently processed row.
Called after createBindForSelect().
Definition at line 1231 of file cql_host_data_source.cc.
References isc_throw, isc::dhcp::IPv6Resrv::TYPE_NA, and isc::dhcp::IPv6Resrv::TYPE_PD.
Referenced by retrieve().
|
static |
Definition at line 312 of file cql_host_data_source.cc.
Referenced by createBindForDelete(), and isc::dhcp::CqlHostDataSourceImpl::insertOrDeleteHost().
|
static |
Definition at line 268 of file cql_host_data_source.cc.
Referenced by isc::dhcp::CqlHostDataSourceImpl::getAllHosts().
|
static |
Definition at line 273 of file cql_host_data_source.cc.
Referenced by isc::dhcp::CqlHostDataSourceImpl::getAll().
|
static |
Definition at line 278 of file cql_host_data_source.cc.
Referenced by isc::dhcp::CqlHostDataSourceImpl::getAll4().
|
static |
Definition at line 294 of file cql_host_data_source.cc.
Referenced by isc::dhcp::CqlHostDataSourceImpl::get4().
|
static |
Definition at line 283 of file cql_host_data_source.cc.
Referenced by isc::dhcp::CqlHostDataSourceImpl::get4().
|
static |
Definition at line 303 of file cql_host_data_source.cc.
Referenced by isc::dhcp::CqlHostDataSourceImpl::get6().
|
static |
Definition at line 308 of file cql_host_data_source.cc.
Referenced by isc::dhcp::CqlHostDataSourceImpl::get6().
|
static |
Definition at line 289 of file cql_host_data_source.cc.
Referenced by isc::dhcp::CqlHostDataSourceImpl::get6().
|
static |
Statement tags definitions.
Definition at line 263 of file cql_host_data_source.cc.
Referenced by createBindForMutation(), and isc::dhcp::CqlHostDataSourceImpl::insertOrDeleteHost().
|
static |
Cassandra statements.
Definition at line 317 of file cql_host_data_source.cc.
Referenced by isc::dhcp::CqlHostDataSourceImpl::CqlHostDataSourceImpl().