Kea  1.9.9-git
ca_process.h
Go to the documentation of this file.
1 // Copyright (C) 2016-2021 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_PROCESS_H
8 #define CTRL_AGENT_PROCESS_H
9 
10 #include <agent/ca_cfg_mgr.h>
11 #include <http/listener.h>
12 #include <process/d_process.h>
13 #include <vector>
14 
15 namespace isc {
16 namespace agent {
17 
33 public:
40  CtrlAgentProcess(const char* name, const asiolink::IOServicePtr& io_service);
41 
43  virtual ~CtrlAgentProcess();
44 
52  virtual void init();
53 
57  virtual void run();
58 
74 
107  bool check_only = false);
108 
111 
118 
122  bool isListening() const;
123 
124 private:
125 
131  // a result of the reconfiguration). If there are no listeners additional
136  void garbageCollectListeners(size_t leaving = 1);
137 
142  size_t runIO();
143 
145  std::vector<http::HttpListenerPtr> http_listeners_;
146 
147 };
148 
150 typedef boost::shared_ptr<CtrlAgentProcess> CtrlAgentProcessPtr;
151 
152 }; // namespace isc::agent
153 }; // namespace isc
154 
155 #endif // CTRL_AGENT_PROCESS_H
boost::shared_ptr< const HttpListener > ConstHttpListenerPtr
Pointer to the const HttpListener.
Definition: listener.h:142
virtual isc::data::ConstElementPtr shutdown(isc::data::ConstElementPtr args)
Initiates the process's shutdown process.
Definition: ca_process.cc:99
boost::shared_ptr< CtrlAgentCfgMgr > CtrlAgentCfgMgrPtr
Defines a shared pointer to CtrlAgentCfgMgr.
Definition: ca_cfg_mgr.h:311
CtrlAgentProcess(const char *name, const asiolink::IOServicePtr &io_service)
Constructor.
Definition: ca_process.cc:29
virtual void run()
Implements the process's event loop.
Definition: ca_process.cc:43
boost::shared_ptr< CtrlAgentProcess > CtrlAgentProcessPtr
Defines a shared pointer to CtrlAgentProcess.
Definition: ca_process.h:150
bool isListening() const
Checks if the process is listening to the HTTP requests.
Definition: ca_process.cc:231
CtrlAgentCfgMgrPtr getCtrlAgentCfgMgr()
Returns a pointer to the configuration manager.
Definition: ca_process.cc:219
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
virtual isc::data::ConstElementPtr configure(isc::data::ConstElementPtr config_set, bool check_only=false)
Processes the given configuration.
Definition: ca_process.cc:105
http::ConstHttpListenerPtr getHttpListener() const
Returns a const pointer to the HTTP listener used by the process.
Definition: ca_process.cc:224
Kea Control Agent Application Process.
Definition: ca_process.h:32
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual ~CtrlAgentProcess()
Destructor.
Definition: ca_process.cc:35
Application Process Interface.
Definition: d_process.h:81
virtual void init()
Initialize the Control Agent process.
Definition: ca_process.cc:39