30 const size_t max_transactions)
31 :queue_mgr_(queue_mgr), cfg_mgr_(cfg_mgr), io_service_(io_service) {
38 "D2UpdateMgr configuration manager cannot be null");
50 transaction_list_.clear();
87 TransactionList::iterator it = transaction_list_.begin();
88 while (it != transaction_list_.end()) {
90 if (trans->isModelDone()) {
93 transaction_list_.erase(it++);
109 for (
size_t index = 0; index < queue_count; ) {
116 queue_mgr_->dequeueAt(index);
145 int direction_count = 0;
148 if (next_ncr->isForwardChange()) {
149 if (!cfg_mgr_->forwardUpdatesEnabled()) {
150 next_ncr->setForwardChange(
false);
153 .arg(next_ncr->getRequestId())
154 .arg(next_ncr->toText());
156 bool matched = cfg_mgr_->matchForward(next_ncr->getFqdn(),
163 .arg(next_ncr->getRequestId())
164 .arg(next_ncr->toText());
174 if (next_ncr->isReverseChange()) {
175 if (!cfg_mgr_->reverseUpdatesEnabled()) {
176 next_ncr->setReverseChange(
false);
179 .arg(next_ncr->getRequestId())
180 .arg(next_ncr->toText());
182 bool matched = cfg_mgr_->matchReverse(next_ncr->getIpAddress(),
189 .arg(next_ncr->getRequestId())
190 .arg(next_ncr->toText());
200 if (!direction_count) {
203 .arg(next_ncr->getRequestId())
204 .arg(next_ncr->toText());
215 switch(next_ncr->getConflictResolutionMode()) {
218 forward_domain, reverse_domain,
223 forward_domain, reverse_domain,
228 forward_domain, reverse_domain,
234 forward_domain, reverse_domain,
239 switch(next_ncr->getConflictResolutionMode()) {
242 forward_domain, reverse_domain,
247 forward_domain, reverse_domain,
252 forward_domain, reverse_domain,
258 forward_domain, reverse_domain,
265 transaction_list_[key] = trans;
268 trans->startTransaction();
272TransactionList::iterator
274 return (transaction_list_.find(key));
286 transaction_list_.erase(pos);
290TransactionList::iterator
292 return (transaction_list_.begin());
295TransactionList::iterator
297 return (transaction_list_.end());
304 transaction_list_.clear();
310 if (new_trans_max < 1) {
312 " maximum transactions limit must be greater than zero");
318 "cannot be less than the current transaction count :"
322 max_transactions_ = new_trans_max;
327 return (queue_mgr_->getQueueSize());
332 return (transaction_list_.size());
This file defines the class CheckExistsAddTransaction.
This file defines the class CheckExistsRemoveTransaction.
Embodies the "life-cycle" required to carry out a DDNS Add update.
Embodies the "life-cycle" required to carry out a DDNS Remove update.
Thrown if the update manager encounters a general error.
TransactionList::iterator transactionListEnd()
Returns the transaction list end position.
bool hasTransaction(const TransactionKey &key)
Convenience method that checks transaction list for the given key.
TransactionList::iterator findTransaction(const TransactionKey &key)
Search the transaction list for the given key.
virtual ~D2UpdateMgr()
Destructor.
void removeTransaction(const TransactionKey &key)
Removes the entry pointed to by key from the transaction list.
bool makeTransaction(isc::dhcp_ddns::NameChangeRequestPtr &ncr)
Create a new transaction for the given request.
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.
TransactionList::iterator transactionListBegin()
Returns the transaction list beg position.
void clearTransactionList()
Immediately discards all entries in the transaction list.
void sweep()
Check current transactions; start transactions for new requests.
size_t getMaxTransactions() const
Returns the maximum number of concurrent transactions.
size_t getQueueCount() const
Convenience method that returns the number of requests queued.
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.
static const size_t MAX_TRANSACTIONS_DEFAULT
Maximum number of concurrent transactions NOTE that 32 is an arbitrary choice picked for the initial ...
Embodies the "life-cycle" required to carry out a DDNS Add update.
Embodies the "life-cycle" required to carry out a DDNS Remove update.
Embodies the "life-cycle" required to carry out a DDNS Add update.
Embodies the "life-cycle" required to carry out a DDNS Add update without checking for conflicts.
Embodies the "life-cycle" required to carry out a DDNS Remove update.
Embodies the "life-cycle" required to carry out a DDNS Remove update without removing any matching DH...
Container class for handling the DHCID value within a NameChangeRequest.
std::string toStr() const
Returns the DHCID value as a string of hexadecimal digits.
This file defines the class D2UpdateMgr.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
const isc::log::MessageID DHCP_DDNS_REQUEST_DROPPED
boost::shared_ptr< DdnsDomain > DdnsDomainPtr
Defines a pointer for DdnsDomain instances.
boost::shared_ptr< D2CfgMgr > D2CfgMgrPtr
Defines a shared pointer to D2CfgMgr.
const isc::log::MessageID DHCP_DDNS_NO_REV_MATCH_ERROR
const isc::log::MessageID DHCP_DDNS_FWD_REQUEST_IGNORED
const isc::log::MessageID DHCP_DDNS_REV_REQUEST_IGNORED
isc::log::Logger dhcp_to_d2_logger("dhcp-to-d2")
const isc::log::MessageID DHCP_DDNS_AT_MAX_TRANSACTIONS
boost::shared_ptr< NameChangeTransaction > NameChangeTransactionPtr
Defines a pointer to a NameChangeTransaction.
boost::shared_ptr< D2QueueMgr > D2QueueMgrPtr
Defines a pointer for manager instances.
const isc::log::MessageID DHCP_DDNS_NO_ELIGIBLE_JOBS
const isc::log::MessageID DHCP_DDNS_NO_FWD_MATCH_ERROR
@ CHECK_EXISTS_WITH_DHCID
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
const int DBGLVL_TRACE_DETAIL_DATA
Trace data associated with detailed operations.
Defines the logger used by the top-level component of kea-lfc.
This file defines the class NameAddTransaction.
This file defines the class NameRemoveTransaction.
This file defines the class SimpleAddWithoutDHCIDTransaction.
This file defines the class SimpleRemoveWithoutDHCIDTransaction.