Loading...
Searching...
No Matches
connection_options.hpp
Go to the documentation of this file.
#ifndef PROTON_CONNECTION_OPTIONS_H
#define PROTON_CONNECTION_OPTIONS_H
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
#include "./duration.hpp"
#include "./fwd.hpp"
#include "./internal/export.hpp"
#include "./symbol.hpp"
#include "./types_fwd.hpp"
#include <proton/type_compat.h>
#include <map>
#include <memory>
#include <vector>
#include <string>
struct pn_connection_t;
struct pn_transport_t;
namespace proton {
class connection_options {
public:
PN_CPP_EXTERN connection_options();
PN_CPP_EXTERN connection_options(class messaging_handler& h);
PN_CPP_EXTERN connection_options(const connection_options&);
PN_CPP_EXTERN ~connection_options();
PN_CPP_EXTERN connection_options& operator=(const connection_options&);
// XXX add C++11 move operations - Still relevant, and applies to all options
PN_CPP_EXTERN connection_options& handler(class messaging_handler&);
PN_CPP_EXTERN connection_options& max_frame_size(uint32_t max);
PN_CPP_EXTERN connection_options& max_sessions(uint16_t max);
PN_CPP_EXTERN connection_options& idle_timeout(duration);
PN_CPP_EXTERN connection_options& container_id(const std::string& id);
PN_CPP_EXTERN connection_options& virtual_host(const std::string& name);
PN_CPP_EXTERN connection_options& user(const std::string&);
PN_CPP_EXTERN connection_options& password(const std::string&);
PN_CPP_EXTERN connection_options& ssl_client_options(const class ssl_client_options&);
PN_CPP_EXTERN connection_options& ssl_server_options(const class ssl_server_options&);
PN_CPP_EXTERN connection_options& sasl_enabled(bool);
PN_CPP_EXTERN connection_options& sasl_allow_insecure_mechs(bool);
PN_CPP_EXTERN connection_options& sasl_allowed_mechs(const std::string&);
PN_CPP_EXTERN connection_options& offered_capabilities(const std::vector<symbol>&);
PN_CPP_EXTERN connection_options& desired_capabilities(const std::vector<symbol>&);
PN_CPP_EXTERN connection_options& properties(const std::map<symbol, value>&);
PN_CPP_EXTERN connection_options& sasl_config_name(const std::string&);
PN_CPP_EXTERN connection_options& sasl_config_path(const std::string&);
PN_CPP_EXTERN connection_options& reconnect(const reconnect_options&);
PN_CPP_EXTERN connection_options& reconnect_url(const std::string&);
PN_CPP_EXTERN connection_options& failover_urls(const std::vector<std::string>&);
PN_CPP_EXTERN connection_options& update(const connection_options& other);
private:
void apply_unbound(connection&) const;
void apply_reconnect_urls(pn_connection_t* pnc) const;
void apply_unbound_client(pn_transport_t*) const;
void apply_unbound_server(pn_transport_t*) const;
messaging_handler* handler() const;
class impl;
std::unique_ptr<impl> impl_;
friend class container;
friend class io::connection_driver;
friend class connection;
};
} // proton
#endif // PROTON_CONNECTION_OPTIONS_H
proton::connection_options
Options for creating a connection.
Definition connection_options.hpp:67
proton::connection_options::container_id
connection_options & container_id(const std::string &id)
Set the container ID.
proton::connection_options::desired_capabilities
connection_options & desired_capabilities(const std::vector< symbol > &)
Unsettled API - Extension capabilities desired from the remote peer.
proton::connection_options::ssl_client_options
connection_options & ssl_client_options(const class ssl_client_options &)
Set SSL client options.
proton::connection_options::ssl_server_options
connection_options & ssl_server_options(const class ssl_server_options &)
Set SSL server options.
proton::connection_options::password
connection_options & password(const std::string &)
Set the password used to authenticate the connection.
proton::connection_options::sasl_allow_insecure_mechs
connection_options & sasl_allow_insecure_mechs(bool)
Force the enabling of SASL mechanisms that disclose cleartext passwords over the connection.
proton::connection_options::max_sessions
connection_options & max_sessions(uint16_t max)
Set the maximum number of open sessions. The default is 32767.
proton::connection_options::sasl_config_name
connection_options & sasl_config_name(const std::string &)
Unsettled API - Set the SASL configuration name.
proton::connection_options::max_frame_size
connection_options & max_frame_size(uint32_t max)
Set the maximum frame size. It is unlimited by default.
proton::connection_options::reconnect
connection_options & reconnect(const reconnect_options &)
Unsettled API - Set reconnect timing options.
proton::connection_options::sasl_allowed_mechs
connection_options & sasl_allowed_mechs(const std::string &)
Specify the SASL mechanisms allowed for this connection.
proton::connection_options::operator=
connection_options & operator=(const connection_options &)
Copy options.
proton::connection_options::handler
connection_options & handler(class messaging_handler &)
Set a connection handler.
proton::connection_options::sasl_config_path
connection_options & sasl_config_path(const std::string &)
Unsettled API - Set the SASL configuration path.
proton::connection_options::connection_options
connection_options()
Create an empty set of options.
proton::connection_options::connection_options
connection_options(class messaging_handler &h)
Shorthand for connection_options().handler(h).
proton::connection_options::update
connection_options & update(const connection_options &other)
Update option values from values set in other.
proton::connection_options::virtual_host
connection_options & virtual_host(const std::string &name)
Set the virtual host name for the connection.
proton::connection_options::connection_options
connection_options(const connection_options &)
Copy options.
proton::connection_options::properties
connection_options & properties(const std::map< symbol, value > &)
Unsettled API - Connection properties.
proton::connection_options::offered_capabilities
connection_options & offered_capabilities(const std::vector< symbol > &)
Unsettled API - Extension capabilities offered to the remote peer.
proton::connection_options::idle_timeout
connection_options & idle_timeout(duration)
Set the idle timeout.
proton::connection_options::user
connection_options & user(const std::string &)
Set the user name used to authenticate the connection.
proton::connection_options::failover_urls
connection_options & failover_urls(const std::vector< std::string > &)
Unsettled API - Set Fail-over URLs.
proton::connection_options::sasl_enabled
connection_options & sasl_enabled(bool)
Enable or disable SASL.
proton::connection_options::reconnect_url
connection_options & reconnect_url(const std::string &)
Unsettled API - Set reconnect URL.
proton::connection
A connection to a remote AMQP peer.
Definition connection.hpp:47
proton::container
A top-level container of connections, sessions, and links.
Definition container.hpp:49
proton::duration
A span of time in milliseconds.
Definition duration.hpp:39
proton::io::connection_driver
Unsettled API - An AMQP driver for a single connection.
Definition connection_driver.hpp:93
proton::map
A collection of key-value pairs.
Definition map.hpp:69
proton::messaging_handler
Handler for Proton messaging events.
Definition messaging_handler.hpp:69
proton::reconnect_options
Unsettled API - Options for reconnect and failover after connection loss.
Definition reconnect_options.hpp:49
proton::ssl_client_options
Unsettled API - SSL configuration for outbound connections.
Definition ssl.hpp:153
proton::ssl_server_options
Unsettled API - SSL configuration for inbound connections.
Definition ssl.hpp:123
duration.hpp
A span of time in milliseconds.
fwd.hpp
Forward declarations.
proton
The main Proton namespace.
Definition annotation_key.hpp:33
symbol.hpp
A string that represents the AMQP symbol type.
types_fwd.hpp
Forward declarations for Proton types used to represent AMQP types.