1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2 
3 #ifndef OBJECTQUERYHANDLER_H
4 #define OBJECTQUERYHANDLER_H
5 
6 #include "remote/httphandler.hpp"
7 
8 namespace icinga
9 {
10 
11 class ObjectQueryHandler final : public HttpHandler
12 {
13 public:
14 	DECLARE_PTR_TYPEDEFS(ObjectQueryHandler);
15 
16 	bool HandleRequest(
17 		AsioTlsStream& stream,
18 		const ApiUser::Ptr& user,
19 		boost::beast::http::request<boost::beast::http::string_body>& request,
20 		const Url::Ptr& url,
21 		boost::beast::http::response<boost::beast::http::string_body>& response,
22 		const Dictionary::Ptr& params,
23 		boost::asio::yield_context& yc,
24 		HttpServerConnection& server
25 	) override;
26 
27 private:
28 	static Dictionary::Ptr SerializeObjectAttrs(const Object::Ptr& object, const String& attrPrefix,
29 		const Array::Ptr& attrs, bool isJoin, bool allAttrs);
30 };
31 
32 }
33 
34 #endif /* OBJECTQUERYHANDLER_H */
35