//////////////////////////////////////////////////////////////////////////////// /// DISCLAIMER /// /// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany /// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. /// You may obtain a copy of the License at /// /// http://www.apache.org/licenses/LICENSE-2.0 /// /// Unless required by applicable law or agreed to in writing, software /// distributed under the License is distributed on an "AS IS" BASIS, /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// See the License for the specific language governing permissions and /// limitations under the License. /// /// Copyright holder is ArangoDB GmbH, Cologne, Germany /// /// @author Dr. Frank Celler /// @author Achim Brandt //////////////////////////////////////////////////////////////////////////////// #ifndef ARANGODB_REST_VPP_REQUEST_H #define ARANGODB_REST_VPP_REQUEST_H 1 #include "Rest/GeneralRequest.h" #include "Endpoint/ConnectionInfo.h" #include #include #include #include namespace arangodb { class RestBatchHandler; namespace rest { class GeneralCommTask; class VppCommTask; // class VppsCommTask; } namespace velocypack { class Builder; struct Options; } class VppRequest : public GeneralRequest { friend class rest::VppCommTask; // friend class rest::VppsCommTask; friend class rest::GeneralCommTask; friend class RestBatchHandler; // TODO must be removed private: VppRequest(ConnectionInfo const& connectionInfo, VPackBuffer&& header, size_t length); public: ~VppRequest() {} public: VPackSlice payload(arangodb::velocypack::Options const*) override; int64_t contentLength() const override { return _contentLength; } void setPayload(VPackBuffer&& payload) { _payload = payload; } std::unordered_map const& headers() const override { throw std::logic_error("this needs to be implmented"); return std::unordered_map(); } private: void parseHeader(); // converts _header(vpack) to // _headers(map) int64_t _contentLength; VPackBuffer _header; VPackBuffer _payload; const std::unordered_map _cookies; // TODO remove }; } #endif