Qpid Proton C++ API  0.37.0
connection_options.hpp
Go to the documentation of this file.
1 #ifndef PROTON_CONNECTION_OPTIONS_H
2 #define PROTON_CONNECTION_OPTIONS_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 
25 #include "./duration.hpp"
26 #include "./fwd.hpp"
27 #include "./internal/export.hpp"
28 #include "./symbol.hpp"
29 #include "./types_fwd.hpp"
30 
31 #include <proton/type_compat.h>
32 
33 #include <map>
34 #include <memory>
35 #include <vector>
36 #include <string>
37 
40 
41 struct pn_connection_t;
42 struct pn_transport_t;
43 
44 namespace proton {
45 
68  public:
70  PN_CPP_EXTERN connection_options();
71 
73  PN_CPP_EXTERN connection_options(class messaging_handler& h);
74 
76  PN_CPP_EXTERN connection_options(const connection_options&);
77 
78  PN_CPP_EXTERN ~connection_options();
79 
82 
83  // XXX add C++11 move operations - Still relevant, and applies to all options
84 
90 
92  PN_CPP_EXTERN connection_options& max_frame_size(uint32_t max);
93 
95  PN_CPP_EXTERN connection_options& max_sessions(uint16_t max);
96 
104 
106  PN_CPP_EXTERN connection_options& container_id(const std::string& id);
107 
114  PN_CPP_EXTERN connection_options& virtual_host(const std::string& name);
115 
124  PN_CPP_EXTERN connection_options& user(const std::string&);
125 
130  PN_CPP_EXTERN connection_options& password(const std::string&);
131 
134 
137 
139  PN_CPP_EXTERN connection_options& sasl_enabled(bool);
140 
145 
157  PN_CPP_EXTERN connection_options& sasl_allowed_mechs(const std::string&);
158 
160  PN_CPP_EXTERN connection_options& offered_capabilities(const std::vector<symbol>&);
161 
163  PN_CPP_EXTERN connection_options& desired_capabilities(const std::vector<symbol>&);
164 
166  PN_CPP_EXTERN connection_options& properties(const std::map<symbol, value>&);
167 
169  PN_CPP_EXTERN connection_options& sasl_config_name(const std::string&);
170 
172  PN_CPP_EXTERN connection_options& sasl_config_path(const std::string&);
173 
179 
193  PN_CPP_EXTERN connection_options& reconnect_url(const std::string&);
194 
208  PN_CPP_EXTERN connection_options& failover_urls(const std::vector<std::string>&);
209 
211  PN_CPP_EXTERN connection_options& update(const connection_options& other);
212 
213  private:
214  void apply_unbound(connection&) const;
215  void apply_reconnect_urls(pn_connection_t* pnc) const;
216  void apply_unbound_client(pn_transport_t*) const;
217  void apply_unbound_server(pn_transport_t*) const;
218  messaging_handler* handler() const;
219 
220  class impl;
221  std::unique_ptr<impl> impl_;
222 
224  friend class container;
225  friend class io::connection_driver;
226  friend class connection;
228 };
229 
230 } // proton
231 
232 #endif // PROTON_CONNECTION_OPTIONS_H
Options for creating a connection.
Definition: connection_options.hpp:67
connection_options & virtual_host(const std::string &name)
Set the virtual host name for the connection.
connection_options & sasl_config_path(const std::string &)
Unsettled API - Set the SASL configuration path.
connection_options & user(const std::string &)
Set the user name used to authenticate the connection.
connection_options & operator=(const connection_options &)
Copy options.
connection_options & desired_capabilities(const std::vector< symbol > &)
Unsettled API - Extension capabilities desired from the remote peer.
connection_options & container_id(const std::string &id)
Set the container ID.
connection_options & ssl_client_options(const class ssl_client_options &)
Set SSL client options.
connection_options & sasl_allowed_mechs(const std::string &)
Specify the SASL mechanisms allowed for this connection.
connection_options & ssl_server_options(const class ssl_server_options &)
Set SSL server options.
connection_options & update(const connection_options &other)
Update option values from values set in other.
connection_options & password(const std::string &)
Set the password used to authenticate the connection.
connection_options & handler(class messaging_handler &)
Set a connection handler.
connection_options & idle_timeout(duration)
Set the idle timeout.
connection_options()
Create an empty set of options.
connection_options(class messaging_handler &h)
Shorthand for connection_options().handler(h).
connection_options(const connection_options &)
Copy options.
connection_options & properties(const std::map< symbol, value > &)
Unsettled API - Connection properties.
connection_options & reconnect_url(const std::string &)
Unsettled API - Set reconnect URL.
connection_options & failover_urls(const std::vector< std::string > &)
Unsettled API - Set Fail-over URLs.
connection_options & reconnect(const reconnect_options &)
Unsettled API - Set reconnect timing options.
connection_options & max_frame_size(uint32_t max)
Set the maximum frame size. It is unlimited by default.
connection_options & sasl_config_name(const std::string &)
Unsettled API - Set the SASL configuration name.
connection_options & sasl_enabled(bool)
Enable or disable SASL.
connection_options & offered_capabilities(const std::vector< symbol > &)
Unsettled API - Extension capabilities offered to the remote peer.
connection_options & max_sessions(uint16_t max)
Set the maximum number of open sessions. The default is 32767.
connection_options & sasl_allow_insecure_mechs(bool)
Force the enabling of SASL mechanisms that disclose cleartext passwords over the connection.
A connection to a remote AMQP peer.
Definition: connection.hpp:47
A top-level container of connections, sessions, and links.
Definition: container.hpp:49
A span of time in milliseconds.
Definition: duration.hpp:39
Unsettled API - An AMQP driver for a single connection.
Definition: connection_driver.hpp:93
Handler for Proton messaging events.
Definition: messaging_handler.hpp:69
Unsettled API - Options for reconnect and failover after connection loss.
Definition: reconnect_options.hpp:49
Unsettled API - SSL configuration for outbound connections.
Definition: ssl.hpp:153
Unsettled API - SSL configuration for inbound connections.
Definition: ssl.hpp:123
A span of time in milliseconds.
Forward declarations.
The main Proton namespace.
Definition: annotation_key.hpp:33
A string that represents the AMQP symbol type.
Forward declarations for Proton types used to represent AMQP types.