15 #ifndef ROUTE_MESSAGE_HPP
16 #define ROUTE_MESSAGE_HPP
18 #include <Poco/JSON/Object.h>
19 #include <Poco/JSON/Array.h>
46 std::string
build(
const std::string& title=
"");
47 void extract(
const std::string& title,
const std::string& msgBody);
52 static std::string
buildIdentityNames(
const std::vector<ClientWorkerItem>& clientQueue);
55 static std::vector<std::string>
extractRouteNames(
const std::vector<ClientWorkerItem>& clientQueue);
60 void packToObject(Poco::JSON::Object& obj,
const std::vector<ClientWorkerItem>& workerItem);
61 void unpackFromObject(Poco::JSON::Object& obj, std::vector<ClientWorkerItem>& workerItem);
63 static void extractRouteNames(std::vector<std::string>& routeNames,
const std::vector<ClientWorkerItem>& clientQueue);
66 std::vector<ClientWorkerItem>& queue;
75 const std::string MANAGER_ROLE =
"role";
76 const std::string NODES_NAMES =
"nodes";
77 const std::string RESOURCES_USAGE_ALGORITHM =
"alg";
78 const std::string RESOURCES_USAGE_ALGORITHM_WEIGHTS =
"alg_weights";
79 const std::string RESOURCES_USAGE_LIMITS =
"limits";
99 void setNodesNames(std::vector<std::string> nodesNames_) {nodesNames=nodesNames_;}
111 unsigned int managerRole;
112 std::vector<std::string> nodesNames;
113 unsigned int resourcesUsageAlgorithm;
114 std::string resourcesUsageAlgorithmWeights;
115 std::string resourcesUsageLimits;
132 explicit HeartbeatMessage(std::vector<ClientWorkerItem>& queue_,
const std::string& resources_=
"");
143 void setResources(
const std::string& resources_) {resources=resources_;}
146 void packToObject(Poco::JSON::Object& obj,
const std::vector<ClientWorkerItem>& workerItem);
147 void unpackFromObject(Poco::JSON::Object& obj, std::vector<ClientWorkerItem>& workerItem);
150 std::vector<ClientWorkerItem>& queue;
152 std::string resources;
169 explicit PropertyMessage(
const std::string& identity_=
"",
const std::string& property_=
"");
180 void setIdentity(
const std::string& identity_) {identity=identity_;}
183 void setProperty(
const std::string& property_) {
property=property_;}
186 std::string identity;
187 std::string property;
196 #endif // ROUTE_MESSAGE_HPP