From 1eb9f4df776adc5dc5cf74a587288199bbf8b703 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 4 Sep 2009 00:24:42 +0200 Subject: Renamed: XmlPacket -> XmlData --- .../Authenticators/ChallengeResponseAuthenticator.cpp | 18 +++++++++--------- .../Authenticators/ChallengeResponseAuthenticator.h | 2 +- src/Client/Authenticators/PasswordAuthenticator.cpp | 16 ++++++++-------- src/Client/Authenticators/PasswordAuthenticator.h | 2 +- src/Client/CommandParser.cpp | 2 +- src/Client/CommandParser.h | 2 +- src/Client/InformationManager.cpp | 8 ++++---- src/Client/InformationManager.h | 4 ++-- src/Client/Requests/DaemonCommandRequest.cpp | 2 +- src/Client/Requests/DaemonFSInfoRequest.cpp | 2 +- src/Client/Requests/DaemonStatusRequest.cpp | 2 +- src/Client/SystemCommands.cpp | 16 ++++++++-------- src/Client/SystemCommands.h | 6 +++--- 13 files changed, 41 insertions(+), 41 deletions(-) (limited to 'src/Client') diff --git a/src/Client/Authenticators/ChallengeResponseAuthenticator.cpp b/src/Client/Authenticators/ChallengeResponseAuthenticator.cpp index 33e5ccd..4aadb63 100644 --- a/src/Client/Authenticators/ChallengeResponseAuthenticator.cpp +++ b/src/Client/Authenticators/ChallengeResponseAuthenticator.cpp @@ -28,7 +28,7 @@ namespace Client { namespace Authenticators { void ChallengeResponseAuthenticator::ChallengeResponseAuthRequest::sendRequest() { - Common::XmlPacket packet; + Common::XmlData packet; packet.setType("Authenticate"); packet.set("method", "Challenge-Response"); packet.set("subMethod", hash); @@ -38,7 +38,7 @@ void ChallengeResponseAuthenticator::ChallengeResponseAuthRequest::sendRequest() sendPacket(packet); } -void ChallengeResponseAuthenticator::ChallengeResponseAuthRequest::handlePacket(boost::shared_ptr packet) { +void ChallengeResponseAuthenticator::ChallengeResponseAuthRequest::handlePacket(boost::shared_ptr packet) { if(packet->getType() == "Error") { signalFinished(Core::Exception(packet->get("Where"), static_cast(packet->get("ErrorCode")), packet->get("SubCode"), packet->get("SubSubCode"))); @@ -51,7 +51,7 @@ void ChallengeResponseAuthenticator::ChallengeResponseAuthRequest::handlePacket( return; // TODO Logging } - Common::XmlPacket ret; + Common::XmlData ret; ret.setType("Authenticate"); ret.set("method", "Challenge-Response"); ret.set("subMethod", hash); @@ -88,20 +88,20 @@ void ChallengeResponseAuthenticator::authenticate(Common::Application *applicati application->getRequestManager()->sendRequest(con, request); request->wait(); - std::pair, Core::Exception> result = request->getResult(); + std::pair, Core::Exception> result = request->getResult(); if(!result.first || result.second) throw result.second; - const Common::XmlPacket::List *methods = result.first->getList("methods"); + const Common::XmlData::List *methods = result.first->getList("methods"); - for(Common::XmlPacket::List::const_iterator method = methods->begin(); method != methods->end(); ++method) { + for(Common::XmlData::List::const_iterator method = methods->begin(); method != methods->end(); ++method) { if(method->get("name") != "Challenge-Response") continue; - const Common::XmlPacket::List *subMethods = method->getList("subMethods"); + const Common::XmlData::List *subMethods = method->getList("subMethods"); - for(Common::XmlPacket::List::const_iterator subMethod = subMethods->begin(); subMethod != subMethods->end(); ++subMethod) { + for(Common::XmlData::List::const_iterator subMethod = subMethods->begin(); subMethod != subMethods->end(); ++subMethod) { if(Common::Hash::isHashSupported(subMethod->get("name"))) { hash = subMethod->get("name"); break; @@ -122,7 +122,7 @@ void ChallengeResponseAuthenticator::authenticate(Common::Application *applicati application->getRequestManager()->sendRequest(con, request); request->wait(); - std::pair, Core::Exception> result = request->getResult(); + std::pair, Core::Exception> result = request->getResult(); if(!result.first || result.second) throw result.second; diff --git a/src/Client/Authenticators/ChallengeResponseAuthenticator.h b/src/Client/Authenticators/ChallengeResponseAuthenticator.h index 61c6f20..3906ba9 100644 --- a/src/Client/Authenticators/ChallengeResponseAuthenticator.h +++ b/src/Client/Authenticators/ChallengeResponseAuthenticator.h @@ -41,7 +41,7 @@ class MAD_CLIENT_EXPORT ChallengeResponseAuthenticator { protected: virtual void sendRequest(); - virtual void handlePacket(boost::shared_ptr packet); + virtual void handlePacket(boost::shared_ptr packet); public: ChallengeResponseAuthRequest(Common::Application *application, const std::string &username0, const std::string &password0, const std::string &hash0) diff --git a/src/Client/Authenticators/PasswordAuthenticator.cpp b/src/Client/Authenticators/PasswordAuthenticator.cpp index 8887d96..bf2a284 100644 --- a/src/Client/Authenticators/PasswordAuthenticator.cpp +++ b/src/Client/Authenticators/PasswordAuthenticator.cpp @@ -28,7 +28,7 @@ namespace Client { namespace Authenticators { void PasswordAuthenticator::PasswordAuthRequest::sendRequest() { - Common::XmlPacket packet; + Common::XmlData packet; packet.setType("Authenticate"); packet.set("method", "Password"); packet.set("subMethod", hash); @@ -43,7 +43,7 @@ void PasswordAuthenticator::PasswordAuthRequest::sendRequest() { sendPacket(packet); } -void PasswordAuthenticator::PasswordAuthRequest::handlePacket(boost::shared_ptr packet) { +void PasswordAuthenticator::PasswordAuthRequest::handlePacket(boost::shared_ptr packet) { if(packet->getType() == "Error") { signalFinished(Core::Exception(packet->get("Where"), static_cast(packet->get("ErrorCode")), packet->get("SubCode"), packet->get("SubSubCode"))); @@ -66,20 +66,20 @@ void PasswordAuthenticator::authenticate(Common::Application *application, Commo application->getRequestManager()->sendRequest(con, request); request->wait(); - std::pair, Core::Exception> result = request->getResult(); + std::pair, Core::Exception> result = request->getResult(); if(!result.first || result.second) throw result.second; - const Common::XmlPacket::List *methods = result.first->getList("methods"); + const Common::XmlData::List *methods = result.first->getList("methods"); - for(Common::XmlPacket::List::const_iterator method = methods->begin(); method != methods->end(); ++method) { + for(Common::XmlData::List::const_iterator method = methods->begin(); method != methods->end(); ++method) { if(method->get("name") != "Password") continue; - const Common::XmlPacket::List *subMethods = method->getList("subMethods"); + const Common::XmlData::List *subMethods = method->getList("subMethods"); - for(Common::XmlPacket::List::const_iterator subMethod = subMethods->begin(); subMethod != subMethods->end(); ++subMethod) { + for(Common::XmlData::List::const_iterator subMethod = subMethods->begin(); subMethod != subMethods->end(); ++subMethod) { if(Common::Hash::isHashSupported(subMethod->get("name"))) { hash = subMethod->get("name"); break; @@ -100,7 +100,7 @@ void PasswordAuthenticator::authenticate(Common::Application *application, Commo application->getRequestManager()->sendRequest(con, request); request->wait(); - std::pair, Core::Exception> result = request->getResult(); + std::pair, Core::Exception> result = request->getResult(); if(!result.first || result.second) throw result.second; diff --git a/src/Client/Authenticators/PasswordAuthenticator.h b/src/Client/Authenticators/PasswordAuthenticator.h index d7b2fbc..70ab3f2 100644 --- a/src/Client/Authenticators/PasswordAuthenticator.h +++ b/src/Client/Authenticators/PasswordAuthenticator.h @@ -39,7 +39,7 @@ class MAD_CLIENT_EXPORT PasswordAuthenticator { protected: virtual void sendRequest(); - virtual void handlePacket(boost::shared_ptr packet); + virtual void handlePacket(boost::shared_ptr packet); public: PasswordAuthRequest(Common::Application *application, const std::string &username0, const std::string &password0, const std::string &hash0) diff --git a/src/Client/CommandParser.cpp b/src/Client/CommandParser.cpp index ed0f47e..d93b432 100644 --- a/src/Client/CommandParser.cpp +++ b/src/Client/CommandParser.cpp @@ -202,7 +202,7 @@ void CommandParser::exitCommand(const std::vector &/*args*/) { application->getRequestManager()->sendRequest(connection, request); request->wait(); - std::pair, Core::Exception> result = request->getResult(); + std::pair, Core::Exception> result = request->getResult(); if(result.second) std::cerr << "An error occurred during your request: " << result.second.what() << "." << std::endl; diff --git a/src/Client/CommandParser.h b/src/Client/CommandParser.h index ca168f3..8077a30 100644 --- a/src/Client/CommandParser.h +++ b/src/Client/CommandParser.h @@ -23,7 +23,7 @@ #include "export.h" #include -#include +#include #include #include diff --git a/src/Client/InformationManager.cpp b/src/Client/InformationManager.cpp index bcdb4a9..0021d49 100644 --- a/src/Client/InformationManager.cpp +++ b/src/Client/InformationManager.cpp @@ -27,7 +27,7 @@ namespace Mad { namespace Client { -void InformationManager::DaemonStateUpdateRequestHandler::handleRequest(boost::shared_ptr packet, Common::XmlPacket *ret) { +void InformationManager::DaemonStateUpdateRequestHandler::handleRequest(boost::shared_ptr packet, Common::XmlData *ret) { if(!getConnection()->isAuthenticated()) throw(Core::Exception(Core::Exception::PERMISSION)); @@ -69,19 +69,19 @@ void InformationManager::updateDaemonList(Common::Connection *con) { updating = true; } -void InformationManager::daemonListRequestFinished(boost::shared_ptr packet, Core::Exception error) { +void InformationManager::daemonListRequestFinished(boost::shared_ptr packet, Core::Exception error) { boost::lock_guard lock(mutex); if(!packet || error) { application->logf(Core::Logger::LOG_CRITICAL, "Host list request failed: %s", error.what()); } else { - const Common::XmlPacket::List *list = packet->getList("hosts"); + const Common::XmlData::List *list = packet->getList("hosts"); daemons.clear(); if(list) { - for(Common::XmlPacket::List::const_iterator entry = list->begin(); entry != list->end(); ++entry) { + for(Common::XmlData::List::const_iterator entry = list->begin(); entry != list->end(); ++entry) { Common::HostInfo info; info.setName(entry->get("name")); info.setIP(entry->get("address")); diff --git a/src/Client/InformationManager.h b/src/Client/InformationManager.h index 5f68bc2..dcb0212 100644 --- a/src/Client/InformationManager.h +++ b/src/Client/InformationManager.h @@ -43,7 +43,7 @@ class MAD_CLIENT_EXPORT InformationManager : private boost::noncopyable { private: class MAD_CLIENT_EXPORT DaemonStateUpdateRequestHandler : public Common::RequestHandlers::SimpleRequestHandler { private: - void handleRequest(boost::shared_ptr packet, Common::XmlPacket *ret); + void handleRequest(boost::shared_ptr packet, Common::XmlData *ret); public: DaemonStateUpdateRequestHandler(Common::Application *application) @@ -63,7 +63,7 @@ class MAD_CLIENT_EXPORT InformationManager : private boost::noncopyable { bool updating; - void daemonListRequestFinished(boost::shared_ptr packet, Core::Exception error); + void daemonListRequestFinished(boost::shared_ptr packet, Core::Exception error); InformationManager(Application *application0); ~InformationManager(); diff --git a/src/Client/Requests/DaemonCommandRequest.cpp b/src/Client/Requests/DaemonCommandRequest.cpp index e2066e2..12f91e0 100644 --- a/src/Client/Requests/DaemonCommandRequest.cpp +++ b/src/Client/Requests/DaemonCommandRequest.cpp @@ -24,7 +24,7 @@ namespace Client { namespace Requests { void DaemonCommandRequest::sendRequest() { - Common::XmlPacket packet; + Common::XmlData packet; packet.setType("DaemonCommand"); packet.set("command", reboot ? "reboot" : "shutdown"); packet.set("daemon", daemon); diff --git a/src/Client/Requests/DaemonFSInfoRequest.cpp b/src/Client/Requests/DaemonFSInfoRequest.cpp index b7ea81c..8e4c2d7 100644 --- a/src/Client/Requests/DaemonFSInfoRequest.cpp +++ b/src/Client/Requests/DaemonFSInfoRequest.cpp @@ -24,7 +24,7 @@ namespace Client { namespace Requests { void DaemonFSInfoRequest::sendRequest() { - Common::XmlPacket packet; + Common::XmlData packet; packet.setType("DaemonFSInfo"); packet.set("daemon", daemon); diff --git a/src/Client/Requests/DaemonStatusRequest.cpp b/src/Client/Requests/DaemonStatusRequest.cpp index 6de92cb..8986c7e 100644 --- a/src/Client/Requests/DaemonStatusRequest.cpp +++ b/src/Client/Requests/DaemonStatusRequest.cpp @@ -24,7 +24,7 @@ namespace Client { namespace Requests { void DaemonStatusRequest::sendRequest() { - Common::XmlPacket packet; + Common::XmlData packet; packet.setType("GetDaemonStatus"); packet.set("daemon", daemon); diff --git a/src/Client/SystemCommands.cpp b/src/Client/SystemCommands.cpp index f1bcbbd..ff14cc5 100644 --- a/src/Client/SystemCommands.cpp +++ b/src/Client/SystemCommands.cpp @@ -35,15 +35,15 @@ namespace Mad { namespace Client { -void SystemCommands::printFSInfo(boost::shared_ptr &packet) { +void SystemCommands::printFSInfo(boost::shared_ptr &packet) { const std::string units[] = { "kB", "MB", "GB", "TB", "" }; - const Common::XmlPacket::List *list = packet->getList("filesystems"); + const Common::XmlData::List *list = packet->getList("filesystems"); if(list) { - for(Common::XmlPacket::List::const_iterator fs = list->begin(); fs != list->end(); ++fs) { + for(Common::XmlData::List::const_iterator fs = list->begin(); fs != list->end(); ++fs) { unsigned usedUnit = 0, totalUnit = 0; float used = fs->get("usedSize"); @@ -86,7 +86,7 @@ void SystemCommands::printFSInfo(boost::shared_ptr &pac std::printf("\n"); } -void SystemCommands::printHostStatus(boost::shared_ptr &packet) { +void SystemCommands::printHostStatus(boost::shared_ptr &packet) { unsigned long uptime = packet->get("uptime"); if(uptime) { @@ -165,7 +165,7 @@ void SystemCommands::fsinfoCommand(CommandParser *commandParser, const std::vect commandParser->application->getRequestManager()->sendRequest(commandParser->connection, request); request->wait(); - std::pair, Core::Exception> result = request->getResult(); + std::pair, Core::Exception> result = request->getResult(); if(!result.first || result.second) { std::cerr << "An error occurred during your request: " << result.second.what() << "." << std::endl; @@ -202,7 +202,7 @@ void SystemCommands::rebootCommand(CommandParser *commandParser, const std::vect (*request)->wait(); for(std::vector >::iterator request = requests.begin(); request != requests.end(); ++request) { - std::pair, Core::Exception> result = (*request)->getResult(); + std::pair, Core::Exception> result = (*request)->getResult(); if(result.second) std::cerr << "An error occurred during your request: " << result.second.what() << "." << std::endl; @@ -231,7 +231,7 @@ void SystemCommands::shutdownCommand(CommandParser *commandParser, const std::ve (*request)->wait(); for(std::vector >::iterator request = requests.begin(); request != requests.end(); ++request) { - std::pair, Core::Exception> result = (*request)->getResult(); + std::pair, Core::Exception> result = (*request)->getResult(); if(result.second) std::cerr << "An error occurred during your request: " << result.second.what() << "." << std::endl; @@ -254,7 +254,7 @@ void SystemCommands::statusCommand(CommandParser *commandParser, const std::vect commandParser->application->getRequestManager()->sendRequest(commandParser->connection, request); request->wait(); - std::pair, Core::Exception> result = request->getResult(); + std::pair, Core::Exception> result = request->getResult(); if(!result.first || result.second) { std::cerr << "An error occurred during your request: " << result.second.what() << "." << std::endl; diff --git a/src/Client/SystemCommands.h b/src/Client/SystemCommands.h index 74b1a62..ba8c361 100644 --- a/src/Client/SystemCommands.h +++ b/src/Client/SystemCommands.h @@ -22,7 +22,7 @@ #include "export.h" -#include +#include #include @@ -37,8 +37,8 @@ class MAD_CLIENT_EXPORT SystemCommands { private: SystemCommands(); - static void printFSInfo(boost::shared_ptr &packet); - static void printHostStatus(boost::shared_ptr &packet); + static void printFSInfo(boost::shared_ptr &packet); + static void printHostStatus(boost::shared_ptr &packet); public: static void fsinfoCommand(CommandParser *commandParser, const std::vector &args); -- cgit v1.2.3