00001 #ifndef PROTON_CONNECTION_HPP
00002 #define PROTON_CONNECTION_HPP
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/export.hpp"
00026 #include "./endpoint.hpp"
00027 #include "./internal/object.hpp"
00028 #include "./session.hpp"
00029
00030 #include <proton/types.h>
00031
00032 #include <string>
00033
00034 struct pn_connection_t;
00035
00036 namespace proton {
00037
00038 class messaging_handler;
00039 class connection_options;
00040 class sender;
00041 class sender_options;
00042 class receiver;
00043 class receiver_options;
00044 class container;
00045 template <class T> class thread_safe;
00046
00048 class
00049 PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>, public endpoint {
00051 PN_CPP_EXTERN connection(pn_connection_t* c) : internal::object<pn_connection_t>(c) {}
00053
00054 public:
00056 connection() : internal::object<pn_connection_t>(0) {}
00057
00058 PN_CPP_EXTERN bool uninitialized() const;
00059 PN_CPP_EXTERN bool active() const;
00060 PN_CPP_EXTERN bool closed() const;
00061
00062 PN_CPP_EXTERN class error_condition error() const;
00063
00068 PN_CPP_EXTERN class container &container() const;
00069
00071 PN_CPP_EXTERN class transport transport() const;
00072
00074 PN_CPP_EXTERN std::string virtual_host() const;
00075
00077 PN_CPP_EXTERN std::string container_id() const;
00078
00081 PN_CPP_EXTERN std::string user() const;
00082
00086 PN_CPP_EXTERN void open();
00087
00089 PN_CPP_EXTERN void open(const connection_options &);
00090
00091 PN_CPP_EXTERN void close();
00092 PN_CPP_EXTERN void close(const error_condition&);
00093
00095 PN_CPP_EXTERN session open_session();
00096
00098 PN_CPP_EXTERN session open_session(const session_options &);
00099
00102 PN_CPP_EXTERN session default_session();
00103
00105 PN_CPP_EXTERN sender open_sender(const std::string &addr);
00106
00108 PN_CPP_EXTERN sender open_sender(const std::string &addr, const sender_options &);
00109
00111 PN_CPP_EXTERN receiver open_receiver(const std::string &addr);
00112
00114 PN_CPP_EXTERN receiver open_receiver(const std::string &addr,
00115 const receiver_options &);
00116
00118 PN_CPP_EXTERN session_range sessions() const;
00119
00121 PN_CPP_EXTERN receiver_range receivers() const;
00122
00124 PN_CPP_EXTERN sender_range senders() const;
00125
00129 PN_CPP_EXTERN uint32_t max_frame_size() const;
00130
00134 PN_CPP_EXTERN uint16_t max_sessions() const;
00135
00139 PN_CPP_EXTERN uint32_t idle_timeout() const;
00140
00142 friend class internal::factory<connection>;
00143 friend class connector;
00144 friend class proton::thread_safe<connection>;
00146 };
00147
00148 }
00149
00150 #endif // PROTON_CONNECTION_HPP