summaryrefslogtreecommitdiffstats
path: root/src/Client
diff options
context:
space:
mode:
Diffstat (limited to 'src/Client')
-rw-r--r--src/Client/CommandManager.cpp16
-rw-r--r--src/Client/CommandManager.h16
-rw-r--r--src/Client/CommandParser.cpp16
-rw-r--r--src/Client/InformationManager.cpp4
-rw-r--r--src/Client/InformationManager.h6
-rw-r--r--src/Client/Requests/DaemonCommandRequest.h6
-rw-r--r--src/Client/Requests/DaemonFSInfoRequest.h6
-rw-r--r--src/Client/Requests/DaemonListRequest.h6
-rw-r--r--src/Client/Requests/DaemonStatusRequest.h6
9 files changed, 41 insertions, 41 deletions
diff --git a/src/Client/CommandManager.cpp b/src/Client/CommandManager.cpp
index bcb3429..3bfc3a6 100644
--- a/src/Client/CommandManager.cpp
+++ b/src/Client/CommandManager.cpp
@@ -20,7 +20,7 @@
#include "CommandManager.h"
#include <Common/HostInfo.h>
#include <Common/Logger.h>
-#include <Common/XmlRequest.h>
+#include <Common/Request.h>
#include <cmath>
#include <iostream>
@@ -136,7 +136,7 @@ void CommandManager::printHostStatus(const Common::XmlPacket &packet) {
}
-void CommandManager::daemonCommandRequestFinished(const Common::XmlRequest &request) {
+void CommandManager::daemonCommandRequestFinished(const Common::Request &request) {
try {
request.getResult();
}
@@ -147,7 +147,7 @@ void CommandManager::daemonCommandRequestFinished(const Common::XmlRequest &requ
requestFinished();
}
-void CommandManager::daemonFSInfoRequestFinished(const Common::XmlRequest &request) {
+void CommandManager::daemonFSInfoRequestFinished(const Common::Request &request) {
try {
const Common::XmlPacket &packet = request.getResult();
std::cout << "Host file system usage:" << std::endl;
@@ -160,7 +160,7 @@ void CommandManager::daemonFSInfoRequestFinished(const Common::XmlRequest &reque
requestFinished();
}
-void CommandManager::daemonStatusRequestFinished(const Common::XmlRequest &request) {
+void CommandManager::daemonStatusRequestFinished(const Common::Request &request) {
try {
const Common::XmlPacket &packet = request.getResult();
std::cout << "Host status:" << std::endl;
@@ -173,7 +173,7 @@ void CommandManager::daemonStatusRequestFinished(const Common::XmlRequest &reque
requestFinished();
}
-void CommandManager::disconnectRequestFinished(const Common::XmlRequest &request) {
+void CommandManager::disconnectRequestFinished(const Common::Request &request) {
try {
request.getResult();
disconnect = true;
@@ -185,7 +185,7 @@ void CommandManager::disconnectRequestFinished(const Common::XmlRequest &request
requestFinished();
}
-void CommandManager::fsInfoRequestFinished(const Common::XmlRequest &request) {
+void CommandManager::fsInfoRequestFinished(const Common::Request &request) {
try {
const Common::XmlPacket &packet = request.getResult();
std::cout << "Server file system usage:" << std::endl;
@@ -198,7 +198,7 @@ void CommandManager::fsInfoRequestFinished(const Common::XmlRequest &request) {
requestFinished();
}
-void CommandManager::statusRequestFinished(const Common::XmlRequest &request) {
+void CommandManager::statusRequestFinished(const Common::Request &request) {
try {
const Common::XmlPacket &packet = request.getResult();
std::cout << "Server status:" << std::endl;
@@ -211,7 +211,7 @@ void CommandManager::statusRequestFinished(const Common::XmlRequest &request) {
requestFinished();
}
-void CommandManager::userListRequestFinished(const Common::XmlRequest &request) {
+void CommandManager::userListRequestFinished(const Common::Request &request) {
try {
const Common::XmlPacket &packet = request.getResult();
diff --git a/src/Client/CommandManager.h b/src/Client/CommandManager.h
index a49cda7..1c6e5fc 100644
--- a/src/Client/CommandManager.h
+++ b/src/Client/CommandManager.h
@@ -26,7 +26,7 @@ namespace Mad {
namespace Common {
class XmlPacket;
-class XmlRequest;
+class Request;
}
namespace Client {
@@ -52,13 +52,13 @@ class CommandManager {
void printFSInfo(const Common::XmlPacket &packet);
void printHostStatus(const Common::XmlPacket &packet);
- void daemonCommandRequestFinished(const Common::XmlRequest &request);
- void daemonFSInfoRequestFinished(const Common::XmlRequest &request);
- void daemonStatusRequestFinished(const Common::XmlRequest &request);
- void disconnectRequestFinished(const Common::XmlRequest &request);
- void fsInfoRequestFinished(const Common::XmlRequest &request);
- void statusRequestFinished(const Common::XmlRequest &request);
- void userListRequestFinished(const Common::XmlRequest &request);
+ void daemonCommandRequestFinished(const Common::Request &request);
+ void daemonFSInfoRequestFinished(const Common::Request &request);
+ void daemonStatusRequestFinished(const Common::Request &request);
+ void disconnectRequestFinished(const Common::Request &request);
+ void fsInfoRequestFinished(const Common::Request &request);
+ void statusRequestFinished(const Common::Request &request);
+ void userListRequestFinished(const Common::Request &request);
CommandManager() : activeRequests(0), disconnect(false) {}
diff --git a/src/Client/CommandParser.cpp b/src/Client/CommandParser.cpp
index 526f434..27aac78 100644
--- a/src/Client/CommandParser.cpp
+++ b/src/Client/CommandParser.cpp
@@ -110,9 +110,9 @@ std::map<std::string, Common::HostInfo> CommandParser::parseHostList(const std::
void CommandParser::fsinfoCommand(const std::vector<std::string> &args) {
if(args.size() == 1)
- Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::XmlRequest>(new Common::Requests::FSInfoRequest(sigc::mem_fun(CommandManager::get(), &CommandManager::fsInfoRequestFinished))));
+ Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::Request>(new Common::Requests::FSInfoRequest(sigc::mem_fun(CommandManager::get(), &CommandManager::fsInfoRequestFinished))));
else if(args.size() == 2)
- Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::XmlRequest>(new Requests::DaemonFSInfoRequest(args[1], sigc::mem_fun(CommandManager::get(), &CommandManager::daemonFSInfoRequestFinished))));
+ Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::Request>(new Requests::DaemonFSInfoRequest(args[1], sigc::mem_fun(CommandManager::get(), &CommandManager::daemonFSInfoRequestFinished))));
else {
Common::Logger::logf(Common::Logger::ERROR, "%s: Too many arguments.", args[0].c_str());
printUsage("fsinfo");
@@ -213,7 +213,7 @@ void CommandParser::rebootCommand(const std::vector<std::string> &args) {
std::map<std::string, Common::HostInfo> hosts = parseHostList(std::vector<std::string>(args.begin()+1, args.end()), true);
for(std::map<std::string, Common::HostInfo>::iterator host = hosts.begin(); host != hosts.end(); ++host) {
- Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::XmlRequest>(
+ Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::Request>(
new Requests::DaemonCommandRequest(host->first, true, sigc::mem_fun(CommandManager::get(), &CommandManager::daemonCommandRequestFinished))
));
@@ -231,7 +231,7 @@ void CommandParser::shutdownCommand(const std::vector<std::string> &args) {
std::map<std::string, Common::HostInfo> hosts = parseHostList(std::vector<std::string>(args.begin()+1, args.end()), true);
for(std::map<std::string, Common::HostInfo>::iterator host = hosts.begin(); host != hosts.end(); ++host) {
- Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::XmlRequest>(
+ Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::Request>(
new Requests::DaemonCommandRequest(host->first, false, sigc::mem_fun(CommandManager::get(), &CommandManager::daemonCommandRequestFinished))
));
@@ -241,9 +241,9 @@ void CommandParser::shutdownCommand(const std::vector<std::string> &args) {
void CommandParser::statusCommand(const std::vector<std::string> &args) {
if(args.size() == 1)
- Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::XmlRequest>(new Common::Requests::StatusRequest(sigc::mem_fun(CommandManager::get(), &CommandManager::statusRequestFinished))));
+ Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::Request>(new Common::Requests::StatusRequest(sigc::mem_fun(CommandManager::get(), &CommandManager::statusRequestFinished))));
else if(args.size() == 2)
- Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::XmlRequest>(new Requests::DaemonStatusRequest(args[1], sigc::mem_fun(CommandManager::get(), &CommandManager::daemonStatusRequestFinished))));
+ Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::Request>(new Requests::DaemonStatusRequest(args[1], sigc::mem_fun(CommandManager::get(), &CommandManager::daemonStatusRequestFinished))));
else {
Common::Logger::logf(Common::Logger::ERROR, "%s: Too many arguments.", args[0].c_str());
printUsage("status");
@@ -256,13 +256,13 @@ void CommandParser::statusCommand(const std::vector<std::string> &args) {
void CommandParser::listUsersCommand(const std::vector<std::string>&) {
++CommandManager::get()->activeRequests;
- Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::XmlRequest>(new Common::Requests::UserListRequest(sigc::mem_fun(CommandManager::get(), &CommandManager::userListRequestFinished))));
+ Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::Request>(new Common::Requests::UserListRequest(sigc::mem_fun(CommandManager::get(), &CommandManager::userListRequestFinished))));
}
void CommandParser::exitCommand(const std::vector<std::string>&) {
++CommandManager::get()->activeRequests;
- Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::XmlRequest>(new Common::Requests::DisconnectRequest(sigc::mem_fun(CommandManager::get(), &CommandManager::disconnectRequestFinished))));
+ Common::RequestManager::get()->sendRequest(connection, std::auto_ptr<Common::Request>(new Common::Requests::DisconnectRequest(sigc::mem_fun(CommandManager::get(), &CommandManager::disconnectRequestFinished))));
}
bool CommandParser::parse(const std::string &cmd) {
diff --git a/src/Client/InformationManager.cpp b/src/Client/InformationManager.cpp
index 616e09b..cafe2fa 100644
--- a/src/Client/InformationManager.cpp
+++ b/src/Client/InformationManager.cpp
@@ -72,7 +72,7 @@ void InformationManager::updateDaemonList(Net::Connection *con) {
return;
Common::RequestManager::get()->sendRequest(con,
- std::auto_ptr<Common::XmlRequest>(
+ std::auto_ptr<Common::Request>(
new Requests::DaemonListRequest(sigc::mem_fun(this, &InformationManager::daemonListRequestFinished))
)
);
@@ -80,7 +80,7 @@ void InformationManager::updateDaemonList(Net::Connection *con) {
updating = true;
}
-void InformationManager::daemonListRequestFinished(const Common::XmlRequest &request) {
+void InformationManager::daemonListRequestFinished(const Common::Request &request) {
try {
const Common::XmlPacket &packet = request.getResult();
diff --git a/src/Client/InformationManager.h b/src/Client/InformationManager.h
index 890622c..566eaf6 100644
--- a/src/Client/InformationManager.h
+++ b/src/Client/InformationManager.h
@@ -25,7 +25,7 @@
#include <Common/HostInfo.h>
#include <Common/Initializable.h>
-#include <Common/XmlRequest.h>
+#include <Common/Request.h>
namespace Mad {
@@ -42,7 +42,7 @@ namespace Client {
class InformationManager : public Common::Initializable {
private:
- class DaemonStateUpdateRequestHandler : public Common::XmlRequestHandler {
+ class DaemonStateUpdateRequestHandler : public Common::RequestHandler {
protected:
virtual void handlePacket(Net::Connection *connection, uint16_t requestId, const Common::XmlPacket &packet);
@@ -62,7 +62,7 @@ class InformationManager : public Common::Initializable {
InformationManager() : updating(false) {}
- void daemonListRequestFinished(const Common::XmlRequest &request);
+ void daemonListRequestFinished(const Common::Request &request);
protected:
virtual void doInit();
diff --git a/src/Client/Requests/DaemonCommandRequest.h b/src/Client/Requests/DaemonCommandRequest.h
index 8575123..13a6da6 100644
--- a/src/Client/Requests/DaemonCommandRequest.h
+++ b/src/Client/Requests/DaemonCommandRequest.h
@@ -20,14 +20,14 @@
#ifndef MAD_CLIENT_REQUEST_DAEMONCOMMANDREQUEST_H_
#define MAD_CLIENT_REQUEST_DAEMONCOMMANDREQUEST_H_
-#include <Common/XmlRequest.h>
+#include <Common/Request.h>
#include <string>
namespace Mad {
namespace Client {
namespace Requests {
-class DaemonCommandRequest : public Common::XmlRequest {
+class DaemonCommandRequest : public Common::Request {
private:
std::string daemon;
bool reboot;
@@ -37,7 +37,7 @@ class DaemonCommandRequest : public Common::XmlRequest {
virtual void handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet);
public:
- DaemonCommandRequest(const std::string &daemon0, bool reboot0, slot_type slot) : Common::XmlRequest(slot), daemon(daemon0), reboot(reboot0) {}
+ DaemonCommandRequest(const std::string &daemon0, bool reboot0, slot_type slot) : Common::Request(slot), daemon(daemon0), reboot(reboot0) {}
};
}
diff --git a/src/Client/Requests/DaemonFSInfoRequest.h b/src/Client/Requests/DaemonFSInfoRequest.h
index 48a201f..a42d85a 100644
--- a/src/Client/Requests/DaemonFSInfoRequest.h
+++ b/src/Client/Requests/DaemonFSInfoRequest.h
@@ -20,7 +20,7 @@
#ifndef MAD_CLIENT_REQUESTS_DAEMONFSINFOREQUEST_H_
#define MAD_CLIENT_REQUESTS_DAEMONFSINFOREQUEST_H_
-#include <Common/XmlRequest.h>
+#include <Common/Request.h>
#include <string>
@@ -28,7 +28,7 @@ namespace Mad {
namespace Client {
namespace Requests {
-class DaemonFSInfoRequest : public Common::XmlRequest {
+class DaemonFSInfoRequest : public Common::Request {
private:
std::string daemon;
@@ -37,7 +37,7 @@ class DaemonFSInfoRequest : public Common::XmlRequest {
virtual void handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet);
public:
- DaemonFSInfoRequest(const std::string &daemon0, slot_type slot) : Common::XmlRequest(slot), daemon(daemon0) {}
+ DaemonFSInfoRequest(const std::string &daemon0, slot_type slot) : Common::Request(slot), daemon(daemon0) {}
};
}
diff --git a/src/Client/Requests/DaemonListRequest.h b/src/Client/Requests/DaemonListRequest.h
index ca37dbd..3b561d2 100644
--- a/src/Client/Requests/DaemonListRequest.h
+++ b/src/Client/Requests/DaemonListRequest.h
@@ -20,19 +20,19 @@
#ifndef MAD_CLIENT_REQUEST_DAEMONLISTREQUEST_H_
#define MAD_CLIENT_REQUEST_DAEMONLISTREQUEST_H_
-#include <Common/XmlRequest.h>
+#include <Common/Request.h>
namespace Mad {
namespace Client {
namespace Requests {
-class DaemonListRequest : public Common::XmlRequest {
+class DaemonListRequest : public Common::Request {
protected:
virtual void sendRequest(Net::Connection *connection, uint16_t requestId);
virtual void handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet);
public:
- DaemonListRequest(slot_type slot) : Common::XmlRequest(slot) {}
+ DaemonListRequest(slot_type slot) : Common::Request(slot) {}
};
}
diff --git a/src/Client/Requests/DaemonStatusRequest.h b/src/Client/Requests/DaemonStatusRequest.h
index b0982e6..2ccc9b2 100644
--- a/src/Client/Requests/DaemonStatusRequest.h
+++ b/src/Client/Requests/DaemonStatusRequest.h
@@ -20,7 +20,7 @@
#ifndef MAD_CLIENT_REQUESTS_DAEMONSTATUSREQUEST_H_
#define MAD_CLIENT_REQUESTS_DAEMONSTATUSREQUEST_H_
-#include <Common/XmlRequest.h>
+#include <Common/Request.h>
#include <string>
@@ -28,7 +28,7 @@ namespace Mad {
namespace Client {
namespace Requests {
-class DaemonStatusRequest : public Common::XmlRequest {
+class DaemonStatusRequest : public Common::Request {
private:
std::string daemon;
@@ -37,7 +37,7 @@ class DaemonStatusRequest : public Common::XmlRequest {
virtual void handlePacket(Net::Connection*, uint16_t, const Common::XmlPacket &packet);
public:
- DaemonStatusRequest(const std::string &daemon0, slot_type slot) : Common::XmlRequest(slot), daemon(daemon0) {}
+ DaemonStatusRequest(const std::string &daemon0, slot_type slot) : Common::Request(slot), daemon(daemon0) {}
};
}