47 void close(
bool remove);
103 current_config_->setEmulateAgentResponse(config->getEmulateAgentResponse());
112 IOAddress server_address = config->getSocketAddress();
113 uint16_t server_port = config->getSocketPort();
114 bool use_https =
false;
116 if (!config->getCertFile().empty()) {
117 TlsContext::configure(tls_context,
119 config->getTrustAnchor(),
120 config->getCertFile(),
121 config->getKeyFile(),
122 config->getCertRequired());
147 http_listener->start();
157 .arg(use_https ?
"HTTPS" :
"HTTP")
158 .arg(server_address.
toText())
164 bool use_https =
false;
172 .arg(use_https ?
"HTTPS" :
"HTTP")
215 return (http_cmd_mgr);
223 impl_->io_service_ = io_service;
228 impl_->timeout_ = timeout;
233 impl_->idle_timeout_ = timeout;
238 impl_->use_external_ = use_external;
243 impl_->configure(config);
248 impl_->close(remove);
253 impl_->garbageCollectListeners();
258 return (impl_->getHttpListener());
The IOAddress class represents an IP addresses (version agnostic)
std::string toText() const
Convert the address to a string.
Implementation of the HttpCommandMgr.
vector< HttpListenerPtr > http_listeners_
Active listeners.
bool use_external_
Use external sockets flag.
HttpCommandConfigPtr current_config_
Current config.
void close(bool remove)
Close control socket.
void configure(HttpCommandConfigPtr config)
Configure control socket from configuration.
ConstHttpListenerPtr getHttpListener() const
Returns a const pointer to the HTTP listener.
size_t active_
Number of active listeners (0 or 1).
void garbageCollectListeners()
Removes listeners which are no longer in use.
long idle_timeout_
Idle connection timeout.
IOServicePtr io_service_
Pointer to the IO service.
HttpCommandMgrImpl()
Constructor.
long timeout_
Connection timeout.
HTTP Commands Manager implementation for the Kea servers.
void setIdleConnectionTimeout(const long timeout)
Override default idle connection timeout.
isc::http::ConstHttpListenerPtr getHttpListener() const
Returns a const pointer to the HTTP listener.
void setConnectionTimeout(const long timeout)
Override default connection timeout.
void addExternalSockets(bool use_external=true)
Use external sockets flag.
static HttpCommandMgr & instance()
HttpCommandMgr is a singleton class.
void garbageCollectListeners()
Removes listeners which are no longer in use.
void setIOService(const asiolink::IOServicePtr &io_service)
Sets IO service to be used by the http command manager.
void close(bool remove=true)
Close http control socket.
void configure(HttpCommandConfigPtr config)
Configure http control socket from configuration.
HTTP response creator factory for HTTP control socket.
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
#define LOG_WARN(LOGGER, MESSAGE)
Macro to conveniently test warn output and log it.
boost::shared_ptr< TlsContext > TlsContextPtr
The type of shared pointers to TlsContext objects.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
constexpr long TIMEOUT_AGENT_IDLE_CONNECTION_TIMEOUT
Timeout for the idle connection to be closed.
const isc::log::MessageID HTTP_COMMAND_MGR_IGNORED_TLS_SETUP_CHANGES
const isc::log::MessageID HTTP_COMMAND_MGR_SERVICE_STARTED
const isc::log::MessageID HTTP_COMMAND_MGR_SERVICE_STOPPING
boost::shared_ptr< HttpCommandConfig > HttpCommandConfigPtr
Pointer to a HttpCommandConfig object.
isc::log::Logger command_logger("commands")
Command processing Logger.
constexpr long TIMEOUT_AGENT_RECEIVE_COMMAND
Timeout for the Control Agent to receive command over the RESTful interface.
boost::shared_ptr< const HttpListener > ConstHttpListenerPtr
Pointer to the const HttpListener.
boost::shared_ptr< HttpListener > HttpListenerPtr
Pointer to the HttpListener.
boost::shared_ptr< HttpResponseCreatorFactory > HttpResponseCreatorFactoryPtr
Pointer to the HttpResponseCreatorFactory.
Defines the logger used by the top-level component of kea-lfc.
HTTP request timeout value.