19#include <boost/multi_index_container.hpp>
20#include <boost/multi_index/hashed_index.hpp>
21#include <boost/multi_index/indexed_by.hpp>
22#include <boost/multi_index/member.hpp>
23#include <boost/multi_index/mem_fun.hpp>
24#include <boost/multi_index/sequenced_index.hpp>
25#include <boost/noncopyable.hpp>
26#include <boost/shared_ptr.hpp>
52typedef boost::multi_index_container<
55 boost::multi_index::indexed_by<
57 boost::multi_index::sequenced<
58 boost::multi_index::tag<SequenceTag>
62 boost::multi_index::hashed_unique<
63 boost::multi_index::tag<FqdnTag>,
69 boost::multi_index::hashed_unique<
70 boost::multi_index::tag<AddressTag>,
212 return (io_service_);
217 return (max_transactions_);
261 TransactionFqdnIndex::iterator
276 TransactionAddressIndex::iterator
301 size_t max_transactions_;
This is a base class for exceptions thrown from the DNS library module.
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
The IOAddress class represents an IP addresses (version agnostic).
D2UpdateMgrError(const char *file, size_t line, const char *what)
TransactionFqdnIndex::iterator transactionFqdnBegin()
Returns the transaction store begin iterator, ordered by FQDN.
TransactionAddressIndex::iterator transactionAddressEnd()
Returns the transaction store end iterator, ordered by address.
const asiolink::IOServicePtr & getIOService()
Gets the D2UpdateMgr's IOService.
bool makeTransaction(isc::dhcp_ddns::NameChangeRequestPtr &ncr)
Create a new transaction for the given request.
TransactionFqdnIndex::iterator transactionFqdnEnd()
Returns the transaction store end iterator, ordered by FQDN.
TransactionAddressIndex::iterator transactionAddressBegin()
Returns the transaction store begin iterator, ordered by address.
TransactionSequenceIndex::iterator transactionSequenceEnd()
Returns the transaction store sequence end position.
void checkFinishedTransactions()
Performs post-completion cleanup on completed transactions.
void setMaxTransactions(const size_t max_transactions)
Sets the maximum number of entries allowed in the queue.
void sweep()
Check current transactions; start transactions for new requests.
TransactionAddressIndex::iterator findTransactionByAddress(const asiolink::IOAddress &address) const
Search the transaction store for a given address.
size_t getMaxTransactions() const
Returns the maximum number of concurrent transactions.
size_t getQueueCount() const
Convenience method that returns the number of requests queued.
bool hasTransaction(const dhcp_ddns::NameChangeRequestPtr &ncr) const
Checks if there is an active transaction matching the FQDN or ip address of an NCR.
D2UpdateMgr(D2QueueMgrPtr &queue_mgr, D2CfgMgrPtr &cfg_mgr, asiolink::IOServicePtr &io_service, const size_t max_transactions=MAX_TRANSACTIONS_DEFAULT)
Constructor.
size_t getTransactionCount() const
Returns the current number of transactions.
void pickNextJob()
Starts a transaction for the next eligible request in the queue.
void clearTransactions()
Immediately discards all entries in the transaction list.
TransactionFqdnIndex::iterator findTransactionByFqdn(const std::string &fqdn) const
Search the transaction store for an FQDN.
static const size_t MAX_TRANSACTIONS_DEFAULT
Maximum number of concurrent transactions NOTE that 32 is an arbitrary choice picked for the initial ...
TransactionSequenceIndex::iterator transactionSequenceBegin()
Returns the transaction store sequence begin position.
Embodies the "life-cycle" required to carry out a DDNS update.
const asiolink::IOAddress & getIOAddress() const
Fetches the request IP address.
std::string getFqdnLower() const
Fetches the request FQDN converted to lower-case.
This file defines the class D2QueueMgr.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
TransactionStore::index< AddressTag >::type TransactionAddressIndex
boost::shared_ptr< D2CfgMgr > D2CfgMgrPtr
Defines a shared pointer to D2CfgMgr.
TransactionStore::index< SequenceTag >::type TransactionSequenceIndex
TransactionStore::index< FqdnTag >::type TransactionFqdnIndex
boost::shared_ptr< D2UpdateMgr > D2UpdateMgrPtr
Defines a pointer to a D2UpdateMgr instance.
boost::shared_ptr< NameChangeTransaction > NameChangeTransactionPtr
Defines a pointer to a NameChangeTransaction.
boost::shared_ptr< D2QueueMgr > D2QueueMgrPtr
Defines a pointer for manager instances.
boost::multi_index_container< NameChangeTransactionPtr, boost::multi_index::indexed_by< boost::multi_index::sequenced< boost::multi_index::tag< SequenceTag > >, boost::multi_index::hashed_unique< boost::multi_index::tag< FqdnTag >, boost::multi_index::const_mem_fun< NameChangeTransaction, std::string, &NameChangeTransaction::getFqdnLower > >, boost::multi_index::hashed_unique< boost::multi_index::tag< AddressTag >, boost::multi_index::const_mem_fun< NameChangeTransaction, const asiolink::IOAddress &, &NameChangeTransaction::getIOAddress > > > > TransactionStore
A multi index container holding NameChangeTransaction pointers.
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
Defines the logger used by the top-level component of kea-lfc.
This file defines the class NameChangeTransaction.
Tag for index by ip-address.
Tag for insertion order index.