26 static_cast<void>(addresses_.insert(address));
37 return (addresses_.count(address));
51 : io_service_(new
IOService()), address_list_(family) {
54 isc_throw(BadValue,
"Lease Query config is empty or not a map");
60 "'requesters' address list is missing or not a list");
63 for (
auto const& address_elem : requesters->listValue()) {
65 IOAddress address(address_elem->stringValue());
66 address_list_.insert(address);
67 } catch (
const std::exception& ex) {
69 "'requesters' entry '" << address_elem->stringValue()
70 <<
"' is invalid: " << ex.what());
74 if (address_list_.size() == 0) {
75 isc_throw(BadValue,
"'requesters' address list cannot be empty");
85 io_service_->stopAndPoll();
90 return (address_list_.contains(address));
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
The IOAddress class represents an IP addresses (version agnostic)
short getFamily() const
Returns the address family.
The IOService class is a wrapper for the ASIO io_context class.
bool contains(const isc::asiolink::IOAddress &address) const
Checks if an address is present in the list.
void insert(const isc::asiolink::IOAddress &address)
Inserts an address into the list.
static void create(LeaseQueryImpl *impl, isc::data::ConstElementPtr advanced)
Create a new instance of the BulkLeaseQueryService.
static bool terminated_
Terminated flag.
LeaseQueryImpl(uint16_t family, const isc::data::ConstElementPtr config)
Constructor.
static const isc::data::SimpleKeywords LEASE_QUERY_KEYWORDS
Keywords for Lease Query configuration.
bool isRequester(const isc::asiolink::IOAddress &address) const
Checks if the given address belongs to a valid requester.
static size_t PageSize
Page size to commands.
virtual ~LeaseQueryImpl()
Destructor.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< const Element > ConstElementPtr
std::map< std::string, isc::data::Element::types > SimpleKeywords
This specifies all accepted keywords with their types.
Defines the logger used by the top-level component of kea-lfc.