mirror of https://gitee.com/bigwinds/arangodb
added AgencyComm header
This commit is contained in:
parent
57d77094d6
commit
e18d4eb162
|
@ -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<std::string, std::string> _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:
|
||||||
|
|
Loading…
Reference in New Issue