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 "Channel.h"
00027 #include "ConnectionImpl.h"
00028 #include "qpid/client/Session.h"
00029 #include "qpid/framing/AMQP_HighestVersion.h"
00030 #include "qpid/framing/Uuid.h"
00031
00032 namespace qpid {
00033
00040 namespace client {
00041
00042 class ConnectionSettings;
00054 class Connection
00055 {
00056 framing::ChannelId channelIdCounter;
00057 framing::ProtocolVersion version;
00058 uint16_t max_frame_size;
00059
00060 protected:
00061 boost::shared_ptr<ConnectionImpl> impl;
00062
00063 public:
00070 Connection(framing::ProtocolVersion=framing::highestProtocolVersion);
00071 ~Connection();
00072
00090 void open(const std::string& host, int port = 5672,
00091 const std::string& uid = "guest",
00092 const std::string& pwd = "guest",
00093 const std::string& virtualhost = "/", uint16_t maxFrameSize=65535);
00094
00100 void open(const ConnectionSettings& settings);
00101
00108 void close();
00109
00120 void openChannel(Channel&);
00121
00134 Session newSession(SynchronousMode sync, uint32_t detachedLifetime=0);
00135
00140 void resume(Session& session);
00141 };
00142
00143 }}
00144
00145
00146 #endif