From: Marcin Siodelski Date: Mon, 19 Dec 2016 14:55:35 +0000 (+0100) Subject: [5088] Created HttpResponseCreator interface. X-Git-Tag: trac5090_base~2^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=616dab184b9bfa0335e9cd4f93e90f1f472c9321;p=thirdparty%2Fkea.git [5088] Created HttpResponseCreator interface. --- diff --git a/src/lib/http/Makefile.am b/src/lib/http/Makefile.am index d5439a8be9..90af21c983 100644 --- a/src/lib/http/Makefile.am +++ b/src/lib/http/Makefile.am @@ -31,6 +31,7 @@ libkea_http_la_SOURCES += request.cc request.h libkea_http_la_SOURCES += request_context.h libkea_http_la_SOURCES += request_parser.cc request_parser.h libkea_http_la_SOURCES += response.cc response.h +libkea_http_la_SOURCES += response_creator.h libkea_http_la_SOURCES += response_json.cc response_json.h diff --git a/src/lib/http/request.h b/src/lib/http/request.h index e60e1e7314..1ea843edf7 100644 --- a/src/lib/http/request.h +++ b/src/lib/http/request.h @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -34,6 +35,14 @@ public: HttpRequestError(file, line, what) { }; }; +class HttpRequest; + +/// @brief Pointer to the @ref HttpRequest object. +typedef boost::shared_ptr HttpRequestPtr; + +/// @brief Pointer to the const @ref HttpRequest object. +typedef boost::shared_ptr ConstHttpRequestPtr; + /// @brief Represents HTTP request message. /// /// This object represents parsed HTTP message. The @ref HttpRequestContext diff --git a/src/lib/http/response.h b/src/lib/http/response.h index 92942e4cf6..73c6363510 100644 --- a/src/lib/http/response.h +++ b/src/lib/http/response.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -43,6 +44,14 @@ enum class HttpStatusCode : std::uint16_t { SERVICE_UNAVAILABLE = 503 }; +class HttpResponse; + +/// @brief Pointer to the @ref HttpResponse object. +typedef boost::shared_ptr HttpResponsePtr; + +/// @brief Pointer to the const @ref HttpResponse object. +typedef boost::shared_ptr ConstHttpResponsePtr; + class HttpResponse { public: diff --git a/src/lib/http/response_creator.h b/src/lib/http/response_creator.h new file mode 100644 index 0000000000..2b83c584f6 --- /dev/null +++ b/src/lib/http/response_creator.h @@ -0,0 +1,28 @@ +// Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC") +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef HTTP_RESPONSE_CREATOR_H +#define HTTP_RESPONSE_CREATOR_H + +#include +#include + +namespace isc { +namespace http { + +class HttpResponseCreator { +public: + + virtual ~HttpResponseCreator() { }; + + virtual HttpResponsePtr create(const ConstHttpRequestPtr& request) = 0; + +}; + +} // namespace http +} // namespace isc + +#endif