Kea 2.7.3
|
HTTP Commands Manager implementation for the Kea servers. More...
#include <http_command_mgr.h>
Public Member Functions | |
void | addExternalSockets (bool use_external=true) |
Use external sockets flag. | |
void | close (bool remove=true) |
Close control socket. | |
void | configure (HttpCommandConfigPtr config) |
Configure control socket from configuration. | |
void | garbageCollectListeners () |
Removes listeners which are no longer in use. | |
isc::http::ConstHttpListenerPtr | getHttpListener () const |
Returns a const pointer to the HTTP listener. | |
void | setConnectionTimeout (const long timeout) |
Override default connection timeout. | |
void | setIdleConnectionTimeout (const long timeout) |
Override default idle connection timeout. | |
void | setIOService (const asiolink::IOServicePtr &io_service) |
Sets IO service to be used by the command manager. | |
Public Member Functions inherited from isc::config::HookedCommandMgr | |
HookedCommandMgr () | |
Constructor. | |
Public Member Functions inherited from isc::config::BaseCommandMgr | |
BaseCommandMgr () | |
Constructor. | |
virtual | ~BaseCommandMgr () |
Destructor. | |
void | deregisterAll () |
Auxiliary method that removes all installed commands. | |
void | deregisterCommand (const std::string &cmd) |
Deregisters specified command handler. | |
virtual isc::data::ConstElementPtr | processCommand (const isc::data::ConstElementPtr &cmd) |
Triggers command processing. | |
void | registerCommand (const std::string &cmd, CommandHandler handler) |
Registers specified command handler for a given command. | |
void | registerExtendedCommand (const std::string &cmd, ExtendedCommandHandler handler) |
Registers specified command handler for a given command. | |
Static Public Member Functions | |
static HttpCommandMgr & | instance () |
HttpCommandMgr is a singleton class. | |
Static Public Member Functions inherited from isc::config::BaseCommandMgr | |
static std::string | getHash (const isc::data::ConstElementPtr &config) |
returns a hash of a given Element structure | |
Additional Inherited Members | |
Public Types inherited from isc::config::BaseCommandMgr | |
typedef std::function< isc::data::ConstElementPtr(const std::string &name, const isc::data::ConstElementPtr ¶ms) | CommandHandler) |
Defines command handler type. | |
typedef std::function< isc::data::ConstElementPtr(const std::string &name, const isc::data::ConstElementPtr ¶ms, const isc::data::ConstElementPtr &original) | ExtendedCommandHandler) |
Defines extended command handler type. | |
Protected Types inherited from isc::config::BaseCommandMgr | |
typedef std::map< std::string, HandlersPair > | HandlerContainer |
Type of the container for command handlers. | |
Protected Member Functions inherited from isc::config::HookedCommandMgr | |
bool | delegateCommandToHookLibrary (const std::string &cmd_name, const isc::data::ConstElementPtr ¶ms, const isc::data::ConstElementPtr &original_cmd, isc::data::ElementPtr &answer) |
Handles the command within the hooks libraries. | |
virtual isc::data::ConstElementPtr | handleCommand (const std::string &cmd_name, const isc::data::ConstElementPtr ¶ms, const isc::data::ConstElementPtr &original_cmd) |
Handles the command having a given name and arguments. | |
Protected Attributes inherited from isc::config::BaseCommandMgr | |
HandlerContainer | handlers_ |
Container for command handlers. | |
HTTP Commands Manager implementation for the Kea servers.
Similar to CommandMgr
but using HTTP/HTTPS instead of UNIX sockets.
Definition at line 25 of file http_command_mgr.h.
void isc::config::HttpCommandMgr::addExternalSockets | ( | bool | use_external = true | ) |
Use external sockets flag.
Add sockets as external sockets of the interface manager so available I/O on them makes a waiting select to return.
use_external | True (default) add external sockets. |
Definition at line 236 of file http_command_mgr.cc.
void isc::config::HttpCommandMgr::close | ( | bool | remove = true | ) |
Close control socket.
garbageCollectListeners
must be called after.remove | When true remove the listeners immediately. |
Definition at line 246 of file http_command_mgr.cc.
void isc::config::HttpCommandMgr::configure | ( | HttpCommandConfigPtr | config | ) |
Configure control socket from configuration.
config | Configuration of the control socket. |
Definition at line 241 of file http_command_mgr.cc.
void isc::config::HttpCommandMgr::garbageCollectListeners | ( | ) |
Removes listeners which are no longer in use.
This method should be called after server reconfiguration to remove listeners used previously (no longer used because the listening address and port has changed as a result of the reconfiguration). If there are no listeners additional to the one that is currently in use, the method has no effect. This method is reused to remove all listeners at shutdown time.
Definition at line 251 of file http_command_mgr.cc.
ConstHttpListenerPtr isc::config::HttpCommandMgr::getHttpListener | ( | ) | const |
Returns a const pointer to the HTTP listener.
Definition at line 256 of file http_command_mgr.cc.
|
static |
HttpCommandMgr is a singleton class.
This method returns reference to its sole instance.
Definition at line 211 of file http_command_mgr.cc.
Referenced by isc::dhcp::ControlledDhcpv4Srv::ControlledDhcpv4Srv(), isc::dhcp::ControlledDhcpv6Srv::ControlledDhcpv6Srv(), isc::dhcp::ControlledDhcpv4Srv::~ControlledDhcpv4Srv(), isc::dhcp::ControlledDhcpv6Srv::~ControlledDhcpv6Srv(), isc::dhcp::configureCommandChannel(), isc::d2::D2Controller::deregisterCommands(), isc::d2::D2Process::init(), isc::d2::D2Process::reconfigureCommandChannel(), isc::dhcp::Dhcpv4Srv::run(), isc::dhcp::Dhcpv6Srv::run(), and isc::d2::D2Process::runIO().
void isc::config::HttpCommandMgr::setConnectionTimeout | ( | const long | timeout | ) |
Override default connection timeout.
timeout | New connection timeout in milliseconds. |
Definition at line 226 of file http_command_mgr.cc.
void isc::config::HttpCommandMgr::setIdleConnectionTimeout | ( | const long | timeout | ) |
Override default idle connection timeout.
timeout | New connection timeout in milliseconds. |
Definition at line 231 of file http_command_mgr.cc.
void isc::config::HttpCommandMgr::setIOService | ( | const asiolink::IOServicePtr & | io_service | ) |
Sets IO service to be used by the command manager.
The server should use this method to provide the Command Manager with the common IO service used by the server.
io_service | Pointer to the IO service. |
Definition at line 221 of file http_command_mgr.cc.