Kea  2.3.8
ca_command_mgr.h
Go to the documentation of this file.
1 // Copyright (C) 2017-2022 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 CTRL_AGENT_COMMAND_MGR_H
8 #define CTRL_AGENT_COMMAND_MGR_H
9 
11 #include <exceptions/exceptions.h>
12 #include <boost/noncopyable.hpp>
13 #include <boost/shared_ptr.hpp>
14 
15 namespace isc {
16 namespace agent {
17 
21 public:
22  CommandForwardingError(const char* file, size_t line, const char* what) :
23  isc::Exception(file, line, what) { };
24 };
25 
38  public boost::noncopyable {
39 public:
40 
42  static CtrlAgentCommandMgr& instance();
43 
62 
85  handleCommand(const std::string& cmd_name,
86  const isc::data::ConstElementPtr& params,
87  const isc::data::ConstElementPtr& original_cmd);
88 
89 private:
90 
101  forwardCommand(const std::string& service, const std::string& cmd_name,
102  const isc::data::ConstElementPtr& command);
103 
109 
111  std::string remote_addr_;
112 
113 };
114 
115 } // end of namespace isc::agent
116 } // end of namespace isc
117 
118 #endif
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Exception thrown when an error occurred during control command forwarding.
CommandForwardingError(const char *file, size_t line, const char *what)
Command Manager for Control Agent.
virtual isc::data::ConstElementPtr handleCommand(const std::string &cmd_name, const isc::data::ConstElementPtr &params, const isc::data::ConstElementPtr &original_cmd)
Handles the command having a given name and arguments.
static CtrlAgentCommandMgr & instance()
Returns sole instance of the Command Manager.
virtual isc::data::ConstElementPtr processCommand(const isc::data::ConstElementPtr &cmd)
Triggers command processing.
Command Manager which can delegate commands to a hook library.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:29
Defines the logger used by the top-level component of kea-lfc.