Kea  2.3.5-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
72  openCommandSocket(const isc::data::ConstElementPtr& socket_info);
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
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
An exception indicating that specified socket parameters are invalid.
Definition: command_mgr.h:21
Command Manager which can delegate commands to a hook library.
Implementation of the CommandMgr.
Definition: command_mgr.cc:474
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:27
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-lfc.
Commands Manager implementation for the Kea servers.
Definition: command_mgr.h:41
BadSocketInfo(const char *file, size_t line, const char *what)
Definition: command_mgr.h:23