/usr/share/cruisecontrol-bin-2.6.1/projects/qpid-trunk/cpp/src/qpid/client/Connection.h

00001 #ifndef _client_Connection_
00002 #define _client_Connection_
00003 
00004 /*
00005  *
00006  * Licensed to the Apache Software Foundation (ASF) under one
00007  * or more contributor license agreements.  See the NOTICE file
00008  * distributed with this work for additional information
00009  * regarding copyright ownership.  The ASF licenses this file
00010  * to you under the Apache License, Version 2.0 (the
00011  * "License"); you may not use this file except in compliance
00012  * with the License.  You may obtain a copy of the License at
00013  * 
00014  *   http://www.apache.org/licenses/LICENSE-2.0
00015  * 
00016  * Unless required by applicable law or agreed to in writing,
00017  * software distributed under the License is distributed on an
00018  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00019  * KIND, either express or implied.  See the License for the
00020  * specific language governing permissions and limitations
00021  * under the License.
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 
00053 class Connection
00054 {
00055     framing::ChannelId channelIdCounter;
00056     framing::ProtocolVersion version;
00057     const uint32_t max_frame_size;
00058     bool isOpen;
00059     bool debug;
00060 
00061   protected:
00062     boost::shared_ptr<ConnectionImpl> impl;
00063 
00064   public:
00078     Connection(bool debug = false, uint32_t max_frame_size = 65535,
00079                framing::ProtocolVersion=framing::highestProtocolVersion);
00080     Connection(boost::shared_ptr<Connector>);
00081     ~Connection();
00082 
00100     void open(const std::string& host, int port = 5672, 
00101               const std::string& uid = "guest",
00102               const std::string& pwd = "guest", 
00103               const std::string& virtualhost = "/");
00104 
00111     void close();
00112 
00123     void openChannel(Channel&);
00124 
00137     Session newSession(SynchronousMode sync, uint32_t detachedLifetime=0);
00138 
00143     void resume(Session& session);
00144 };
00145 
00146 }} // namespace qpid::client
00147 
00148 
00149 #endif

Generated on Thu Apr 10 11:08:17 2008 for Qpid by  doxygen 1.4.7