Qpid Proton C++  0.14.0
connection_options.hpp
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 "./internal/config.hpp"
26 #include "./internal/export.hpp"
27 #include "./duration.hpp"
28 #include "./internal/pn_unique_ptr.hpp"
29 #include "./reconnect_timer.hpp"
30 #include "./types_fwd.hpp"
31 
32 #include <vector>
33 #include <string>
34 
35 struct pn_connection_t;
36 
37 namespace proton {
38 
39 class proton_handler;
40 class connection;
41 
42 namespace io {
43 class connection_engine;
44 }
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 
81  PN_CPP_EXTERN connection_options& operator=(const connection_options&);
82 
83  // XXX add C++11 move operations - Still relevant, and applies to all options
84 
88  PN_CPP_EXTERN connection_options& handler(class messaging_handler&);
89 
91  PN_CPP_EXTERN connection_options& max_frame_size(uint32_t max);
92 
94  PN_CPP_EXTERN connection_options& max_sessions(uint16_t max);
95 
96  // XXX document relationship to heartbeat interval
98  PN_CPP_EXTERN connection_options& idle_timeout(duration);
99 
101  PN_CPP_EXTERN connection_options& container_id(const std::string &id);
102 
109  PN_CPP_EXTERN connection_options& virtual_host(const std::string &name);
110 
117  PN_CPP_EXTERN connection_options& user(const std::string& user);
118 
120  PN_CPP_EXTERN connection_options& password(const std::string& pass);
121 
123  // XXX settle questions about reconnect_timer - consider simply
124  // reconnect_options and making reconnect_timer internal
126  PN_CPP_EXTERN connection_options& reconnect(const reconnect_timer &);
128 
130  PN_CPP_EXTERN connection_options& ssl_client_options(const class ssl_client_options &);
131 
133  PN_CPP_EXTERN connection_options& ssl_server_options(const class ssl_server_options &);
134 
136  PN_CPP_EXTERN connection_options& sasl_enabled(bool);
137 
141  PN_CPP_EXTERN connection_options& sasl_allow_insecure_mechs(bool);
142 
144  PN_CPP_EXTERN connection_options& sasl_allowed_mechs(const std::string &);
145 
147  PN_CPP_EXTERN connection_options& sasl_config_name(const std::string &);
148 
150  PN_CPP_EXTERN connection_options& sasl_config_path(const std::string &);
151 
153  PN_CPP_EXTERN connection_options& update(const connection_options& other);
154 
155  private:
156  void apply_unbound(connection&) const;
157  void apply_bound(connection&) const;
158  messaging_handler* handler() const;
159 
160  class impl;
161  internal::pn_unique_ptr<impl> impl_;
162 
164  friend class container_impl;
165  friend class connector;
166  friend class io::connection_engine;
167  friend class connection;
169 };
170 
171 } // proton
172 
173 #endif // PROTON_CONNECTION_OPTIONS_H
Experimental - SSL configuration for inbound connections.
Definition: ssl.hpp:144
A span of time in milliseconds.
Definition: duration.hpp:34
A connection to a remote AMQP peer.
Definition: connection.hpp:48
Options for creating a connection.
Definition: connection_options.hpp:67
Experimental - SSL configuration for outbound connections.
Definition: ssl.hpp:171
Forward declarations for all the C++ types used by Proton to represent AMQP types.
Experimental - An AMQP protocol engine for a single connection.
Definition: connection_engine.hpp:98
A handler for Proton messaging events.
Definition: messaging_handler.hpp:74
Type traits for mapping between AMQP and C++ types.
Definition: annotation_key.hpp:28