Kea 2.7.6
isc::config::HttpCommandResponseCreator Class Reference

Concrete implementation of the HTTP response creator used for HTTP control socket. More...

#include <http_command_response_creator.h>

+ Inheritance diagram for isc::config::HttpCommandResponseCreator:

Public Member Functions

 HttpCommandResponseCreator (HttpCommandConfigPtr config)
 Constructor.
 
virtual ~HttpCommandResponseCreator ()=default
 virtual destructor.
 
virtual http::HttpRequestPtr createNewHttpRequest () const
 Create a new request.
 
virtual http::HttpResponsePtr createStockHttpResponse (const http::HttpRequestPtr &request, const http::HttpStatusCode &status_code) const
 Creates stock HTTP response.
 
HttpCommandConfigPtr getHttpCommandConfig () const
 Returns HTTP control socket config.
 
- Public Member Functions inherited from isc::http::HttpResponseCreator
virtual ~HttpResponseCreator ()
 Destructor.
 
virtual HttpResponsePtr createHttpResponse (HttpRequestPtr request) final
 Create HTTP response from HTTP request received.
 

Additional Inherited Members

- Protected Member Functions inherited from isc::http::HttpResponseCreator

Detailed Description

Concrete implementation of the HTTP response creator used for HTTP control socket.

See the documentation of the isc::http::HttpResponseCreator for the basic information how HTTP response creators are utilized by the libkea-http library to generate HTTP responses.

This creator expects that received requests are encapsulated in the isc::http::PostHttpRequestJson objects. The generated responses are encapsulated in the HttpResponseJson objects.

This class uses CommandMgr singleton to process commands conveyed in the HTTP body. The JSON responses returned by the manager are placed in the body of the generated HTTP responses.

Definition at line 31 of file http_command_response_creator.h.

Constructor & Destructor Documentation

◆ HttpCommandResponseCreator()

isc::config::HttpCommandResponseCreator::HttpCommandResponseCreator ( HttpCommandConfigPtr config)
inline

Constructor.

Parameters
configThe HTTP control socket config.

Definition at line 37 of file http_command_response_creator.h.

◆ ~HttpCommandResponseCreator()

virtual isc::config::HttpCommandResponseCreator::~HttpCommandResponseCreator ( )
virtualdefault

virtual destructor.

Member Function Documentation

◆ createNewHttpRequest()

HttpRequestPtr isc::config::HttpCommandResponseCreator::createNewHttpRequest ( ) const
virtual

Create a new request.

This method creates a bare instance of the isc::http::PostHttpRequestJson.

Returns
Pointer to the new instance of the isc::http::PostHttpRequestJson.

Implements isc::http::HttpResponseCreator.

Definition at line 52 of file http_command_response_creator.cc.

◆ createStockHttpResponse()

HttpResponsePtr isc::config::HttpCommandResponseCreator::createStockHttpResponse ( const http::HttpRequestPtr & request,
const http::HttpStatusCode & status_code ) const
virtual

Creates stock HTTP response.

Parameters
requestPointer to an object representing HTTP request.
status_codeStatus code of the response.
Returns
Pointer to an isc::http::HttpResponseJson object representing stock HTTP response.

Implements isc::http::HttpResponseCreator.

Definition at line 57 of file http_command_response_creator.cc.

◆ getHttpCommandConfig()

HttpCommandConfigPtr isc::config::HttpCommandResponseCreator::getHttpCommandConfig ( ) const
inline

Returns HTTP control socket config.

Definition at line 63 of file http_command_response_creator.h.


The documentation for this class was generated from the following files: