|
36 | 36 | #include "xdr/Stellar-transaction.h"
|
37 | 37 | #include "xdrpp/marshal.h"
|
38 | 38 |
|
39 |
| -#include "ExternalQueue.h" |
40 |
| - |
41 | 39 | #ifdef BUILD_TESTS
|
42 | 40 | #include "simulation/LoadGenerator.h"
|
43 | 41 | #include "test/TestAccount.h"
|
@@ -90,9 +88,6 @@ CommandHandler::CommandHandler(Application& app) : mApp(app)
|
90 | 88 | mServer->add404(std::bind(&CommandHandler::fileNotFound, this, _1, _2));
|
91 | 89 | if (mApp.getConfig().modeStoresAnyHistory())
|
92 | 90 | {
|
93 |
| - addRoute("dropcursor", &CommandHandler::dropcursor); |
94 |
| - addRoute("getcursor", &CommandHandler::getcursor); |
95 |
| - addRoute("setcursor", &CommandHandler::setcursor); |
96 | 91 | addRoute("maintenance", &CommandHandler::maintenance);
|
97 | 92 | }
|
98 | 93 |
|
@@ -1011,77 +1006,6 @@ CommandHandler::tx(std::string const& params, std::string& retStr)
|
1011 | 1006 | retStr = Json::FastWriter().write(root);
|
1012 | 1007 | }
|
1013 | 1008 |
|
1014 |
| -void |
1015 |
| -CommandHandler::dropcursor(std::string const& params, std::string& retStr) |
1016 |
| -{ |
1017 |
| - ZoneScoped; |
1018 |
| - std::map<std::string, std::string> map; |
1019 |
| - http::server::server::parseParams(params, map); |
1020 |
| - std::string const& id = map["id"]; |
1021 |
| - |
1022 |
| - if (!ExternalQueue::validateResourceID(id)) |
1023 |
| - { |
1024 |
| - retStr = "Invalid resource id"; |
1025 |
| - } |
1026 |
| - else |
1027 |
| - { |
1028 |
| - ExternalQueue ps(mApp); |
1029 |
| - ps.deleteCursor(id); |
1030 |
| - retStr = "Done"; |
1031 |
| - } |
1032 |
| -} |
1033 |
| - |
1034 |
| -void |
1035 |
| -CommandHandler::setcursor(std::string const& params, std::string& retStr) |
1036 |
| -{ |
1037 |
| - ZoneScoped; |
1038 |
| - std::map<std::string, std::string> map; |
1039 |
| - http::server::server::parseParams(params, map); |
1040 |
| - std::string const& id = map["id"]; |
1041 |
| - |
1042 |
| - uint32 cursor = parseRequiredParam<uint32>(map, "cursor"); |
1043 |
| - |
1044 |
| - if (!ExternalQueue::validateResourceID(id)) |
1045 |
| - { |
1046 |
| - retStr = "Invalid resource id"; |
1047 |
| - } |
1048 |
| - else |
1049 |
| - { |
1050 |
| - ExternalQueue ps(mApp); |
1051 |
| - ps.setCursorForResource(id, cursor); |
1052 |
| - retStr = "Done"; |
1053 |
| - } |
1054 |
| -} |
1055 |
| - |
1056 |
| -void |
1057 |
| -CommandHandler::getcursor(std::string const& params, std::string& retStr) |
1058 |
| -{ |
1059 |
| - ZoneScoped; |
1060 |
| - Json::Value root; |
1061 |
| - std::map<std::string, std::string> map; |
1062 |
| - http::server::server::parseParams(params, map); |
1063 |
| - std::string const& id = map["id"]; |
1064 |
| - |
1065 |
| - // the decision was made not to check validity here |
1066 |
| - // because there are subsequent checks for that in |
1067 |
| - // ExternalQueue and if an exception is thrown for |
1068 |
| - // validity there, the ret format is technically more |
1069 |
| - // correct for the mime type |
1070 |
| - ExternalQueue ps(mApp); |
1071 |
| - std::map<std::string, uint32> curMap; |
1072 |
| - int counter = 0; |
1073 |
| - ps.getCursorForResource(id, curMap); |
1074 |
| - root["cursors"][0]; |
1075 |
| - for (auto cursor : curMap) |
1076 |
| - { |
1077 |
| - root["cursors"][counter]["id"] = cursor.first; |
1078 |
| - root["cursors"][counter]["cursor"] = cursor.second; |
1079 |
| - counter++; |
1080 |
| - } |
1081 |
| - |
1082 |
| - retStr = root.toStyledString(); |
1083 |
| -} |
1084 |
| - |
1085 | 1009 | void
|
1086 | 1010 | CommandHandler::maintenance(std::string const& params, std::string& retStr)
|
1087 | 1011 | {
|
|
0 commit comments