Qpid Proton C++  0.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
connection_options.hpp
1 #ifndef PROTON_CPP_CONNECTION_OPTIONS_H
2 #define PROTON_CPP_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 "proton/config.hpp"
26 #include "proton/export.hpp"
27 #include "proton/pn_unique_ptr.hpp"
28 #include "proton/reconnect_timer.hpp"
29 #include "proton/types.hpp"
30 
31 #include <vector>
32 #include <string>
33 
34 namespace proton {
35 
36 class proton_handler;
37 class connection;
38 
61  public:
63  PN_CPP_EXTERN connection_options();
64 
66  PN_CPP_EXTERN connection_options(const connection_options&);
67 
68  PN_CPP_EXTERN ~connection_options();
69 
71  PN_CPP_EXTERN connection_options& operator=(const connection_options&);
72 
74  PN_CPP_EXTERN void override(const connection_options& other);
75 
77  PN_CPP_EXTERN connection_options& handler(class handler *);
78 
80  PN_CPP_EXTERN connection_options& max_frame_size(uint32_t max);
81 
83  PN_CPP_EXTERN connection_options& max_channels(uint16_t max);
84 
86  PN_CPP_EXTERN connection_options& idle_timeout(duration);
87 
90  PN_CPP_EXTERN connection_options& heartbeat(duration);
92 
94  PN_CPP_EXTERN connection_options& container_id(const std::string &id);
95 
97 
99  PN_CPP_EXTERN connection_options& link_prefix(const std::string &id);
100 
102  PN_CPP_EXTERN connection_options& reconnect(const reconnect_timer &);
103 
105 
107  PN_CPP_EXTERN connection_options& ssl_client_options(const class ssl_client_options &);
108 
110  PN_CPP_EXTERN connection_options& ssl_server_options(const class ssl_server_options &);
111 
113 
115  PN_CPP_EXTERN connection_options& peer_hostname(const std::string &name);
116 
118  PN_CPP_EXTERN connection_options& resume_id(const std::string &id);
119 
121 
123  PN_CPP_EXTERN connection_options& sasl_enabled(bool);
124 
127  PN_CPP_EXTERN connection_options& allow_insecure_mechs(bool);
128  PN_CPP_EXTERN connection_options& allowed_mechs(const std::string &);
130 
132  PN_CPP_EXTERN connection_options& sasl_config_name(const std::string &);
133 
135  PN_CPP_EXTERN connection_options& sasl_config_path(const std::string &);
136 
137  private:
138  void apply(connection&) const;
139  proton_handler* handler() const;
140  static pn_connection_t *pn_connection(connection &);
141  class ssl_client_options &ssl_client_options();
142  class ssl_server_options &ssl_server_options();
143 
144  class impl;
145  pn_unique_ptr<impl> impl_;
146 
148  friend class container_impl;
149  friend class connector;
150  friend class connection_engine;
152 };
153 
154 }
155 
156 #endif // PROTON_CPP_CONNECTION_OPTIONS_H
SSL configuration for inbound connections.
Definition: ssl.hpp:134
connection_options & max_channels(uint16_t max)
Set the maximum channels.
An interface for connection-oriented IO integration.
Definition: connection_engine.hpp:64
A span of time in milliseconds.
Definition: duration.hpp:32
connection_options & sasl_config_path(const std::string &)
Set the SASL configuration path.
Defines C++ types representing AMQP types.
A connection to a remote AMQP peer.
Definition: connection.hpp:42
Options for creating a connection.
Definition: connection_options.hpp:60
connection_options()
Create an empty set of options.
SSL configuration for outbound connections.
Definition: ssl.hpp:161
connection_options & sasl_enabled(bool)
Enable or disable SASL.
Callback functions for handling proton events.
Definition: handler.hpp:40
connection_options & idle_timeout(duration)
Set the idle timeout.
connection_options & operator=(const connection_options &)
Copy options.
connection_options & max_frame_size(uint32_t max)
Set the maximum frame size.
connection_options & container_id(const std::string &id)
Set the container ID.
connection_options & sasl_config_name(const std::string &)
Set the SASL configuration name.