diff --git a/arangod/Sharding/AgencyComm.h b/arangod/Sharding/AgencyComm.h new file mode 100644 index 0000000000..8e1855753f --- /dev/null +++ b/arangod/Sharding/AgencyComm.h @@ -0,0 +1,111 @@ +//////////////////////////////////////////////////////////////////////////////// +/// @brief communication with agency node(s) +/// +/// @file +/// +/// DISCLAIMER +/// +/// Copyright 2010-2012 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 triAGENS GmbH, Cologne, Germany +/// +/// @author Jan Steemann +/// @author Max Neunhoeffer +/// @author Copyright 2013, triagens GmbH, Cologne, Germany +//////////////////////////////////////////////////////////////////////////////// + +#ifndef TRIAGENS_SHARDING_AGENCY_COMM_H +#define TRIAGENS_SHARDING_AGENCY_COMM_H 1 + +#include "Basics/Common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +namespace triagens { + namespace arango { + +// ----------------------------------------------------------------------------- +// --SECTION-- Agent +// ----------------------------------------------------------------------------- + + struct Agent { + std::string _name; + + std::string _endpoint; + }; + +// ----------------------------------------------------------------------------- +// --SECTION-- AgencyCommResult +// ----------------------------------------------------------------------------- + + struct AgencyCommResult { + AgencyCommResult (); + + ~AgencyCommResult (); + + int _statusCode; + + std::map _values; + + }; + +// ----------------------------------------------------------------------------- +// --SECTION-- AgencyComm +// ----------------------------------------------------------------------------- + + class AgencyComm { + + public: + + AgencyComm (); + + ~AgencyComm (); + + int addAgent (Agent); + + int removeAgent (Agent); + + + int setValue (std::string const& key, std::string const& value); + + AgencyCommResult getValues (std::string const& key, bool recursive); + + int removeValue (std::string const& key, bool recursive); + + int casValue (std::string const& key, std::string const& oldValue, std::string const& newValue); + + AgencyCommResult watchValues (std::string const& key, double timeout); + + private: + }; + + } +} + + +#ifdef __cplusplus +} +#endif + +#endif + +// Local Variables: +// mode: outline-minor +// outline-regexp: "^\\(/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|// --SECTION--\\|/// @\\}\\)" +// End: +