00001 #ifndef PROTON_CONNECTION_OPTIONS_H
00002 #define PROTON_CONNECTION_OPTIONS_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "./internal/config.hpp"
00026 #include "./internal/export.hpp"
00027 #include "./duration.hpp"
00028 #include "./internal/pn_unique_ptr.hpp"
00029 #include "./reconnect_timer.hpp"
00030 #include "./types_fwd.hpp"
00031
00032 #include <vector>
00033 #include <string>
00034
00035 struct pn_connection_t;
00036
00037 namespace proton {
00038
00039 class proton_handler;
00040 class connection;
00041
00042 namespace io {
00043 class connection_engine;
00044 }
00045
00067 class connection_options {
00068 public:
00070 PN_CPP_EXTERN connection_options();
00071
00073 PN_CPP_EXTERN connection_options(class messaging_handler& h);
00074
00076 PN_CPP_EXTERN connection_options(const connection_options&);
00077
00078 PN_CPP_EXTERN ~connection_options();
00079
00081 PN_CPP_EXTERN connection_options& operator=(const connection_options&);
00082
00083
00084
00088 PN_CPP_EXTERN connection_options& handler(class messaging_handler&);
00089
00091 PN_CPP_EXTERN connection_options& max_frame_size(uint32_t max);
00092
00094 PN_CPP_EXTERN connection_options& max_sessions(uint16_t max);
00095
00096
00098 PN_CPP_EXTERN connection_options& idle_timeout(duration);
00099
00101 PN_CPP_EXTERN connection_options& container_id(const std::string &id);
00102
00109 PN_CPP_EXTERN connection_options& virtual_host(const std::string &name);
00110
00117 PN_CPP_EXTERN connection_options& user(const std::string& user);
00118
00120 PN_CPP_EXTERN connection_options& password(const std::string& pass);
00121
00123
00124
00126 PN_CPP_EXTERN connection_options& reconnect(const reconnect_timer &);
00128
00130 PN_CPP_EXTERN connection_options& ssl_client_options(const class ssl_client_options &);
00131
00133 PN_CPP_EXTERN connection_options& ssl_server_options(const class ssl_server_options &);
00134
00136 PN_CPP_EXTERN connection_options& sasl_enabled(bool);
00137
00141 PN_CPP_EXTERN connection_options& sasl_allow_insecure_mechs(bool);
00142
00144 PN_CPP_EXTERN connection_options& sasl_allowed_mechs(const std::string &);
00145
00147 PN_CPP_EXTERN connection_options& sasl_config_name(const std::string &);
00148
00150 PN_CPP_EXTERN connection_options& sasl_config_path(const std::string &);
00151
00153 PN_CPP_EXTERN connection_options& update(const connection_options& other);
00154
00155 private:
00156 void apply_unbound(connection&) const;
00157 void apply_bound(connection&) const;
00158 messaging_handler* handler() const;
00159
00160 class impl;
00161 internal::pn_unique_ptr<impl> impl_;
00162
00164 friend class container_impl;
00165 friend class connector;
00166 friend class io::connection_engine;
00167 friend class connection;
00169 };
00170
00171 }
00172
00173 #endif // PROTON_CONNECTION_OPTIONS_H