14 #include <boost/pointer_cast.hpp>
24 CmdResponseCreator::createNewHttpRequest()
const {
32 HttpResponsePtr response = createStockHttpResponseInternal(request, status_code);
45 HttpVersion http_version(request->context()->http_version_major_,
46 request->context()->http_version_minor_);
51 http_version.minor_ = 0;
66 http_response = auth_config->checkAuth(*
this, request);
68 return (http_response);
82 return (createStockHttpResponse(request, HttpStatusCode::INTERNAL_SERVER_ERROR));
96 return (createStockHttpResponse(request, HttpStatusCode::INTERNAL_SERVER_ERROR));
103 if (emulateAgentResponse() && (response->getType() !=
Element::list)) {
105 response_list->add(boost::const_pointer_cast<Element>(response));
106 response = response_list;
110 http_response = boost::dynamic_pointer_cast<
111 HttpResponseJson>(createStockHttpResponseInternal(request, HttpStatusCode::OK));
113 http_response->finalize();
115 return (http_response);
Represents HTTP POST request with JSON body.
boost::shared_ptr< HttpResponseJson > HttpResponseJsonPtr
Pointer to the HttpResponseJson object.
data::ConstElementPtr getBodyAsJson() const
Retrieves JSON body.
boost::shared_ptr< Element > ElementPtr
unsigned major_
Major HTTP version.
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
boost::shared_ptr< PostHttpRequestJson > PostHttpRequestJsonPtr
Pointer to PostHttpRequestJson.
boost::shared_ptr< HttpResponse > HttpResponsePtr
Pointer to the HttpResponse object.
boost::shared_ptr< const Element > ConstElementPtr
Represents HTTP response with JSON content.
Defines the logger used by the top-level component of kea-dhcp-ddns.
virtual isc::data::ConstElementPtr processCommand(const isc::data::ConstElementPtr &cmd)
Triggers command processing.
boost::shared_ptr< HttpRequest > HttpRequestPtr
Pointer to the HttpRequest object.
void setBodyAsJson(const data::ConstElementPtr &json_body)
Generates JSON content from the data structures represented as data::ConstElementPtr.
boost::shared_ptr< HttpAuthConfig > HttpAuthConfigPtr
Type of shared pointers to HTTP authentication configuration.
static CommandMgr & instance()
CommandMgr is a singleton class.
HttpStatusCode
HTTP status codes (cf RFC 2068)