@@ -28,7 +28,7 @@ class Connection
2828
2929public:
3030 /* *
31- * Construct an AMQP object based on full login data
31+ * Construct an AMQP object based on authentication data
3232 *
3333 * The first parameter is a handler object. This handler class is
3434 * an interface that should be implemented by the caller.
@@ -37,35 +37,26 @@ class Connection
3737 * @param auth Authentication data
3838 * @param vhost Vhost to use
3939 */
40- Connection (ConnectionHandler *handler, std::shared_ptr<const Authentication> auth, const std::string &vhost) : _implementation(this , handler, std::move(auth), vhost) {}
41-
42- /* *
43- * Construct an AMQP object based on plain login data
44- *
45- * @param handler Connection handler
46- * @param login Login data
47- * @param vhost Vhost to use
48- */
49- Connection (ConnectionHandler *handler, const Login &login, const std::string &vhost) : _implementation(this , handler, std::make_shared<Login>(login), vhost) {}
40+ Connection (ConnectionHandler *handler, const Authentication &auth, const std::string &vhost) : _implementation(this , handler, auth, vhost) {}
5041
5142 /* *
5243 * Construct with default vhost
5344 * @param handler Connection handler
54- * @param login Login data
45+ * @param auth Authentication data
5546 */
56- Connection (ConnectionHandler *handler, const Login &login ) : _implementation(this , handler, std::make_shared<Login>(login) , " /" ) {}
47+ Connection (ConnectionHandler *handler, const Authentication &auth ) : _implementation(this , handler, auth , " /" ) {}
5748
5849 /* *
5950 * Construct an AMQP object with default login data and default vhost
6051 * @param handler Connection handler
6152 */
62- Connection (ConnectionHandler *handler, const std::string &vhost) : _implementation(this , handler, std::make_shared< Login> (), vhost) {}
53+ Connection (ConnectionHandler *handler, const std::string &vhost) : _implementation(this , handler, Login(), vhost) {}
6354
6455 /* *
6556 * Construct an AMQP object with default login data and default vhost
6657 * @param handler Connection handler
6758 */
68- Connection (ConnectionHandler *handler) : _implementation(this , handler, std::make_shared< Login> (), " /" ) {}
59+ Connection (ConnectionHandler *handler) : _implementation(this , handler, Login(), " /" ) {}
6960
7061 /* *
7162 * No copy'ing, we do not support having two identical connection objects
@@ -86,12 +77,21 @@ class Connection
8677 Connection &operator =(const Connection &connection) = delete ;
8778
8879 /* *
89- * Retrieve the authentication data
90- * @return Authentication
80+ * Retrieve the authentication mechanism
81+ * @return string
82+ */
83+ const std::string &authenticationMechanism () const
84+ {
85+ return _implementation.authenticationMechanism ();
86+ }
87+
88+ /* *
89+ * Retrieve the authentication response data
90+ * @return string
9191 */
92- const Authentication & authentication () const
92+ const std::string & authenticationResponse () const
9393 {
94- return _implementation.authentication ();
94+ return _implementation.authenticationResponse ();
9595 }
9696
9797 /* *
0 commit comments