Fabcoin Core  0.16.2
P2P Digital Currency
AdminNetFace.h
Go to the documentation of this file.
1 
5 #ifndef JSONRPC_CPP_STUB_DEV_RPC_ADMINNETFACE_H_
6 #define JSONRPC_CPP_STUB_DEV_RPC_ADMINNETFACE_H_
7 
8 #include "ModularServer.h"
9 
10 namespace dev {
11  namespace rpc {
12  class AdminNetFace : public ServerInterface<AdminNetFace>
13  {
14  public:
16  {
17  this->bindAndAddMethod(jsonrpc::Procedure("admin_net_start", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &dev::rpc::AdminNetFace::admin_net_startI);
18  this->bindAndAddMethod(jsonrpc::Procedure("admin_net_stop", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &dev::rpc::AdminNetFace::admin_net_stopI);
19  this->bindAndAddMethod(jsonrpc::Procedure("admin_net_connect", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &dev::rpc::AdminNetFace::admin_net_connectI);
20  this->bindAndAddMethod(jsonrpc::Procedure("admin_net_peers", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_STRING, NULL), &dev::rpc::AdminNetFace::admin_net_peersI);
21  this->bindAndAddMethod(jsonrpc::Procedure("admin_net_nodeInfo", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &dev::rpc::AdminNetFace::admin_net_nodeInfoI);
22  this->bindAndAddMethod(jsonrpc::Procedure("admin_nodeInfo", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, NULL), &dev::rpc::AdminNetFace::admin_nodeInfoI);
23  this->bindAndAddMethod(jsonrpc::Procedure("admin_peers", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, NULL), &dev::rpc::AdminNetFace::admin_peersI);
24  this->bindAndAddMethod(jsonrpc::Procedure("admin_addPeer", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &dev::rpc::AdminNetFace::admin_addPeerI);
25  }
26 
27  inline virtual void admin_net_startI(const Json::Value &request, Json::Value &response)
28  {
29  response = this->admin_net_start(request[0u].asString());
30  }
31  inline virtual void admin_net_stopI(const Json::Value &request, Json::Value &response)
32  {
33  response = this->admin_net_stop(request[0u].asString());
34  }
35  inline virtual void admin_net_connectI(const Json::Value &request, Json::Value &response)
36  {
37  response = this->admin_net_connect(request[0u].asString(), request[1u].asString());
38  }
39  inline virtual void admin_net_peersI(const Json::Value &request, Json::Value &response)
40  {
41  response = this->admin_net_peers(request[0u].asString());
42  }
43  inline virtual void admin_net_nodeInfoI(const Json::Value &request, Json::Value &response)
44  {
45  response = this->admin_net_nodeInfo(request[0u].asString());
46  }
47  inline virtual void admin_nodeInfoI(const Json::Value &request, Json::Value &response)
48  {
49  (void)request;
50  response = this->admin_nodeInfo();
51  }
52  inline virtual void admin_peersI(const Json::Value &request, Json::Value &response)
53  {
54  (void)request;
55  response = this->admin_peers();
56  }
57  inline virtual void admin_addPeerI(const Json::Value &request, Json::Value &response)
58  {
59  response = this->admin_addPeer(request[0u].asString());
60  }
61  virtual bool admin_net_start(const std::string& param1) = 0;
62  virtual bool admin_net_stop(const std::string& param1) = 0;
63  virtual bool admin_net_connect(const std::string& param1, const std::string& param2) = 0;
64  virtual Json::Value admin_net_peers(const std::string& param1) = 0;
65  virtual Json::Value admin_net_nodeInfo(const std::string& param1) = 0;
66  virtual Json::Value admin_nodeInfo() = 0;
67  virtual Json::Value admin_peers() = 0;
68  virtual bool admin_addPeer(const std::string& param1) = 0;
69  };
70 
71  }
72 }
73 #endif //JSONRPC_CPP_STUB_DEV_RPC_ADMINNETFACE_H_
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Definition: Arith256.cpp:15
virtual void admin_net_stopI(const Json::Value &request, Json::Value &response)
Definition: AdminNetFace.h:31
virtual Json::Value admin_net_nodeInfo(const std::string &param1)=0
virtual void admin_net_nodeInfoI(const Json::Value &request, Json::Value &response)
Definition: AdminNetFace.h:43
virtual bool admin_net_start(const std::string &param1)=0
virtual void admin_net_peersI(const Json::Value &request, Json::Value &response)
Definition: AdminNetFace.h:39
virtual bool admin_net_connect(const std::string &param1, const std::string &param2)=0
virtual Json::Value admin_net_peers(const std::string &param1)=0
void bindAndAddMethod(jsonrpc::Procedure const &_proc, MethodPointer _pointer)
Definition: ModularServer.h:59
virtual Json::Value admin_nodeInfo()=0
virtual bool admin_addPeer(const std::string &param1)=0
Config::Value_type Value
virtual bool admin_net_stop(const std::string &param1)=0
virtual void admin_addPeerI(const Json::Value &request, Json::Value &response)
Definition: AdminNetFace.h:57
virtual void admin_net_startI(const Json::Value &request, Json::Value &response)
Definition: AdminNetFace.h:27
virtual void admin_nodeInfoI(const Json::Value &request, Json::Value &response)
Definition: AdminNetFace.h:47
virtual void admin_peersI(const Json::Value &request, Json::Value &response)
Definition: AdminNetFace.h:52
virtual void admin_net_connectI(const Json::Value &request, Json::Value &response)
Definition: AdminNetFace.h:35
virtual Json::Value admin_peers()=0
std::string asString(bytes const &_b)
Converts byte array to a string containing the same (binary) data.
Definition: CommonData.h:79