![]() |
Kea
1.5.0
|
Implementation of the CqlHostDataSource. More...
Public Member Functions | |
| CqlHostDataSourceImpl (const CqlConnection::ParameterMap ¶meters) | |
| Constructor. More... | |
| virtual | ~CqlHostDataSourceImpl () |
| Destructor. More... | |
| virtual ConstHostPtr | get4 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const |
| Implementation of CqlHostDataSource::get4() More... | |
| virtual ConstHostPtr | get4 (const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const |
| Implementation of CqlHostDataSource::get4() More... | |
| virtual ConstHostPtr | get6 (const asiolink::IOAddress &prefix, const uint8_t prefix_len) const |
| Retrieves a host by its reserved IPv6 address or prefix. More... | |
| virtual ConstHostPtr | get6 (const SubnetID &subnet_id, const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const |
| Implementation of CqlHostDataSource::get6() More... | |
| virtual ConstHostPtr | get6 (const SubnetID &subnet_id, const asiolink::IOAddress &address) const |
| Implementation of CqlHostDataSource::get6() More... | |
| virtual ConstHostCollection | getAll (const Host::IdentifierType &identifier_type, const uint8_t *identifier_begin, const size_t identifier_len) const |
| Implementation of CqlHostDataSource::getAll() More... | |
| virtual ConstHostCollection | getAll4 (const asiolink::IOAddress &address) const |
| Implementation of CqlHostDataSource::getAll4() More... | |
| virtual ConstHostCollection | getAllHosts () const |
| Implementation of CqlHostDataSource::getAllHosts() More... | |
| virtual std::string | getName () const |
| Implementation of CqlHostDataSource::getName() More... | |
| virtual VersionPair | getVersion () const |
| Implementation of CqlHostDataSource::getVersion() More... | |
| virtual bool | insertOrDelete (const HostPtr &host, bool insert) |
| Implementation of CqlHostDataSource::add() and del() More... | |
Protected Member Functions | |
| virtual ConstHostPtr | getHost (StatementTag statement_tag, AnyArray &where_values) const |
| Retrieves a single host. More... | |
| virtual ConstHostCollection | getHostCollection (StatementTag statement_tag, AnyArray &where_values) const |
| Retrieves a collection of hosts. More... | |
| virtual bool | insertOrDeleteHost (bool insert, const HostPtr &host, const OptionalValue< SubnetID > &subnet_id=OptionalValue< SubnetID >(), const IPv6Resrv *const reservation=NULL, const std::string &option_space=NULL_OPTION_SPACE, const OptionDescriptor &option_descriptor=OptionDescriptor(false)) |
| Inserts or deletes a single host. More... | |
| virtual bool | insertOrDeleteHostWithOptions (bool insert, const HostPtr &host, const IPv6Resrv *const reservation=NULL, const std::list< std::string > &option_spaces=std::list< std::string >(), const ConstCfgOptionPtr cfg_option=ConstCfgOptionPtr()) |
| Adds/deletes any options found in the Host object to/from a separate table entry. More... | |
| virtual bool | insertOrDeleteHostWithReservations (bool insert, const HostPtr &host, const IPv6Resrv *const reservation, const std::list< std::string > &option_spaces4, const ConstCfgOptionPtr cfg_option4, const std::list< std::string > &option_spaces6, const ConstCfgOptionPtr cfg_option6) |
| Adds/deletes any reservations found in the Host object to/from a separate table entry. More... | |
| virtual void | mergeHosts (const ConstHostPtr &source_host, HostPtr &target_host) const |
| Merge denormalized table entries that belong to the same host into a single host, one by one. More... | |
Implementation of the CqlHostDataSource.
This class is encapsulate all the Cassandra communication details.
Definition at line 1346 of file cql_host_data_source.cc.
|
explicit |
Constructor.
This constructor opens database connection and initializes prepared statements used in the queries.
| parameters | parameters passed to the CQL connection. |
Definition at line 1594 of file cql_host_data_source.cc.
References isc::db::CQL_SCHEMA_VERSION_MAJOR, isc::db::CQL_SCHEMA_VERSION_MINOR, getVersion(), isc_throw, isc::db::CqlConnection::openDatabase(), isc::db::CqlConnection::prepareStatements(), and isc::dhcp::CqlHostExchange::tagged_statements_.
Here is the call graph for this function:
|
virtual |
Destructor.
Definition at line 1617 of file cql_host_data_source.cc.
|
virtual |
Implementation of CqlHostDataSource::get4()
See CqlHostDataSource::get4() for parameter details.
| subnet_id | Id of the subnet to look into |
| address | IPv4 address to be retrieved |
Definition at line 1667 of file cql_host_data_source.cc.
References isc::db::AnyArray::add(), isc::dhcp::CqlHostExchange::GET_HOST_BY_IPV4_SUBNET_ID_AND_ADDRESS, getHost(), isc_throw, isc::asiolink::IOAddress::isV4(), and isc::asiolink::IOAddress::toUint32().
Referenced by isc::dhcp::CqlHostDataSource::del(), isc::dhcp::CqlHostDataSource::del4(), and isc::dhcp::CqlHostDataSource::get4().
Here is the call graph for this function:
|
virtual |
Implementation of CqlHostDataSource::get4()
See CqlHostDataSource::get4() for parameter details.
| subnet_id | Id of the subnet to look into |
| identifier_type | type of the identifier |
| identifier_begin | pointer to the first byte of the identifier |
| identifier_len | length of the identifier |
Definition at line 1690 of file cql_host_data_source.cc.
References isc::db::AnyArray::add(), isc::dhcp::CqlHostExchange::GET_HOST_BY_IPV4_SUBNET_ID_AND_HOST_ID, and getHost().
Here is the call graph for this function:
|
virtual |
Retrieves a host by its reserved IPv6 address or prefix.
See CqlHostDataSource::get6() for parameter details.
| prefix | IPv6 address or prefix |
| prefix_len | length of the prefix (or 128 for address) |
Definition at line 1713 of file cql_host_data_source.cc.
References isc::db::AnyArray::add(), isc::dhcp::CqlHostExchange::GET_HOST_BY_IPV6_PREFIX, getAll(), getHost(), isc_throw, and isc::asiolink::IOAddress::toText().
Referenced by isc::dhcp::CqlHostDataSource::del6(), and isc::dhcp::CqlHostDataSource::get6().
Here is the call graph for this function:
|
virtual |
Implementation of CqlHostDataSource::get6()
See CqlHostDataSource::get6() for parameter details.
| subnet_id | Id of the subnet to look into |
| identifier_type | type of the identifier (duid, hwaddr, flex, etc.) |
| identifier_begin | pointer to the first byte of the identifier |
| identifier_len | length of the identifier |
Definition at line 1756 of file cql_host_data_source.cc.
References isc::db::AnyArray::add(), isc::dhcp::CqlHostExchange::GET_HOST_BY_IPV6_SUBNET_ID_AND_HOST_ID, and getHost().
Here is the call graph for this function:
|
virtual |
Implementation of CqlHostDataSource::get6()
See CqlHostDataSource::get6() for parameter details.
| subnet_id | Id of the subnet to look into |
| address | IPv6 address to be retrieved |
Definition at line 1779 of file cql_host_data_source.cc.
References isc::db::AnyArray::add(), isc::dhcp::CqlHostExchange::GET_HOST_BY_IPV6_SUBNET_ID_AND_ADDRESS, getHost(), and isc::asiolink::IOAddress::toText().
Here is the call graph for this function:
|
virtual |
Implementation of CqlHostDataSource::getAll()
See CqlHostDataSource::getAll() for parameter details.
| identifier_type | type of the identifier (duid, hwaddr, flex, etc.) |
| identifier_begin | pointer to the first byte of the identifier |
| identifier_len | length of the identifier |
Definition at line 1797 of file cql_host_data_source.cc.
References isc::db::AnyArray::add(), isc::dhcp::CqlHostExchange::GET_HOST_BY_HOST_ID, and getHostCollection().
Referenced by get6(), and isc::dhcp::CqlHostDataSource::getAll().
Here is the call graph for this function:
|
virtual |
Implementation of CqlHostDataSource::getAll4()
See CqlHostDataSource::getAll4() for parameter details.
| address | IPv4 address of the reservation to be retrieved |
Definition at line 1817 of file cql_host_data_source.cc.
References isc::db::AnyArray::add(), isc::dhcp::CqlHostExchange::GET_HOST_BY_IPV4_ADDRESS, getHostCollection(), and isc::asiolink::IOAddress::toUint32().
Referenced by isc::dhcp::CqlHostDataSource::getAll4().
Here is the call graph for this function:
|
virtual |
Implementation of CqlHostDataSource::getAllHosts()
See CqlHostDataSource::getAllHosts() for parameter details.
Definition at line 1833 of file cql_host_data_source.cc.
References isc::dhcp::CqlHostExchange::GET_HOST, and getHostCollection().
Referenced by isc::dhcp::CqlHostDataSource::getAllHosts().
Here is the call graph for this function:
|
protectedvirtual |
Retrieves a single host.
Calls getHostCollection() and checks if a single host was returned.
| where_values | array of bound objects used to filter the results |
| statement_tag | prepared statement being executed |
| MultipleRecords | exception if two or more hosts are returned |
Definition at line 1935 of file cql_host_data_source.cc.
References getHostCollection(), and isc_throw.
Referenced by get4(), and get6().
Here is the call graph for this function:
|
protectedvirtual |
Retrieves a collection of hosts.
Calls db::CqlExchange::executeSelect().
| where_values | array of bound objects used to filter the results |
| statement_tag | prepared statement being executed |
Definition at line 1953 of file cql_host_data_source.cc.
References isc::db::CqlExchange::executeSelect(), and mergeHosts().
Referenced by getAll(), getAll4(), getAllHosts(), and getHost().
Here is the call graph for this function:
|
virtual |
Implementation of CqlHostDataSource::getName()
Definition at line 1845 of file cql_host_data_source.cc.
References isc::db::DatabaseConnection::getParameter().
Referenced by isc::dhcp::CqlHostDataSource::getName().
Here is the call graph for this function:
|
virtual |
Implementation of CqlHostDataSource::getVersion()
Definition at line 1856 of file cql_host_data_source.cc.
References isc::db::CqlVersionExchange::retrieveVersion().
Referenced by CqlHostDataSourceImpl(), and isc::dhcp::CqlHostDataSource::getVersion().
Here is the call graph for this function:
|
virtual |
Implementation of CqlHostDataSource::add() and del()
See CqlHostDataSource::add() for parameter details.
| host | host to be added or deleted |
| insert | insert (true) or delete (false) the host |
Definition at line 1623 of file cql_host_data_source.cc.
References insertOrDeleteHostWithReservations().
Referenced by isc::dhcp::CqlHostDataSource::add(), isc::dhcp::CqlHostDataSource::del(), isc::dhcp::CqlHostDataSource::del4(), and isc::dhcp::CqlHostDataSource::del6().
Here is the call graph for this function:
|
protectedvirtual |
Inserts or deletes a single host.
All information is available here. Calls db::CqlExchange::executeMutation().
| insert | insert or delete a host |
| host | Host object from which options are retrieved and inserted/deleted into/from the Cassandra database |
| subnet_id | identifier of the subnet to which the host belongs |
| reservation | reservation for the current denormalized table entry |
| option_space | option space for the current denormalized table entry's option |
| option_descriptor | option descriptor containing information for the current denormalized table entry's option |
Definition at line 1991 of file cql_host_data_source.cc.
References isc::dhcp::CqlHostExchange::createBindForDelete(), isc::dhcp::CqlHostExchange::createBindForMutation(), isc::dhcp::CqlHostExchange::DELETE_HOST, isc::db::CqlExchange::executeMutation(), isc::dhcp::CqlHostExchange::INSERT_HOST, isc_throw, and isc::Exception::what().
Referenced by insertOrDeleteHostWithOptions().
Here is the call graph for this function:
|
protectedvirtual |
Adds/deletes any options found in the Host object to/from a separate table entry.
| insert | insert or delete a host with options |
| host | Host object from which options are retrieved and inserted/deleted into/from the Cassandra database |
| reservation | reservation for the current denormalized table entry |
| option_spaces | list of option spaces to search for |
| cfg_option | option configuration used to match option spaces in order to obtain actual options |
Definition at line 1862 of file cql_host_data_source.cc.
References insertOrDeleteHost().
Referenced by insertOrDeleteHostWithReservations().
Here is the call graph for this function:
|
protectedvirtual |
Adds/deletes any reservations found in the Host object to/from a separate table entry.
| insert | insert or deletes a host with reservations |
| host | Host object from which reservations are retrieved and inserted/deleted into/from the Cassandra database |
| reservation | reservation for the current denormalized table entry |
| option_spaces4 | list of option spaces for universe Option::V4 to search in |
| cfg_option4 | option configuration for universe Option::V4 used to match option spaces in order to obtain actual options |
| option_spaces6 | list of option spaces for universe Option::V6 to search in |
| cfg_option6 | option configuration for universe Option::V6 used to match option spaces in order to obtain actual options |
Definition at line 1903 of file cql_host_data_source.cc.
References insertOrDeleteHostWithOptions().
Referenced by insertOrDelete().
Here is the call graph for this function:
|
protectedvirtual |
Merge denormalized table entries that belong to the same host into a single host, one by one.
| target_host | host which can contain multiple reservations and options to which other distinct reservations and options are added. |
| source_host | host that is being search for new reservations and options that will be merged into the old host. |
Definition at line 2031 of file cql_host_data_source.cc.
Referenced by getHostCollection().