Apache Qpid C++ API
Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation

qpid/client/Connection.h

Go to the documentation of this file.
00001 #ifndef QPID_CLIENT_CONNECTION_H
00002 #define QPID_CLIENT_CONNECTION_H
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 "qpid/client/Session.h"
00027 
00028 namespace qpid {
00029 
00030 struct Url;
00031 
00032 namespace client {
00033 
00034 struct ConnectionSettings;
00035 class ConnectionImpl;
00036 
00045 class Connection
00046 {
00047     framing::ProtocolVersion version;
00048 
00049     boost::function<void ()> failureCallback;
00050 
00051 
00052   protected:
00053     boost::shared_ptr<ConnectionImpl> impl;
00054 
00055 
00056   public:
00061     Connection();
00062 
00063     ~Connection();
00064 
00082     void open(const std::string& host, int port = 5672, 
00083               const std::string& uid = "guest",
00084               const std::string& pwd = "guest", 
00085               const std::string& virtualhost = "/", uint16_t maxFrameSize=65535);
00086 
00104     void open(const Url& url,
00105               const std::string& uid = "guest",
00106               const std::string& pwd = "guest", 
00107               const std::string& virtualhost = "/", uint16_t maxFrameSize=65535);
00108 
00119     void open(const Url& url, const ConnectionSettings& settings);
00120 
00126     void open(const ConnectionSettings& settings);
00127 
00134     void close();
00135 
00177     Session newSession(const std::string& name=std::string(), uint32_t timeoutSeconds = 0);
00178 
00183     void resume(Session& session);
00184 
00185     bool isOpen() const;
00186 
00187     std::vector<Url> getKnownBrokers();
00188     void registerFailureCallback ( boost::function<void ()> fn );
00189 
00193     const ConnectionSettings& getNegotiatedSettings();
00194 
00195   friend class ConnectionAccess; 
00196   friend class SessionBase_0_10; 
00197 };
00198 
00199 }} // namespace qpid::client
00200 
00201 
00202 #endif  

Qpid C++ API Reference
Generated on Tue Dec 8 15:39:47 2009 for Qpid C++ Client API by doxygen 1.4.7