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 #include "qpid/client/ClientImportExport.h"
00028 #include "qpid/client/ConnectionSettings.h"
00029 #include "qpid/framing/ProtocolVersion.h"
00030 
00031 #include "boost/function.hpp"
00032 
00033 namespace qpid {
00034 
00035 struct Url;
00036 
00037 namespace client {
00038 
00039 class ConnectionImpl;
00040 
00063 class QPID_CLIENT_CLASS_EXTERN Connection
00064 {
00065     framing::ProtocolVersion version;
00066 
00067     boost::function<void ()> failureCallback;
00068 
00069 
00070   protected:
00071     boost::shared_ptr<ConnectionImpl> impl;
00072 
00073 
00074   public:
00079     QPID_CLIENT_EXTERN Connection();
00080 
00085     QPID_CLIENT_EXTERN ~Connection();
00086 
00104     QPID_CLIENT_EXTERN void open(const std::string& host, int port = 5672,
00105               const std::string& uid = "guest",
00106               const std::string& pwd = "guest",
00107               const std::string& virtualhost = "/", uint16_t maxFrameSize=65535);
00108 
00126     QPID_CLIENT_EXTERN void open(const Url& url,
00127               const std::string& uid = "guest",
00128               const std::string& pwd = "guest",
00129               const std::string& virtualhost = "/", uint16_t maxFrameSize=65535);
00130 
00141     QPID_CLIENT_EXTERN void open(const Url& url, const ConnectionSettings& settings);
00142 
00148     QPID_CLIENT_EXTERN void open(const ConnectionSettings& settings);
00149 
00156     QPID_CLIENT_EXTERN void close();
00157 
00199     QPID_CLIENT_EXTERN Session newSession(const std::string& name=std::string(), uint32_t timeoutSeconds = 0);
00200 
00205     QPID_CLIENT_EXTERN void resume(Session& session);
00206 
00207     QPID_CLIENT_EXTERN bool isOpen() const;
00208 
00212     QPID_CLIENT_EXTERN std::vector<Url> getInitialBrokers();
00213 
00214     QPID_CLIENT_EXTERN void registerFailureCallback ( boost::function<void ()> fn );
00215 
00219     QPID_CLIENT_EXTERN const ConnectionSettings& getNegotiatedSettings();
00220 
00221   friend struct ConnectionAccess; 
00222   friend class SessionBase_0_10; 
00223 };
00224 
00225 }} // namespace qpid::client
00226 
00227 
00228 #endif  

Qpid C++ API Reference
Generated on Mon Aug 22 2011 for Qpid C++ Client API by doxygen 1.7.4