Kea  1.9.9-git
cmd_response_creator.h
Go to the documentation of this file.
1 // Copyright (C) 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 CMD__RESPONSE_CREATOR_H
8 #define CMD__RESPONSE_CREATOR_H
9 
10 #include <http/response_creator.h>
11 #include <http/basic_auth_config.h>
12 #include <boost/shared_ptr.hpp>
13 
14 namespace isc {
15 namespace config {
16 
32 public:
33 
39  CmdResponseCreator(bool emulate_agent_response = true)
40  : emulate_agent_response_(emulate_agent_response) {};
41 
50 
57  virtual http::HttpResponsePtr
59  const http::HttpStatusCode& status_code) const;
60 
70  static http::HttpAuthConfigPtr no_config;
71  return (no_config);
72  }
73 
78  return (emulate_agent_response_);
79  }
80 
81 private:
82 
94  createStockHttpResponseInternal(const http::HttpRequestPtr& request,
95  const http::HttpStatusCode& status_code) const;
96 
101  virtual http::HttpResponsePtr
102  createDynamicHttpResponse(http::HttpRequestPtr request);
103 
108  bool emulate_agent_response_;
109 };
110 
112 typedef boost::shared_ptr<CmdResponseCreator> CmdResponseCreatorPtr;
113 
114 } // end of namespace isc::config
115 } // end of namespace isc
116 
117 #endif
bool emulateAgentResponse()
Indicates whether or not agent response emulation is enabled.
boost::shared_ptr< CmdResponseCreator > CmdResponseCreatorPtr
Pointer to the CmdResponseCreator.
Specifies an interface for classes creating HTTP responses from HTTP requests.
const http::HttpAuthConfigPtr & getHttpAuthConfig()
Fetches the current authentication configuration.
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.
boost::shared_ptr< HttpResponse > HttpResponsePtr
Pointer to the HttpResponse object.
Definition: response.h:78
CmdResponseCreator(bool emulate_agent_response=true)
Constructor.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Concrete implementation of the HTTP response creator used for processing API commands.
boost::shared_ptr< HttpRequest > HttpRequestPtr
Pointer to the HttpRequest object.
Definition: request.h:27
boost::shared_ptr< HttpAuthConfig > HttpAuthConfigPtr
Type of shared pointers to HTTP authentication configuration.
Definition: auth_config.h:79
HttpStatusCode
HTTP status codes (cf RFC 2068)
Definition: response.h:30