00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef GRID_CLIENT_HTTP_COMMAND_EXECUTOR_HPP_INCLUDED
00011 #define GRID_CLIENT_HTTP_COMMAND_EXECUTOR_HPP_INCLUDED
00012
00013 #include <boost/thread.hpp>
00014
00015 #include "gridgain/gridsocketaddress.hpp"
00016 #include "gridgain/impl/cmd/gridclientcommandexecutorprivate.hpp"
00017 #include "gridgain/impl/connection/gridclientconnectionpool.hpp"
00018 #include "gridgain/impl/marshaller/json/gridclientjsonmarshaller.hpp"
00019
00023 class GridClientHttpCommandExecutor : public GridClientCommandExecutorPrivate {
00024 public:
00030 GridClientHttpCommandExecutor(boost::shared_ptr<GridClientConnectionPool>& connectionPool) :
00031 connPool(connectionPool) { }
00032
00040 virtual void executeLogCmd(const GridClientSocketAddress& nodeHost,
00041 GridLogRequestCommand& logRequest, GridClientMessageLogResult& result);
00042
00050 virtual void executeTopologyCmd(const GridClientSocketAddress& nodeHost,
00051 GridTopologyRequestCommand& topologyRequest, GridClientMessageTopologyResult& result);
00052
00060 virtual void executeGetCacheCmd(const GridClientSocketAddress& nodeHost,
00061 GridCacheRequestCommand& cacheCmd, GridClientMessageCacheGetResult& result);
00062
00070 virtual void executeModifyCacheCmd(const GridClientSocketAddress& nodeHost,
00071 GridCacheRequestCommand& cacheCmd, GridClientMessageCacheModifyResult& result);
00072
00080 virtual void executeGetCacheMetricsCmd(const GridClientSocketAddress& nodeHost,
00081 GridCacheRequestCommand& cacheCmd, GridClientMessageCacheMetricResult& result);
00082
00090 virtual void executeTaskCmd(const GridClientSocketAddress& nodeHost, GridTaskRequestCommand& taskCmd,
00091 GridClientMessageTaskResult& result);
00092
00097 virtual void stop();
00098
00099 private:
00107 void sendPacket (const GridClientSocketAddress& host, const TRequestParams& msg,
00108 TJson& respMsg);
00109
00117 template <class C, class R> void executeCmd(const GridClientSocketAddress& nodeHost, C& cmd, R& response);
00118
00120 boost::shared_ptr<GridClientConnectionPool> connPool;
00121
00123 mutable boost::mutex mux;
00124 };
00125
00126 #endif