Kea  2.3.5-git
response_creator.h
Go to the documentation of this file.
1 // Copyright (C) 2016-2020 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 HTTP_RESPONSE_CREATOR_H
8 #define HTTP_RESPONSE_CREATOR_H
9 
10 #include <http/request.h>
11 #include <http/response.h>
12 #include <boost/shared_ptr.hpp>
13 
14 namespace isc {
15 namespace http {
16 
18 
20 typedef boost::shared_ptr<HttpResponseCreator> HttpResponseCreatorPtr;
21 
39 public:
40 
44  virtual ~HttpResponseCreator() { };
45 
76  virtual HttpResponsePtr
77  createHttpResponse(HttpRequestPtr request) final;
78 
87  virtual HttpRequestPtr
88  createNewHttpRequest() const = 0;
89 
95  virtual HttpResponsePtr
97  const HttpStatusCode& status_code) const = 0;
98 
99 protected:
100 
105  virtual HttpResponsePtr
107 
108 };
109 
110 } // namespace http
111 } // namespace isc
112 
113 #endif
virtual HttpRequestPtr createNewHttpRequest() const =0
Create a new request.
virtual HttpResponsePtr createStockHttpResponse(const HttpRequestPtr &request, const HttpStatusCode &status_code) const =0
Creates implementation specific HTTP response.
Specifies an interface for classes creating HTTP responses from HTTP requests.
boost::shared_ptr< HttpResponse > HttpResponsePtr
Pointer to the HttpResponse object.
Definition: response.h:78
boost::shared_ptr< HttpResponseCreator > HttpResponseCreatorPtr
Pointer to the HttpResponseCreator object.
Defines the logger used by the top-level component of kea-lfc.
virtual ~HttpResponseCreator()
Destructor.
virtual HttpResponsePtr createDynamicHttpResponse(HttpRequestPtr request)=0
Creates implementation specific HTTP response.
virtual HttpResponsePtr createHttpResponse(HttpRequestPtr request) final
Create HTTP response from HTTP request received.
boost::shared_ptr< HttpRequest > HttpRequestPtr
Pointer to the HttpRequest object.
Definition: request.h:27
HttpStatusCode
HTTP status codes (cf RFC 2068)
Definition: response.h:30