Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
Connection.h
Go to the documentation of this file.
1 #ifndef QPID_CLIENT_CONNECTION_H
2 #define QPID_CLIENT_CONNECTION_H
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 #include <map>
25 #include <string>
26 #include "qpid/client/Session.h"
30 
31 #include "boost/function.hpp"
32 
33 namespace qpid {
34 
35 struct Url;
36 
37 namespace client {
38 
39 class ConnectionImpl;
40 
64 {
66 
67  boost::function<void ()> failureCallback;
68 
69 
70  protected:
71  boost::shared_ptr<ConnectionImpl> impl;
72 
73 
74  public:
80 
86 
104  QPID_CLIENT_EXTERN void open(const std::string& host, int port = 5672,
105  const std::string& uid = "",
106  const std::string& pwd = "",
107  const std::string& virtualhost = "/", uint16_t maxFrameSize=65535);
108 
126  QPID_CLIENT_EXTERN void open(const Url& url,
127  const std::string& uid = "",
128  const std::string& pwd = "",
129  const std::string& virtualhost = "/", uint16_t maxFrameSize=65535);
130 
141  QPID_CLIENT_EXTERN void open(const Url& url, const ConnectionSettings& settings);
142 
148  QPID_CLIENT_EXTERN void open(const ConnectionSettings& settings);
149 
156  QPID_CLIENT_EXTERN void close();
157 
199  QPID_CLIENT_EXTERN Session newSession(const std::string& name=std::string(), uint32_t timeoutSeconds = 0);
200 
205  QPID_CLIENT_EXTERN void resume(Session& session);
206 
207  QPID_CLIENT_EXTERN bool isOpen() const;
208 
212  QPID_CLIENT_EXTERN std::vector<Url> getInitialBrokers();
213 
214  QPID_CLIENT_EXTERN void registerFailureCallback ( boost::function<void ()> fn );
215 
219  QPID_CLIENT_EXTERN const ConnectionSettings& getNegotiatedSettings();
220 
221  friend struct ConnectionAccess;
222  friend class SessionBase_0_10;
223 };
224 
225 }} // namespace qpid::client
226 
227 
228 #endif
Base class for handles to an AMQP session.
#define QPID_CLIENT_CLASS_EXTERN
Represents a connection to an AMQP broker.
Definition: Connection.h:63
boost::shared_ptr< ConnectionImpl > impl
Definition: Connection.h:71
unsigned int uint32_t
Definition: IntegerTypes.h:27
AMQP 0-10 session API with keyword arguments.
Definition: Session_0_10.h:189
An AMQP URL contains a list of addresses.
Definition: Url.h:33
#define QPID_CLIENT_EXTERN
unsigned short uint16_t
Definition: IntegerTypes.h:25
Settings for a Connection.

Qpid C++ API Reference
Generated on Wed Aug 27 2014 for Qpid C++ Client API by doxygen 1.8.5