00001 /* Copyright (C) GridGain Systems. All Rights Reserved. */ 00002 00003 /* _________ _____ __________________ _____ 00004 * __ ____/___________(_)______ /__ ____/______ ____(_)_______ 00005 * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \ 00006 * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / / 00007 * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/ 00008 */ 00009 00010 #ifndef GRID_CLIENT_HTTP_CONNECTION_HPP_INCLUDED 00011 #define GRID_CLIENT_HTTP_CONNECTION_HPP_INCLUDED 00012 00013 #include <string> 00014 #include <map> 00015 00016 #include <boost/asio.hpp> 00017 #include <boost/property_tree/ptree.hpp> 00018 00019 #include "gridgain/impl/connection/gridclientconnection.hpp" 00020 00022 typedef std::map<std::string, std::string> TRequestParams; 00023 00027 class GridClientHttpConnection: public GridClientConnection { 00028 public: 00033 GridClientHttpConnection() {} 00034 00040 GridClientHttpConnection(boost::shared_ptr<boost::asio::ssl::context>& ctx) 00041 : GridClientConnection(ctx) {} 00042 00044 virtual ~GridClientHttpConnection() {} 00045 00052 virtual void connect(const std::string& host, int port); 00053 00060 virtual void authenticate(std::string clientId, std::string creds); 00061 00067 virtual void sessionToken(std::string sessTok) { 00068 sessToken = sessTok; 00069 } 00070 00076 virtual std::string sessionToken() { 00077 return sessToken; 00078 } 00079 00086 virtual void send(TRequestParams request, boost::property_tree::ptree& jsonObj); 00087 00092 virtual void sendPing() {} 00093 }; 00094 00095 #endif
1.7.1