00001 #ifndef _client_Connection_
00002 #define _client_Connection_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <map>
00025 #include <string>
00026 #include "qpid/client/Session.h"
00027
00028 namespace qpid {
00029 namespace client {
00030
00031 class ConnectionSettings;
00032
00040 class Connection
00041 {
00042 framing::ChannelId channelIdCounter;
00043 framing::ProtocolVersion version;
00044 uint16_t max_frame_size;
00045
00046 protected:
00047 boost::shared_ptr<ConnectionImpl> impl;
00048
00049 public:
00054 Connection();
00055 ~Connection();
00056
00074 void open(const std::string& host, int port = 5672,
00075 const std::string& uid = "guest",
00076 const std::string& pwd = "guest",
00077 const std::string& virtualhost = "/", uint16_t maxFrameSize=65535);
00078
00084 void open(const ConnectionSettings& settings);
00085
00092 void close();
00093
00135 Session newSession(const std::string& name=std::string());
00136
00141 void resume(Session& session);
00142
00143 bool isOpen() const;
00144 };
00145
00146 }}
00147
00148
00149 #endif