Kea  1.9.9-git
command_mgr.h
Go to the documentation of this file.
1 // Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef COMMAND_MGR_H
8 #define COMMAND_MGR_H
9 
10 #include <asiolink/io_service.h>
11 #include <cc/data.h>
13 #include <exceptions/exceptions.h>
14 #include <boost/noncopyable.hpp>
15 #include <boost/shared_ptr.hpp>
16 
17 namespace isc {
18 namespace config {
19 
21 class BadSocketInfo : public Exception {
22 public:
23  BadSocketInfo(const char* file, size_t line, const char* what) :
24  isc::Exception(file, line, what) { };
25 };
26 
28 class SocketError : public Exception {
29 public:
30  SocketError(const char* file, size_t line, const char* what) :
31  isc::Exception(file, line, what) { };
32 };
33 
34 
35 class CommandMgrImpl;
36 
41 class CommandMgr : public HookedCommandMgr, public boost::noncopyable {
42 public:
43 
48  static CommandMgr& instance();
49 
55  void setIOService(const asiolink::IOServicePtr& io_service);
56 
60  void setConnectionTimeout(const long timeout);
61 
71  void
73 
75  void closeCommandSocket();
76 
80  int getControlSocketFD();
81 
82 private:
83 
85  CommandMgr();
86 
88  boost::shared_ptr<CommandMgrImpl> impl_;
89 };
90 
91 }; // end of isc::config namespace
92 }; // end of isc namespace
93 
94 #endif
An exception indicating a problem with socket operation.
Definition: command_mgr.h:28
SocketError(const char *file, size_t line, const char *what)
Definition: command_mgr.h:30
An exception indicating that specified socket parameters are invalid.
Definition: command_mgr.h:21
Command Manager which can delegate commands to a hook library.
void closeCommandSocket()
Shuts down any open control sockets.
Definition: command_mgr.cc:626
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
void setConnectionTimeout(const long timeout)
Override default connection timeout.
Definition: command_mgr.cc:660
void setIOService(const asiolink::IOServicePtr &io_service)
Sets IO service to be used by the command manager.
Definition: command_mgr.cc:655
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
This is a base class for exceptions thrown from the DNS library module.
void openCommandSocket(const isc::data::ConstElementPtr &socket_info)
Opens control socket with parameters specified in socket_info.
Definition: command_mgr.cc:622
Defines the logger used by the top-level component of kea-dhcp-ddns.
Commands Manager implementation for the Kea servers.
Definition: command_mgr.h:41
int getControlSocketFD()
Returns control socket descriptor.
Definition: command_mgr.cc:643
BadSocketInfo(const char *file, size_t line, const char *what)
Definition: command_mgr.h:23
static CommandMgr & instance()
CommandMgr is a singleton class.
Definition: command_mgr.cc:649