summaryrefslogtreecommitdiffstats
path: root/src/Core/Requests
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core/Requests')
-rw-r--r--src/Core/Requests/CommandRequest.cpp5
-rw-r--r--src/Core/Requests/CommandRequest.h5
-rw-r--r--src/Core/Requests/DaemonStateUpdateRequest.cpp5
-rw-r--r--src/Core/Requests/DaemonStateUpdateRequest.h5
4 files changed, 10 insertions, 10 deletions
diff --git a/src/Core/Requests/CommandRequest.cpp b/src/Core/Requests/CommandRequest.cpp
index a280bc5..78bb650 100644
--- a/src/Core/Requests/CommandRequest.cpp
+++ b/src/Core/Requests/CommandRequest.cpp
@@ -18,18 +18,17 @@
*/
#include "CommandRequest.h"
-#include <Net/Connection.h>
namespace Mad {
namespace Core {
namespace Requests {
-void CommandRequest::sendRequest(Net::Connection *connection, uint16_t requestId) {
+void CommandRequest::sendRequest() {
Common::XmlPacket packet;
packet.setType("Command");
packet.add("command", reboot ? "reboot" : "shutdown");
- connection->send(packet.encode(requestId));
+ sendPacket(packet);
}
}
diff --git a/src/Core/Requests/CommandRequest.h b/src/Core/Requests/CommandRequest.h
index aece5ae..2214a29 100644
--- a/src/Core/Requests/CommandRequest.h
+++ b/src/Core/Requests/CommandRequest.h
@@ -31,10 +31,11 @@ class CommandRequest : public Common::Request {
bool reboot;
protected:
- virtual void sendRequest(Net::Connection *connection, uint16_t requestId);
+ virtual void sendRequest();
public:
- CommandRequest(bool reboot0, slot_type slot) : Common::Request(slot), reboot(reboot0) {}
+ CommandRequest(Net::Connection *connection, uint16_t requestId, slot_type slot, bool reboot0)
+ : Common::Request(connection, requestId, slot), reboot(reboot0) {}
};
}
diff --git a/src/Core/Requests/DaemonStateUpdateRequest.cpp b/src/Core/Requests/DaemonStateUpdateRequest.cpp
index abf51de..c8a813b 100644
--- a/src/Core/Requests/DaemonStateUpdateRequest.cpp
+++ b/src/Core/Requests/DaemonStateUpdateRequest.cpp
@@ -18,19 +18,18 @@
*/
#include "DaemonStateUpdateRequest.h"
-#include <Net/Connection.h>
namespace Mad {
namespace Core {
namespace Requests {
-void DaemonStateUpdateRequest::sendRequest(Net::Connection *connection, uint16_t requestId) {
+void DaemonStateUpdateRequest::sendRequest() {
Common::XmlPacket packet;
packet.setType("UpdateHostState");
packet.add("name", name);
packet.add("state", state);
- connection->send(packet.encode(requestId));
+ sendPacket(packet);
}
}
diff --git a/src/Core/Requests/DaemonStateUpdateRequest.h b/src/Core/Requests/DaemonStateUpdateRequest.h
index 3f15e9b..f310119 100644
--- a/src/Core/Requests/DaemonStateUpdateRequest.h
+++ b/src/Core/Requests/DaemonStateUpdateRequest.h
@@ -33,10 +33,11 @@ class DaemonStateUpdateRequest : public Common::Request {
Common::HostInfo::State state;
protected:
- virtual void sendRequest(Net::Connection *connection, uint16_t requestId);
+ virtual void sendRequest();
public:
- DaemonStateUpdateRequest(const std::string &name0, Common::HostInfo::State state0) : Common::Request(slot_type()), name(name0), state(state0) {}
+ DaemonStateUpdateRequest(Net::Connection *connection, uint16_t requestId, slot_type slot, const std::string &name0, Common::HostInfo::State state0)
+ : Common::Request(connection, requestId, slot), name(name0), state(state0) {}
};
}