proton/connection_options.hpp

Go to the documentation of this file.
00001 #ifndef PROTON_CONNECTION_OPTIONS_H
00002 #define PROTON_CONNECTION_OPTIONS_H
00003 
00004 /*
00005  *
00006  * Licensed to the Apache Software Foundation (ASF) under one
00007  * or more contributor license agreements.  See the NOTICE file
00008  * distributed with this work for additional information
00009  * regarding copyright ownership.  The ASF licenses this file
00010  * to you under the Apache License, Version 2.0 (the
00011  * "License"); you may not use this file except in compliance
00012  * with the License.  You may obtain a copy of the License at
00013  *
00014  *   http://www.apache.org/licenses/LICENSE-2.0
00015  *
00016  * Unless required by applicable law or agreed to in writing,
00017  * software distributed under the License is distributed on an
00018  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00019  * KIND, either express or implied.  See the License for the
00020  * specific language governing permissions and limitations
00021  * under the License.
00022  *
00023  */
00024 
00025 #include "./duration.hpp"
00026 #include "./fwd.hpp"
00027 #include "./internal/config.hpp"
00028 #include "./internal/export.hpp"
00029 #include "./internal/pn_unique_ptr.hpp"
00030 #include "./symbol.hpp"
00031 #include "./types_fwd.hpp"
00032 
00033 #include <proton/type_compat.h>
00034 
00035 #include <vector>
00036 #include <string>
00037 
00040 
00041 struct pn_connection_t;
00042 struct pn_transport_t;
00043 
00044 namespace proton {
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     // XXX add C++11 move operations - Still relevant, and applies to all options
00084 
00089     PN_CPP_EXTERN connection_options& handler(class messaging_handler&);
00090 
00092     PN_CPP_EXTERN connection_options& max_frame_size(uint32_t max);
00093 
00095     PN_CPP_EXTERN connection_options& max_sessions(uint16_t max);
00096 
00103     PN_CPP_EXTERN connection_options& idle_timeout(duration);
00104 
00106     PN_CPP_EXTERN connection_options& container_id(const std::string& id);
00107 
00114     PN_CPP_EXTERN connection_options& virtual_host(const std::string& name);
00115 
00124     PN_CPP_EXTERN connection_options& user(const std::string&);
00125 
00130     PN_CPP_EXTERN connection_options& password(const std::string&);
00131 
00133     PN_CPP_EXTERN connection_options& ssl_client_options(const class ssl_client_options&);
00134 
00136     PN_CPP_EXTERN connection_options& ssl_server_options(const class ssl_server_options&);
00137 
00139     PN_CPP_EXTERN connection_options& sasl_enabled(bool);
00140 
00144     PN_CPP_EXTERN connection_options& sasl_allow_insecure_mechs(bool);
00145 
00157     PN_CPP_EXTERN connection_options& sasl_allowed_mechs(const std::string&);
00158 
00160     PN_CPP_EXTERN connection_options& offered_capabilities(const std::vector<symbol>&);
00161 
00163     PN_CPP_EXTERN connection_options& desired_capabilities(const std::vector<symbol>&);
00164 
00166     PN_CPP_EXTERN connection_options& sasl_config_name(const std::string&);
00167 
00169     PN_CPP_EXTERN connection_options& sasl_config_path(const std::string&);
00170 
00175     PN_CPP_EXTERN connection_options& reconnect(const reconnect_options&);
00176 
00190     PN_CPP_EXTERN connection_options& reconnect_url(const std::string&);
00191 
00198     PN_CPP_EXTERN connection_options& failover_urls(const std::vector<std::string>&);
00199 
00201     PN_CPP_EXTERN connection_options& update(const connection_options& other);
00202 
00203   private:
00204     void apply_unbound(connection&) const;
00205     void apply_reconnect_urls(pn_connection_t* pnc) const;
00206     void apply_unbound_client(pn_transport_t*) const;
00207     void apply_unbound_server(pn_transport_t*) const;
00208     messaging_handler* handler() const;
00209 
00210     class impl;
00211     internal::pn_unique_ptr<impl> impl_;
00212 
00214   friend class container;
00215   friend class io::connection_driver;
00216   friend class connection;
00218 };
00219 
00220 } // proton
00221 
00222 #endif // PROTON_CONNECTION_OPTIONS_H

Generated on 1 Jun 2020 for Qpid Proton C++ by  doxygen 1.6.1