diff options
Diffstat (limited to 'src/Common/RequestHandlers')
10 files changed, 25 insertions, 25 deletions
diff --git a/src/Common/RequestHandlers/DisconnectRequestHandler.cpp b/src/Common/RequestHandlers/DisconnectRequestHandler.cpp index d6b3449..90c976c 100644 --- a/src/Common/RequestHandlers/DisconnectRequestHandler.cpp +++ b/src/Common/RequestHandlers/DisconnectRequestHandler.cpp @@ -24,11 +24,11 @@ namespace Mad { namespace Common { namespace RequestHandlers { -void DisconnectRequestHandler::handlePacket(boost::shared_ptr<const XmlPacket> packet) { +void DisconnectRequestHandler::handlePacket(boost::shared_ptr<const XmlData> packet) { if(packet->getType() != "Disconnect") { getApplication()->log(Core::Logger::LOG_ERROR, "Received an unexpected packet."); - XmlPacket ret; + XmlData ret; ret.setType("Error"); ret.set("ErrorCode", Core::Exception::UNEXPECTED_PACKET); @@ -38,7 +38,7 @@ void DisconnectRequestHandler::handlePacket(boost::shared_ptr<const XmlPacket> p return; } - XmlPacket ret; + XmlData ret; ret.setType("OK"); sendPacket(ret); diff --git a/src/Common/RequestHandlers/DisconnectRequestHandler.h b/src/Common/RequestHandlers/DisconnectRequestHandler.h index f4bc827..f3a1fce 100644 --- a/src/Common/RequestHandlers/DisconnectRequestHandler.h +++ b/src/Common/RequestHandlers/DisconnectRequestHandler.h @@ -30,7 +30,7 @@ namespace RequestHandlers { class MAD_COMMON_EXPORT DisconnectRequestHandler : public RequestHandler { protected: - virtual void handlePacket(boost::shared_ptr<const XmlPacket> packet); + virtual void handlePacket(boost::shared_ptr<const XmlData> packet); public: DisconnectRequestHandler(Application *application) : RequestHandler(application) {} diff --git a/src/Common/RequestHandlers/FSInfoRequestHandler.cpp b/src/Common/RequestHandlers/FSInfoRequestHandler.cpp index a416af4..af4bf50 100644 --- a/src/Common/RequestHandlers/FSInfoRequestHandler.cpp +++ b/src/Common/RequestHandlers/FSInfoRequestHandler.cpp @@ -24,7 +24,7 @@ namespace Mad { namespace Common { namespace RequestHandlers { -void FSInfoRequestHandler::handleRequest(boost::shared_ptr<const Common::XmlPacket> /*packet*/, Common::XmlPacket *ret) { +void FSInfoRequestHandler::handleRequest(boost::shared_ptr<const Common::XmlData> /*packet*/, Common::XmlData *ret) { if(!getConnection()->isAuthenticated()) throw(Core::Exception(Core::Exception::PERMISSION)); @@ -32,10 +32,10 @@ void FSInfoRequestHandler::handleRequest(boost::shared_ptr<const Common::XmlPack getApplication()->getSystemManager()->getFSInfo(&fsInfo); ret->setType("OK"); - XmlPacket::List *list = ret->createList("filesystems"); + XmlData::List *list = ret->createList("filesystems"); for(std::vector<SystemManager::FSInfo>::const_iterator fs = fsInfo.begin(); fs != fsInfo.end(); ++fs) { - XmlPacket::List::iterator entry = list->addEntry(); + XmlData::List::iterator entry = list->addEntry(); entry->set("name", fs->fsName); entry->set("mountedOn", fs->mountedOn); diff --git a/src/Common/RequestHandlers/FSInfoRequestHandler.h b/src/Common/RequestHandlers/FSInfoRequestHandler.h index 17c1d8e..745eaae 100644 --- a/src/Common/RequestHandlers/FSInfoRequestHandler.h +++ b/src/Common/RequestHandlers/FSInfoRequestHandler.h @@ -30,7 +30,7 @@ namespace RequestHandlers { class MAD_COMMON_EXPORT FSInfoRequestHandler : public SimpleRequestHandler { private: - void handleRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret); + void handleRequest(boost::shared_ptr<const Common::XmlData> packet, Common::XmlData *ret); public: FSInfoRequestHandler(Application *application) : SimpleRequestHandler(application, "FSInfo", boost::bind(&FSInfoRequestHandler::handleRequest, this, _1, _2)) {} diff --git a/src/Common/RequestHandlers/SimpleRequestHandler.cpp b/src/Common/RequestHandlers/SimpleRequestHandler.cpp index 33dfd5a..86edca6 100644 --- a/src/Common/RequestHandlers/SimpleRequestHandler.cpp +++ b/src/Common/RequestHandlers/SimpleRequestHandler.cpp @@ -25,11 +25,11 @@ namespace Mad { namespace Common { namespace RequestHandlers { -void SimpleRequestHandler::handlePacket(boost::shared_ptr<const XmlPacket> packet) { +void SimpleRequestHandler::handlePacket(boost::shared_ptr<const XmlData> packet) { if(packet->getType() != type) { getApplication()->log(Core::Logger::LOG_ERROR, "Received an unexpected packet."); - XmlPacket ret; + XmlData ret; ret.setType("Error"); ret.set("ErrorCode", Core::Exception::UNEXPECTED_PACKET); @@ -39,7 +39,7 @@ void SimpleRequestHandler::handlePacket(boost::shared_ptr<const XmlPacket> packe return; } - XmlPacket ret; + XmlData ret; try { handler(packet, &ret); diff --git a/src/Common/RequestHandlers/SimpleRequestHandler.h b/src/Common/RequestHandlers/SimpleRequestHandler.h index 3cf0f52..85cbd4c 100644 --- a/src/Common/RequestHandlers/SimpleRequestHandler.h +++ b/src/Common/RequestHandlers/SimpleRequestHandler.h @@ -31,12 +31,12 @@ namespace RequestHandlers { class MAD_COMMON_EXPORT SimpleRequestHandler : public RequestHandler { private: std::string type; - boost::function2<void, boost::shared_ptr<const XmlPacket>, XmlPacket*> handler; + boost::function2<void, boost::shared_ptr<const XmlData>, XmlData*> handler; protected: - virtual void handlePacket(boost::shared_ptr<const XmlPacket> packet); + virtual void handlePacket(boost::shared_ptr<const XmlData> packet); - SimpleRequestHandler(Application *application, const std::string &type0, const boost::function2<void, boost::shared_ptr<const XmlPacket>, XmlPacket*> &handler0) + SimpleRequestHandler(Application *application, const std::string &type0, const boost::function2<void, boost::shared_ptr<const XmlData>, XmlData*> &handler0) : RequestHandler(application), type(type0), handler(handler0) {} }; diff --git a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp index 4d6a0e4..a7debc3 100644 --- a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp +++ b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp @@ -26,11 +26,11 @@ namespace Mad { namespace Common { namespace RequestHandlers { -void SimpleRequestHandlerGroup::GroupRequestHandler::handlePacket(boost::shared_ptr<const XmlPacket> packet) { +void SimpleRequestHandlerGroup::GroupRequestHandler::handlePacket(boost::shared_ptr<const XmlData> packet) { if(packet->getType() != type) { getApplication()->log(Core::Logger::LOG_ERROR, "Received an unexpected packet."); - XmlPacket ret; + XmlData ret; ret.setType("Error"); ret.set("ErrorCode", Core::Exception::UNEXPECTED_PACKET); @@ -40,7 +40,7 @@ void SimpleRequestHandlerGroup::GroupRequestHandler::handlePacket(boost::shared_ return; } - XmlPacket ret; + XmlData ret; try { handler(packet, &ret, getConnection()); @@ -58,7 +58,7 @@ void SimpleRequestHandlerGroup::GroupRequestHandler::handlePacket(boost::shared_ } boost::shared_ptr<RequestHandler> SimpleRequestHandlerGroup::createRequestHandler(Application *application, const std::string &type) { - std::map<std::string, boost::function3<void, boost::shared_ptr<const XmlPacket>, XmlPacket*, Connection*> >::iterator handler = handlers.find(type); + std::map<std::string, boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> >::iterator handler = handlers.find(type); if(handler == handlers.end()) return boost::shared_ptr<RequestHandler>(); diff --git a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.h b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.h index 0a702f8..2022705 100644 --- a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.h +++ b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.h @@ -33,21 +33,21 @@ class MAD_COMMON_EXPORT SimpleRequestHandlerGroup : public RequestHandlerGroup { class MAD_COMMON_EXPORT GroupRequestHandler : public RequestHandler { private: std::string type; - boost::function3<void, boost::shared_ptr<const XmlPacket>, XmlPacket*, Connection*> handler; + boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> handler; protected: - virtual void handlePacket(boost::shared_ptr<const XmlPacket> packet); + virtual void handlePacket(boost::shared_ptr<const XmlData> packet); public: - GroupRequestHandler(Application *application, const std::string &type0, const boost::function3<void, boost::shared_ptr<const XmlPacket>, XmlPacket*, Connection*> &handler0) + GroupRequestHandler(Application *application, const std::string &type0, const boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> &handler0) : RequestHandler(application), type(type0), handler(handler0) {} }; std::set<std::string> types; - std::map<std::string, boost::function3<void, boost::shared_ptr<const XmlPacket>, XmlPacket*, Connection*> > handlers; + std::map<std::string, boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> > handlers; protected: - void registerHandler(const std::string &type, const boost::function3<void, boost::shared_ptr<const XmlPacket>, XmlPacket*, Connection*> &handler) { + void registerHandler(const std::string &type, const boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> &handler) { types.insert(type); handlers.insert(std::make_pair(type, handler)); } diff --git a/src/Common/RequestHandlers/StatusRequestHandler.cpp b/src/Common/RequestHandlers/StatusRequestHandler.cpp index e5d87da..20b49e0 100644 --- a/src/Common/RequestHandlers/StatusRequestHandler.cpp +++ b/src/Common/RequestHandlers/StatusRequestHandler.cpp @@ -24,7 +24,7 @@ namespace Mad { namespace Common { namespace RequestHandlers { -void StatusRequestHandler::handleRequest(boost::shared_ptr<const Common::XmlPacket> /*packet*/, Common::XmlPacket *ret) { +void StatusRequestHandler::handleRequest(boost::shared_ptr<const Common::XmlData> /*packet*/, Common::XmlData *ret) { if(!getConnection()->isAuthenticated()) throw(Core::Exception(Core::Exception::PERMISSION)); diff --git a/src/Common/RequestHandlers/StatusRequestHandler.h b/src/Common/RequestHandlers/StatusRequestHandler.h index 4e79da8..e5301fa 100644 --- a/src/Common/RequestHandlers/StatusRequestHandler.h +++ b/src/Common/RequestHandlers/StatusRequestHandler.h @@ -30,7 +30,7 @@ namespace RequestHandlers { class MAD_COMMON_EXPORT StatusRequestHandler : public SimpleRequestHandler { private: - void handleRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret); + void handleRequest(boost::shared_ptr<const Common::XmlData> packet, Common::XmlData *ret); public: StatusRequestHandler(Application *application) : SimpleRequestHandler(application, "GetStatus", boost::bind(&StatusRequestHandler::handleRequest, this, _1, _2)) {} |