Commit 3e85db72 authored by legoc's avatar legoc
Browse files

Renamed createRequest() into createRequestType()

parent 07954c04
......@@ -264,7 +264,7 @@ void This::cancelWaitings() {
int This::initUnmanagedApplication() {
string strRequestType = m_impl->createRequest(PROTO_STARTEDUNMANAGED);
string strRequestType = m_impl->createRequestType(PROTO_STARTEDUNMANAGED);
string strRequestData = m_impl->createStartedUnmanagedRequest(m_name);
unique_ptr<zmq::message_t> reply = m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_serverEndpoint);
......@@ -276,7 +276,7 @@ int This::initUnmanagedApplication() {
void This::terminateUnmanagedApplication() {
string strRequestType = m_impl->createRequest(PROTO_TERMINATEDUNMANAGED);
string strRequestType = m_impl->createRequestType(PROTO_TERMINATEDUNMANAGED);
string strRequestData = m_impl->createTerminatedUnmanagedRequest(m_id);
unique_ptr<zmq::message_t> reply = m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_serverEndpoint);
......@@ -286,7 +286,7 @@ void This::terminateUnmanagedApplication() {
bool This::setRunning() {
string strRequestType = m_instance.m_impl->createRequest(PROTO_SETSTATUS);
string strRequestType = m_instance.m_impl->createRequestType(PROTO_SETSTATUS);
string strRequestData = m_instance.m_impl->createSetStatusRequest(m_instance.m_id, RUNNING);
unique_ptr<zmq::message_t> reply = m_instance.m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_instance.m_serverEndpoint);
......@@ -302,7 +302,7 @@ bool This::setRunning() {
void This::setBinaryResult(const std::string& data) {
string strRequestType = m_instance.m_impl->createRequest(PROTO_SETRESULT);
string strRequestType = m_instance.m_impl->createRequestType(PROTO_SETRESULT);
string strRequestData = m_instance.m_impl->createSetResultRequest(m_instance.m_id, data);
unique_ptr<zmq::message_t> reply = m_instance.m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_instance.m_serverEndpoint);
......@@ -352,7 +352,7 @@ void This::setResult(const double* data, std::size_t size) {
State This::getState(int id) const {
string strRequestType = m_impl->createRequest(PROTO_GETSTATUS);
string strRequestType = m_impl->createRequestType(PROTO_GETSTATUS);
string strRequestData = m_impl->createGetStatusRequest(id);
unique_ptr<zmq::message_t> reply = m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_serverEndpoint);
......@@ -364,7 +364,7 @@ State This::getState(int id) const {
bool This::destroyPublisher(const std::string& name) const {
string strRequestType = m_impl->createRequest(PROTO_TERMINATEPUBLISHER);
string strRequestType = m_impl->createRequestType(PROTO_TERMINATEPUBLISHER);
string strRequestData = m_impl->createTerminatePublisherRequest(m_id, name);
unique_ptr<zmq::message_t> reply = m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_serverEndpoint);
......@@ -377,7 +377,7 @@ bool This::destroyPublisher(const std::string& name) const {
bool This::removePort(const std::string& name) const {
string strRequestType = m_impl->createRequest(PROTO_REMOVEPORT);
string strRequestType = m_impl->createRequestType(PROTO_REMOVEPORT);
string strRequestData = m_impl->createRemovePortRequest(m_id, name);
unique_ptr<zmq::message_t> reply = m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_serverEndpoint);
......@@ -781,7 +781,7 @@ Publisher::~Publisher() {
std::unique_ptr<Publisher> Publisher::create(const std::string& name, int numberOfSubscribers) {
string strRequestType = This::m_instance.m_impl->createRequest(PROTO_CREATEPUBLISHER);
string strRequestType = This::m_instance.m_impl->createRequestType(PROTO_CREATEPUBLISHER);
string strRequestData = This::m_instance.m_impl->createCreatePublisherRequest(This::m_instance.m_id, name, numberOfSubscribers);
unique_ptr<zmq::message_t> reply = This::m_instance.m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, This::m_instance.m_serverEndpoint);
......@@ -1043,7 +1043,7 @@ std::unique_ptr<Responder> Responder::create(const std::string& name) {
string portName = ResponderImpl::RESPONDER_PREFIX + name;
string strRequestType = This::m_instance.m_impl->createRequest(PROTO_REQUESTPORT);
string strRequestType = This::m_instance.m_impl->createRequestType(PROTO_REQUESTPORT);
string strRequestData = This::m_instance.m_impl->createRequestPortRequest(This::m_instance.m_id, portName);
unique_ptr<zmq::message_t> reply = This::m_instance.m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, This::m_instance.m_serverEndpoint);
......@@ -1102,7 +1102,7 @@ std::unique_ptr<Requester> Requester::create(Instance & instance, const std::str
int requesterId = RequesterImpl::newRequesterId();
string requesterPortName = RequesterImpl::getRequesterPortName(name, responderId, requesterId);
string strRequestType = This::m_instance.m_impl->createRequest(PROTO_CONNECTPORT);
string strRequestType = This::m_instance.m_impl->createRequestType(PROTO_CONNECTPORT);
string strRequestData = This::m_instance.m_impl->createConnectPortRequest(responderId, responderPortName);
unique_ptr<zmq::message_t> reply = This::m_instance.m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, responderEndpoint);
......@@ -1128,7 +1128,7 @@ std::unique_ptr<Requester> Requester::create(Instance & instance, const std::str
}
// Request a requester port
strRequestType = This::m_instance.m_impl->createRequest(PROTO_REQUESTPORT);
strRequestType = This::m_instance.m_impl->createRequestType(PROTO_REQUESTPORT);
strRequestData = This::m_instance.m_impl->createRequestPortRequest(This::m_instance.m_id, requesterPortName);
reply = This::m_instance.m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, This::m_instance.m_serverEndpoint);
......
......@@ -107,7 +107,7 @@ std::unique_ptr<application::Instance> Server::start(const std::string& name, Op
int Server::getStreamPort(const std::string& name) {
string strRequestType = m_impl->createRequest(PROTO_OUTPUT);
string strRequestType = m_impl->createRequestType(PROTO_OUTPUT);
string strRequestData = m_impl->createOutputRequest(name);
unique_ptr<zmq::message_t> reply = m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_serverEndpoint);
......@@ -136,7 +136,7 @@ std::unique_ptr<application::Instance> Server::start(const std::string& name, co
instance->setOutputStreamSocket(socket);
}
string strRequestType = m_impl->createRequest(PROTO_START);
string strRequestType = m_impl->createRequestType(PROTO_START);
string strRequestData = m_impl->createStartRequest(name, args, application::This::getReference());
unique_ptr<zmq::message_t> reply = m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_serverEndpoint);
......@@ -163,10 +163,10 @@ Response Server::stopApplicationAsynchronously(int id, bool immediately) const {
string strRequestData;
if (immediately) {
strRequestType = m_impl->createRequest(PROTO_KILL);
strRequestType = m_impl->createRequestType(PROTO_KILL);
strRequestData = m_impl->createKillRequest(id);
} else {
strRequestType = m_impl->createRequest(PROTO_STOP);
strRequestType = m_impl->createRequestType(PROTO_STOP);
strRequestData = m_impl->createStopRequest(id);
}
......@@ -184,7 +184,7 @@ application::InstanceArray Server::connectAll(const std::string& name, Option op
application::InstanceArray instances;
string strRequestType = m_impl->createRequest(PROTO_CONNECT);
string strRequestType = m_impl->createRequestType(PROTO_CONNECT);
string strRequestData = m_impl->createConnectRequest(name);
unique_ptr<zmq::message_t> reply = m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_serverEndpoint);
......@@ -266,7 +266,7 @@ void Server::killAllAndWaitFor(const std::string& name) {
bool Server::isAlive(int id) const {
string strRequestType = m_impl->createRequest(PROTO_ISALIVE);
string strRequestType = m_impl->createRequestType(PROTO_ISALIVE);
string strRequestData = m_impl->createIsAliveRequest(id);
unique_ptr<zmq::message_t> reply = m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_serverEndpoint);
......@@ -280,7 +280,7 @@ std::vector<application::Configuration> Server::getApplicationConfigurations() c
vector<application::Configuration> configVector;
string strRequestType = m_impl->createRequest(PROTO_ALLAVAILABLE);
string strRequestType = m_impl->createRequestType(PROTO_ALLAVAILABLE);
string strRequestData = m_impl->createAllAvailableRequest();
unique_ptr<zmq::message_t> reply = m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_serverEndpoint);
......@@ -308,7 +308,7 @@ std::vector<application::Info> Server::getApplicationInfos() const {
vector<application::Info> infoVector;
string strRequestType = m_impl->createRequest(PROTO_SHOWALL);
string strRequestType = m_impl->createRequestType(PROTO_SHOWALL);
string strRequestData = m_impl->createShowAllRequest();
unique_ptr<zmq::message_t> reply = m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_serverEndpoint);
......@@ -352,7 +352,7 @@ std::unique_ptr<EventStreamSocket> Server::openEventStream() {
std::unique_ptr<application::Subscriber> Server::createSubscriber(int id, const std::string& publisherName, const std::string& instanceName) const {
string strRequestType = m_impl->createRequest(PROTO_CONNECTPUBLISHER);
string strRequestType = m_impl->createRequestType(PROTO_CONNECTPUBLISHER);
string strRequestData = m_impl->createConnectPublisherRequest(id, publisherName);
unique_ptr<zmq::message_t> reply = m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_serverEndpoint);
......
......@@ -22,6 +22,7 @@
#include "impl/CancelIdGenerator.h"
#include "impl/ServicesImpl.h"
#include "impl/StreamSocketImpl.h"
#include "impl/RequestSocketImpl.h"
#include "ProtoType.h"
using namespace std;
......@@ -88,7 +89,7 @@ const std::string& Services::getStatusEndpoint() const {
}
bool Services::isAvailable(int timeout) const {
string strRequestType = m_impl->createRequest(PROTO_INIT);
string strRequestType = m_impl->createRequestType(PROTO_INIT);
string strRequestData = m_impl->createInitRequest();
return m_impl->isAvailable(strRequestType, strRequestData, m_serverEndpoint, timeout);
}
......@@ -96,7 +97,7 @@ bool Services::isAvailable(int timeout) const {
void Services::initStatus() {
// get the status port
string strRequestType = m_impl->createRequest(PROTO_STATUS);
string strRequestType = m_impl->createRequestType(PROTO_STATUS);
string strRequestData = m_impl->createShowStatusRequest();
unique_ptr<zmq::message_t> reply = m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, m_serverEndpoint);
......@@ -132,7 +133,7 @@ std::unique_ptr<EventStreamSocket> Services::openEventStream() {
zmq::socket_t * subscriber = m_impl->createEventSubscriber(m_serverStatusEndpoint, cancelEndpoint.str());
// wait for the connection
string strRequestType = m_impl->createRequest(PROTO_INIT);
string strRequestType = m_impl->createRequestType(PROTO_INIT);
string strRequestData = m_impl->createInitRequest();
m_impl->waitForSubscriber(subscriber, strRequestType, strRequestData, m_serverEndpoint);
......
......@@ -21,11 +21,11 @@
#include <vector>
#include "EventStreamSocket.h"
#include "OutputStreamSocket.h"
#include "impl/RequestSocketImpl.h"
namespace cameo {
class ServicesImpl;
class RequestSocketImpl;
class Services {
......
......@@ -134,7 +134,7 @@ void PublisherImpl::cancelWaitForSubscribers() {
stringstream endpoint;
endpoint << m_application->getUrl() << ":" << (m_publisherPort + 1);
string strRequestType = m_application->m_impl->createRequest(PROTO_CANCEL);
string strRequestType = m_application->m_impl->createRequestType(PROTO_CANCEL);
string strRequestData;
proto::CancelPublisherSyncCommand cancelPublisherSyncCommand;
......
......@@ -44,7 +44,7 @@ RequestImpl::~RequestImpl() {
}
void RequestImpl::replyBinary(const std::string& response) {
string strRequestType = m_application->m_impl->createRequest(PROTO_RESPONSE);
string strRequestType = m_application->m_impl->createRequestType(PROTO_RESPONSE);
m_application->m_impl->tryRequestWithOnePartReply(strRequestType, response, m_requesterEndpoint);
}
......
......@@ -74,7 +74,7 @@ WaitingImpl * RequesterImpl::waiting() {
void RequesterImpl::sendBinary(const std::string& request) {
string strRequestType = m_application->m_impl->createRequest(PROTO_REQUEST);
string strRequestType = m_application->m_impl->createRequestType(PROTO_REQUEST);
string strRequestData;
proto::Request requestCommand;
......@@ -102,7 +102,7 @@ void RequesterImpl::send(const std::string& request) {
void RequesterImpl::sendTwoBinaryParts(const std::string& request1, const std::string& request2) {
string strRequestType = m_application->m_impl->createRequest(PROTO_REQUEST);
string strRequestType = m_application->m_impl->createRequestType(PROTO_REQUEST);
string strRequestData;
proto::Request requestCommand;
......@@ -172,7 +172,7 @@ void RequesterImpl::cancel() {
stringstream requesterEndpoint;
requesterEndpoint << m_application->getUrl() << ":" << m_requesterPort;
string strRequestType = m_application->m_impl->createRequest(PROTO_CANCEL);
string strRequestType = m_application->m_impl->createRequestType(PROTO_CANCEL);
string strRequestData = "cancel";
unique_ptr<zmq::message_t> reply = m_application->m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, requesterEndpoint.str());
......
......@@ -50,7 +50,7 @@ void ResponderImpl::cancel() {
stringstream endpoint;
endpoint << m_application->getUrl() << ":" << m_responderPort;
string strRequestType = m_application->m_impl->createRequest(PROTO_CANCEL);
string strRequestType = m_application->m_impl->createRequestType(PROTO_CANCEL);
string strRequestData = "cancel";
unique_ptr<zmq::message_t> reply = m_application->m_impl->tryRequestWithOnePartReply(strRequestType, strRequestData, endpoint.str());
......
......@@ -74,7 +74,7 @@ std::string ServicesImpl::createInitRequest() const {
return strRequestData;
}
std::string ServicesImpl::createRequest(ProtoType type) const {
std::string ServicesImpl::createRequestType(ProtoType type) const {
proto::MessageType messageType;
messageType.set_type(convertToProtoType(type));
std::string strRequestType;
......@@ -432,7 +432,7 @@ void ServicesImpl::waitForSubscriber(zmq::socket_t * subscriber, const std::stri
void ServicesImpl::subscribeToPublisher(const std::string& endpoint) {
string strRequestType = createRequest(PROTO_SUBSCRIBEPUBLISHER);
string strRequestType = createRequestType(PROTO_SUBSCRIBEPUBLISHER);
string strRequestData = createSubscribePublisherRequest();
unique_ptr<zmq::message_t> reply = tryRequestWithOnePartReply(strRequestType, strRequestData, endpoint);
......
......@@ -38,7 +38,7 @@ public:
void waitForSubscriber(zmq::socket_t * subscriber, const std::string& strRequestType, const std::string& strRequestData, const std::string& endpoint);
void subscribeToPublisher(const std::string& endpoint);
std::string createRequest(ProtoType type) const;
std::string createRequestType(ProtoType type) const;
std::string createInitRequest() const;
std::string createStartRequest(const std::string& name, const std::vector<std::string> & args, const std::string& instanceReference) const;
std::string createStopRequest(int id) const;
......
......@@ -98,7 +98,7 @@ void SubscriberImpl::init() {
while (!ready) {
string strRequestType = m_server->m_impl->createRequest(PROTO_INIT);
string strRequestType = m_server->m_impl->createRequestType(PROTO_INIT);
string strRequestData = m_server->m_impl->createInitRequest();
m_server->m_impl->isAvailable(strRequestType, strRequestData, endpoint, 100);
......
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