Loading...
Searching...
No Matches
connection.hpp
Go to the documentation of this file.
#ifndef PROTON_CONNECTION_HPP
#define PROTON_CONNECTION_HPP
/*
*
* 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 "./fwd.hpp"
#include "./internal/export.hpp"
#include "./internal/object.hpp"
#include "./endpoint.hpp"
#include "./session.hpp"
#include "./symbol.hpp"
#include "./value.hpp"
#include <proton/type_compat.h>
#include <map>
#include <string>
struct pn_connection_t;
namespace proton {
class
PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>, public endpoint {
PN_CPP_EXTERN connection(pn_connection_t* c) : internal::object<pn_connection_t>(c) {}
public:
connection() : internal::object<pn_connection_t>(0) {}
PN_CPP_EXTERN ~connection();
PN_CPP_EXTERN bool uninitialized() const;
PN_CPP_EXTERN bool active() const;
PN_CPP_EXTERN bool closed() const;
PN_CPP_EXTERN class error_condition error() const;
PN_CPP_EXTERN class container& container() const;
PN_CPP_EXTERN class work_queue& work_queue() const;
PN_CPP_EXTERN class transport transport() const;
PN_CPP_EXTERN std::string virtual_host() const;
PN_CPP_EXTERN std::string container_id() const;
PN_CPP_EXTERN std::string user() const;
PN_CPP_EXTERN void open();
PN_CPP_EXTERN void open(const connection_options&);
PN_CPP_EXTERN void close();
PN_CPP_EXTERN void close(const error_condition&);
PN_CPP_EXTERN session open_session();
PN_CPP_EXTERN session open_session(const session_options&);
PN_CPP_EXTERN session default_session();
PN_CPP_EXTERN sender open_sender(const std::string& addr);
PN_CPP_EXTERN sender open_sender(const std::string& addr, const sender_options&);
PN_CPP_EXTERN receiver open_receiver(const std::string& addr);
PN_CPP_EXTERN receiver open_receiver(const std::string& addr,
const receiver_options&);
PN_CPP_EXTERN class sender_options sender_options() const;
PN_CPP_EXTERN class receiver_options receiver_options() const;
PN_CPP_EXTERN session_range sessions() const;
PN_CPP_EXTERN receiver_range receivers() const;
PN_CPP_EXTERN sender_range senders() const;
PN_CPP_EXTERN uint32_t max_frame_size() const;
PN_CPP_EXTERN uint16_t max_sessions() const;
PN_CPP_EXTERN std::vector<symbol> offered_capabilities() const;
PN_CPP_EXTERN std::vector<symbol> desired_capabilities() const;
PN_CPP_EXTERN std::map<symbol, value> properties() const;
PN_CPP_EXTERN uint32_t idle_timeout() const;
PN_CPP_EXTERN void wake() const;
PN_CPP_EXTERN bool reconnected() const;
PN_CPP_EXTERN void update_options(const connection_options&);
friend class internal::factory<connection>;
friend class container;
};
} // proton
#endif // PROTON_CONNECTION_HPP
proton::connection_options
Options for creating a connection.
Definition connection_options.hpp:67
proton::connection
A connection to a remote AMQP peer.
Definition connection.hpp:47
proton::connection::max_sessions
uint16_t max_sessions() const
Get the maximum number of open sessions allowed by the remote peer.
proton::connection::error
class error_condition error() const
Get the error condition of the remote endpoint.
proton::connection::receiver_options
class receiver_options receiver_options() const
proton::connection::default_session
session default_session()
Get the default session.
proton::connection::senders
sender_range senders() const
Return all senders on this connection.
proton::connection::open_session
session open_session()
Open a new session.
proton::connection::wake
void wake() const
Unsettled API - Trigger an event from another thread.
proton::connection::max_frame_size
uint32_t max_frame_size() const
Get the maximum frame size allowed by the remote peer.
proton::connection::sessions
session_range sessions() const
Return all sessions on this connection.
proton::connection::transport
class transport transport() const
Get the transport for the connection.
proton::connection::virtual_host
std::string virtual_host() const
Return the remote AMQP hostname attribute for the connection.
proton::connection::close
void close()
Close the connection.
proton::connection::receivers
receiver_range receivers() const
Return all receivers on this connection.
proton::connection::desired_capabilities
std::vector< symbol > desired_capabilities() const
Unsettled API - Extension capabilities desired by the remote peer.
proton::connection::connection
connection()
Create an empty connection.
Definition connection.hpp:54
proton::connection::close
void close(const error_condition &)
Close the connection.
proton::connection::offered_capabilities
std::vector< symbol > offered_capabilities() const
Unsettled API - Extension capabilities offered by the remote peer.
proton::connection::open
void open(const connection_options &)
Open the connection.
proton::connection::user
std::string user() const
Return authenticated user for the connection Note: The value returned is not stable until the on_tran...
proton::connection::idle_timeout
uint32_t idle_timeout() const
Get the idle timeout set by the remote peer.
proton::connection::reconnected
bool reconnected() const
Unsettled API - True if this connection has been automatically re-connected.
proton::connection::work_queue
class work_queue & work_queue() const
Get the work_queue for the connection.
proton::connection::open
void open()
Open the connection.
proton::connection::update_options
void update_options(const connection_options &)
Unsettled API - Update the connection options for this connection
proton::connection::open_receiver
receiver open_receiver(const std::string &addr)
Open a receiver for addr on default_session().
proton::connection::uninitialized
bool uninitialized() const
True if the local end is uninitialized.
proton::connection::container
class container & container() const
Get the container.
proton::connection::open_receiver
receiver open_receiver(const std::string &addr, const receiver_options &)
Open a receiver for addr on default_session().
proton::connection::container_id
std::string container_id() const
Return the remote container ID for the connection.
proton::connection::active
bool active() const
True if the local end is active.
proton::connection::open_sender
sender open_sender(const std::string &addr, const sender_options &)
Open a sender for addr on default_session().
proton::connection::properties
std::map< symbol, value > properties() const
Unsettled API - Connection properties
proton::connection::closed
bool closed() const
True if the local and remote ends are closed.
proton::connection::sender_options
class sender_options sender_options() const
proton::connection::open_sender
sender open_sender(const std::string &addr)
Open a sender for addr on default_session().
proton::connection::open_session
session open_session(const session_options &)
Open a new session.
proton::endpoint
The base class for session, connection, and link.
Definition endpoint.hpp:36
proton::error_condition
Describes an endpoint error state.
Definition error_condition.hpp:39
proton::receiver
A channel for receiving messages.
Definition receiver.hpp:41
proton::sender
A channel for sending messages.
Definition sender.hpp:40
proton::session_options
Options for creating a session.
Definition session_options.hpp:41
proton::session
A container of senders and receivers.
Definition session.hpp:42
endpoint.hpp
The base class for session, connection, and link.
fwd.hpp
Forward declarations.
proton
The main Proton namespace.
Definition annotation_key.hpp:33
session.hpp
A container of senders and receivers.
symbol.hpp
A string that represents the AMQP symbol type.
value.hpp
A holder for any AMQP value, simple or complex.