17 #include <boost/noncopyable.hpp>
163 const size_t max_queue_size = MAX_QUEUE_DEFAULT);
182 const bool reuse_address =
false);
249 return (ncr_queue_.size());
254 return (max_queue_size_);
321 void updateStopState();
327 size_t max_queue_size_;
330 RequestQueue ncr_queue_;
333 boost::shared_ptr<dhcp_ddns::NameChangeListener> listener_;
339 State target_stop_state_;
size_t getMaxQueueSize() const
Returns the maximum number of entries allowed in the queue.
State
Defines the list of possible states for D2QueueMgr.
void dequeue()
Removes the entry at the front of the queue.
State getMgrState() const
Returns the current state.
D2QueueMgrError(const char *file, size_t line, const char *what)
static const size_t MAX_QUEUE_DEFAULT
Maximum number of entries allowed in the request queue.
Thrown if the request queue empty and a read is attempted.
This file defines abstract classes for exchanging NameChangeRequests.
D2QueueMgr creates and manages a queue of DNS update requests.
D2QueueMgrQueueFull(const char *file, size_t line, const char *what)
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
NameChangeFormat
Defines the list of data wire formats supported.
void dequeueAt(const size_t index)
Removes the entry at a given position in the queue.
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
virtual void operator()(const dhcp_ddns::NameChangeListener::Result result, dhcp_ddns::NameChangeRequestPtr &ncr)
Function operator implementing the NCR receive callback.
void startListening()
Starts actively listening for requests.
void stopListening(const State target_stop_state=STOPPED)
Stops listening for requests.
D2QueueMgr(asiolink::IOServicePtr &io_service, const size_t max_queue_size=MAX_QUEUE_DEFAULT)
Constructor.
D2QueueMgrQueueEmpty(const char *file, size_t line, const char *what)
boost::shared_ptr< D2QueueMgr > D2QueueMgrPtr
Defines a pointer for manager instances.
const dhcp_ddns::NameChangeRequestPtr & peekAt(const size_t index) const
Returns the entry at a given position in the queue.
void clearQueue()
Removes all entries from the queue.
void enqueue(dhcp_ddns::NameChangeRequestPtr &ncr)
Adds a request to the end of the queue.
D2QueueMgrReceiveError(const char *file, size_t line, const char *what)
size_t getQueueSize() const
Returns the number of entries in the queue.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Defines a State within the State Model.
std::deque< dhcp_ddns::NameChangeRequestPtr > RequestQueue
Defines a queue of requests.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Thrown if the queue manager encounters a general error.
Thrown if the request queue is full when an enqueue is attempted.
void initUDPListener(const isc::asiolink::IOAddress &ip_address, const uint32_t port, const dhcp_ddns::NameChangeFormat format, const bool reuse_address=false)
Initializes the listener as a UDP listener.
void setMaxQueueSize(const size_t max_queue_size)
Sets the maximum number of entries allowed in the queue.
Thrown if the queue manager's receive handler is passed a failure result.
D2QueueMgrInvalidIndex(const char *file, size_t line, const char *what)
virtual ~D2QueueMgr()
Destructor.
The IOAddress class represents an IP addresses (version agnostic)
const dhcp_ddns::NameChangeRequestPtr & peek() const
Returns the entry at the front of the queue.
void removeListener()
Deletes the current listener.
This file provides the classes needed to embody, compose, and decompose DNS update requests that are ...
Thrown if a queue index is beyond the end of the queue.
Abstract class for defining application layer receive callbacks.
Result
Defines the outcome of an asynchronous NCR receive.
std::string format(const std::string &format, const std::vector< std::string > &args)
Apply Formatting.