Commit 2837749f authored by legoc's avatar legoc
Browse files

(split) Renamed requests (added suffix v0) that will become useless

parent 8382ece9
...@@ -273,7 +273,7 @@ void This::cancelWaitings() { ...@@ -273,7 +273,7 @@ void This::cancelWaitings() {
int This::initUnmanagedApplication() { int This::initUnmanagedApplication() {
unique_ptr<zmq::message_t> reply = m_requestSocket->request(m_impl->createStartedUnmanagedRequest(m_name)); unique_ptr<zmq::message_t> reply = m_requestSocket->request(m_impl->createAttachUnmanagedRequest(m_name));
// Get the JSON response. // Get the JSON response.
json::Object response; json::Object response;
...@@ -284,7 +284,7 @@ int This::initUnmanagedApplication() { ...@@ -284,7 +284,7 @@ int This::initUnmanagedApplication() {
void This::terminateUnmanagedApplication() { void This::terminateUnmanagedApplication() {
m_requestSocket->request(m_impl->createTerminatedUnmanagedRequest(m_id)); m_requestSocket->request(m_impl->createDetachUnmanagedRequest(m_id));
} }
bool This::setRunning() { bool This::setRunning() {
...@@ -341,7 +341,7 @@ bool This::destroyPublisher(const std::string& name) const { ...@@ -341,7 +341,7 @@ bool This::destroyPublisher(const std::string& name) const {
bool This::removePort(const std::string& name) const { bool This::removePort(const std::string& name) const {
unique_ptr<zmq::message_t> reply = m_requestSocket->request(m_impl->createRemovePortRequest(m_id, name)); unique_ptr<zmq::message_t> reply = m_requestSocket->request(m_impl->createRemovePortV0Request(m_id, name));
// Get the JSON response. // Get the JSON response.
json::Object response; json::Object response;
...@@ -1007,7 +1007,7 @@ std::unique_ptr<Responder> Responder::create(const std::string& name) { ...@@ -1007,7 +1007,7 @@ std::unique_ptr<Responder> Responder::create(const std::string& name) {
string portName = ResponderImpl::RESPONDER_PREFIX + name; string portName = ResponderImpl::RESPONDER_PREFIX + name;
unique_ptr<zmq::message_t> reply = This::m_instance.m_requestSocket->request(This::m_instance.m_impl->createRequestPortRequest(This::m_instance.m_id, portName)); unique_ptr<zmq::message_t> reply = This::m_instance.m_requestSocket->request(This::m_instance.m_impl->createRequestPortV0Request(This::m_instance.m_id, portName));
// Get the JSON response. // Get the JSON response.
json::Object response; json::Object response;
...@@ -1068,7 +1068,7 @@ std::unique_ptr<Requester> Requester::create(Instance & instance, const std::str ...@@ -1068,7 +1068,7 @@ std::unique_ptr<Requester> Requester::create(Instance & instance, const std::str
int requesterId = RequesterImpl::newRequesterId(); int requesterId = RequesterImpl::newRequesterId();
string requesterPortName = RequesterImpl::getRequesterPortName(name, responderId, requesterId); string requesterPortName = RequesterImpl::getRequesterPortName(name, responderId, requesterId);
string request = This::m_instance.m_impl->createConnectPortRequest(responderId, responderPortName); string request = This::m_instance.m_impl->createConnectPortV0Request(responderId, responderPortName);
unique_ptr<zmq::message_t> reply = instanceRequestSocket->request(request); unique_ptr<zmq::message_t> reply = instanceRequestSocket->request(request);
...@@ -1096,7 +1096,7 @@ std::unique_ptr<Requester> Requester::create(Instance & instance, const std::str ...@@ -1096,7 +1096,7 @@ std::unique_ptr<Requester> Requester::create(Instance & instance, const std::str
} }
// Request a requester port. // Request a requester port.
reply = This::m_instance.m_requestSocket->request(This::m_instance.m_impl->createRequestPortRequest(This::m_instance.m_id, requesterPortName)); reply = This::m_instance.m_requestSocket->request(This::m_instance.m_impl->createRequestPortV0Request(This::m_instance.m_id, requesterPortName));
json::parse(response, reply.get()); json::parse(response, reply.get());
int requesterPort = response[message::RequestResponse::VALUE].GetInt(); int requesterPort = response[message::RequestResponse::VALUE].GetInt();
......
...@@ -98,7 +98,7 @@ bool PublisherImpl::waitForSubscribers() { ...@@ -98,7 +98,7 @@ bool PublisherImpl::waitForSubscribers() {
if (type == message::SYNC) { if (type == message::SYNC) {
reply.reset(processInitCommand()); reply.reset(processInitCommand());
} }
else if (type == message::SUBSCRIBE_PUBLISHER) { else if (type == message::SUBSCRIBE_PUBLISHER_v0) {
counter++; counter++;
reply.reset(processSubscribePublisherCommand()); reply.reset(processSubscribePublisherCommand());
} }
......
...@@ -259,7 +259,7 @@ std::string ServicesImpl::createSubscribePublisherRequest() const { ...@@ -259,7 +259,7 @@ std::string ServicesImpl::createSubscribePublisherRequest() const {
json::StringObject request; json::StringObject request;
request.pushKey(message::TYPE); request.pushKey(message::TYPE);
request.pushInt(message::SUBSCRIBE_PUBLISHER); request.pushInt(message::SUBSCRIBE_PUBLISHER_v0);
return request.toString(); return request.toString();
} }
...@@ -268,7 +268,7 @@ std::string ServicesImpl::createCreatePublisherRequest(int id, const std::string ...@@ -268,7 +268,7 @@ std::string ServicesImpl::createCreatePublisherRequest(int id, const std::string
json::StringObject request; json::StringObject request;
request.pushKey(message::TYPE); request.pushKey(message::TYPE);
request.pushInt(message::CREATE_PUBLISHER); request.pushInt(message::CREATE_PUBLISHER_v0);
request.pushKey(message::CreatePublisherRequest::ID); request.pushKey(message::CreatePublisherRequest::ID);
request.pushInt(id); request.pushInt(id);
...@@ -286,7 +286,7 @@ std::string ServicesImpl::createConnectPublisherRequest(int id, const std::strin ...@@ -286,7 +286,7 @@ std::string ServicesImpl::createConnectPublisherRequest(int id, const std::strin
json::StringObject request; json::StringObject request;
request.pushKey(message::TYPE); request.pushKey(message::TYPE);
request.pushInt(message::CONNECT_PUBLISHER); request.pushInt(message::CONNECT_PUBLISHER_v0);
request.pushKey(message::ConnectPublisherRequest::APPLICATION_ID); request.pushKey(message::ConnectPublisherRequest::APPLICATION_ID);
request.pushInt(id); request.pushInt(id);
...@@ -301,7 +301,7 @@ std::string ServicesImpl::createTerminatePublisherRequest(int id, const std::str ...@@ -301,7 +301,7 @@ std::string ServicesImpl::createTerminatePublisherRequest(int id, const std::str
json::StringObject request; json::StringObject request;
request.pushKey(message::TYPE); request.pushKey(message::TYPE);
request.pushInt(message::TERMINATE_PUBLISHER); request.pushInt(message::TERMINATE_PUBLISHER_v0);
request.pushKey(message::TerminatePublisherRequest::ID); request.pushKey(message::TerminatePublisherRequest::ID);
request.pushInt(id); request.pushInt(id);
...@@ -312,76 +312,76 @@ std::string ServicesImpl::createTerminatePublisherRequest(int id, const std::str ...@@ -312,76 +312,76 @@ std::string ServicesImpl::createTerminatePublisherRequest(int id, const std::str
return request.toString(); return request.toString();
} }
std::string ServicesImpl::createRequestPortRequest(int id, const std::string& name) const { std::string ServicesImpl::createRequestPortV0Request(int id, const std::string& name) const {
json::StringObject request; json::StringObject request;
request.pushKey(message::TYPE); request.pushKey(message::TYPE);
request.pushInt(message::REQUEST_PORT); request.pushInt(message::REQUEST_PORT_v0);
request.pushKey(message::RequestPortRequest::ID); request.pushKey(message::RequestPortV0Request::ID);
request.pushInt(id); request.pushInt(id);
request.pushKey(message::RequestPortRequest::NAME); request.pushKey(message::RequestPortV0Request::NAME);
request.pushString(name); request.pushString(name);
return request.toString(); return request.toString();
} }
std::string ServicesImpl::createConnectPortRequest(int id, const std::string& name) const { std::string ServicesImpl::createConnectPortV0Request(int id, const std::string& name) const {
json::StringObject request; json::StringObject request;
request.pushKey(message::TYPE); request.pushKey(message::TYPE);
request.pushInt(message::CONNECT_PORT); request.pushInt(message::CONNECT_PORT_v0);
request.pushKey(message::ConnectPortRequest::ID); request.pushKey(message::ConnectPortV0Request::ID);
request.pushInt(id); request.pushInt(id);
request.pushKey(message::ConnectPortRequest::NAME); request.pushKey(message::ConnectPortV0Request::NAME);
request.pushString(name); request.pushString(name);
return request.toString(); return request.toString();
} }
std::string ServicesImpl::createRemovePortRequest(int id, const std::string& name) const { std::string ServicesImpl::createRemovePortV0Request(int id, const std::string& name) const {
json::StringObject request; json::StringObject request;
request.pushKey(message::TYPE); request.pushKey(message::TYPE);
request.pushInt(message::REMOVE_PORT); request.pushInt(message::REMOVE_PORT_v0);
request.pushKey(message::RemovePortRequest::ID); request.pushKey(message::RemovePortV0Request::ID);
request.pushInt(id); request.pushInt(id);
request.pushKey(message::RemovePortRequest::NAME); request.pushKey(message::RemovePortV0Request::NAME);
request.pushString(name); request.pushString(name);
return request.toString(); return request.toString();
} }
std::string ServicesImpl::createStartedUnmanagedRequest(const std::string& name) const { std::string ServicesImpl::createAttachUnmanagedRequest(const std::string& name) const {
// Get the pid. // Get the pid.
long pid = GET_PROCESS_PID(); long pid = GET_PROCESS_PID();
json::StringObject request; json::StringObject request;
request.pushKey(message::TYPE); request.pushKey(message::TYPE);
request.pushInt(message::STARTED_UNMANAGED); request.pushInt(message::ATTACH_UNMANAGED);
request.pushKey(message::StartedUnmanagedRequest::NAME); request.pushKey(message::AttachUnmanagedRequest::NAME);
request.pushString(name); request.pushString(name);
request.pushKey(message::StartedUnmanagedRequest::PID); request.pushKey(message::AttachUnmanagedRequest::PID);
request.pushInt64(pid); request.pushInt64(pid);
return request.toString(); return request.toString();
} }
std::string ServicesImpl::createTerminatedUnmanagedRequest(int id) const { std::string ServicesImpl::createDetachUnmanagedRequest(int id) const {
json::StringObject request; json::StringObject request;
request.pushKey(message::TYPE); request.pushKey(message::TYPE);
request.pushInt(message::TERMINATED_UNMANAGED); request.pushInt(message::DETACH_UNMANAGED);
request.pushKey(message::TerminatedUnmanagedRequest::ID); request.pushKey(message::DetachUnmanagedRequest::ID);
request.pushInt(id); request.pushInt(id);
return request.toString(); return request.toString();
......
...@@ -53,11 +53,11 @@ public: ...@@ -53,11 +53,11 @@ public:
std::string createCreatePublisherRequest(int id, const std::string& name, int numberOfSubscribers) const; std::string createCreatePublisherRequest(int id, const std::string& name, int numberOfSubscribers) const;
std::string createConnectPublisherRequest(int id, const std::string& publisherName) const; std::string createConnectPublisherRequest(int id, const std::string& publisherName) const;
std::string createTerminatePublisherRequest(int id, const std::string& name) const; std::string createTerminatePublisherRequest(int id, const std::string& name) const;
std::string createRequestPortRequest(int id, const std::string& name) const; std::string createRequestPortV0Request(int id, const std::string& name) const;
std::string createConnectPortRequest(int id, const std::string& name) const; std::string createConnectPortV0Request(int id, const std::string& name) const;
std::string createRemovePortRequest(int id, const std::string& name) const; std::string createRemovePortV0Request(int id, const std::string& name) const;
std::string createStartedUnmanagedRequest(const std::string& name) const; std::string createAttachUnmanagedRequest(const std::string& name) const;
std::string createTerminatedUnmanagedRequest(int id) const; std::string createDetachUnmanagedRequest(int id) const;
std::string createOutputPortWithIdRequest(int id) const; std::string createOutputPortWithIdRequest(int id) const;
std::string createOutputPortRequest(const std::string& name) const; std::string createOutputPortRequest(const std::string& name) const;
std::string createRequestResponse(int64_t value) const; std::string createRequestResponse(int64_t value) const;
......
...@@ -41,19 +41,19 @@ namespace message { ...@@ -41,19 +41,19 @@ namespace message {
const int LIST = 14; const int LIST = 14;
const int SET_STATUS = 15; const int SET_STATUS = 15;
const int GET_STATUS = 16; const int GET_STATUS = 16;
const int CREATE_PUBLISHER = 17; const int CREATE_PUBLISHER_v0 = 17;
const int TERMINATE_PUBLISHER = 18; const int TERMINATE_PUBLISHER_v0 = 18;
const int CONNECT_PUBLISHER = 19; const int CONNECT_PUBLISHER_v0 = 19;
const int SUBSCRIBE_PUBLISHER = 20; const int SUBSCRIBE_PUBLISHER_v0 = 20;
const int CANCEL = 21; const int CANCEL = 21;
const int SET_RESULT = 22; const int SET_RESULT = 22;
const int REQUEST_PORT = 23; const int REQUEST_PORT_v0 = 23;
const int CONNECT_PORT = 24; const int CONNECT_PORT_v0 = 24;
const int REMOVE_PORT = 25; const int REMOVE_PORT_v0 = 25;
const int REQUEST = 26; const int REQUEST = 26;
const int RESPONSE = 27; const int RESPONSE = 27;
const int STARTED_UNMANAGED = 28; const int ATTACH_UNMANAGED = 28;
const int TERMINATED_UNMANAGED = 29; const int DETACH_UNMANAGED = 29;
const int IMPL_VERSION = 30; const int IMPL_VERSION = 30;
const int STORE_KEY_VALUE = 31; const int STORE_KEY_VALUE = 31;
const int GET_KEY_VALUE = 32; const int GET_KEY_VALUE = 32;
...@@ -196,17 +196,17 @@ namespace message { ...@@ -196,17 +196,17 @@ namespace message {
constexpr const char* DATA = "data"; // required bytes data = 2; constexpr const char* DATA = "data"; // required bytes data = 2;
} }
namespace RequestPortRequest { namespace RequestPortV0Request {
constexpr const char* ID = "id"; // required int32 id = 1; constexpr const char* ID = "id"; // required int32 id = 1;
constexpr const char* NAME = "name"; // required string name = 2; constexpr const char* NAME = "name"; // required string name = 2;
} }
namespace ConnectPortRequest { namespace ConnectPortV0Request {
constexpr const char* ID = "id"; // required int32 id = 1; constexpr const char* ID = "id"; // required int32 id = 1;
constexpr const char* NAME = "name"; // required string name = 2; constexpr const char* NAME = "name"; // required string name = 2;
} }
namespace RemovePortRequest { namespace RemovePortV0Request {
constexpr const char* ID = "id"; // required int32 id = 1; constexpr const char* ID = "id"; // required int32 id = 1;
constexpr const char* NAME = "name"; // required string name = 2; constexpr const char* NAME = "name"; // required string name = 2;
} }
...@@ -242,12 +242,12 @@ namespace message { ...@@ -242,12 +242,12 @@ namespace message {
constexpr const char* REQUESTER_PORT = "requesterPort"; // required int32 requesterPort = 7; constexpr const char* REQUESTER_PORT = "requesterPort"; // required int32 requesterPort = 7;
} }
namespace StartedUnmanagedRequest { namespace AttachUnmanagedRequest {
constexpr const char* NAME = "name"; // required string name = 1; constexpr const char* NAME = "name"; // required string name = 1;
constexpr const char* PID = "pid"; // optional int64 pid = 2; constexpr const char* PID = "pid"; // optional int64 pid = 2;
} }
namespace TerminatedUnmanagedRequest { namespace DetachUnmanagedRequest {
constexpr const char* ID = "id"; // required int32 id = 1; constexpr const char* ID = "id"; // required int32 id = 1;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment