2014-08-27 03:05:39 +08:00
|
|
|
#include "qamqptable.h"
|
|
|
|
|
#include "qamqpframe_p.h"
|
|
|
|
|
#include "qamqpauthenticator.h"
|
2014-05-29 00:25:28 +08:00
|
|
|
|
2014-09-15 23:51:48 +08:00
|
|
|
QAmqpPlainAuthenticator::QAmqpPlainAuthenticator(const QString &l, const QString &p)
|
2014-05-29 00:25:28 +08:00
|
|
|
: login_(l),
|
|
|
|
|
password_(p)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-15 23:51:48 +08:00
|
|
|
QAmqpPlainAuthenticator::~QAmqpPlainAuthenticator()
|
2014-05-29 00:25:28 +08:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-15 23:51:48 +08:00
|
|
|
QString QAmqpPlainAuthenticator::login() const
|
2014-05-29 00:25:28 +08:00
|
|
|
{
|
|
|
|
|
return login_;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-15 23:51:48 +08:00
|
|
|
QString QAmqpPlainAuthenticator::password() const
|
2014-05-29 00:25:28 +08:00
|
|
|
{
|
|
|
|
|
return password_;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-15 23:51:48 +08:00
|
|
|
QString QAmqpPlainAuthenticator::type() const
|
2014-05-29 00:25:28 +08:00
|
|
|
{
|
|
|
|
|
return "AMQPLAIN";
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-15 23:51:48 +08:00
|
|
|
void QAmqpPlainAuthenticator::setLogin(const QString &l)
|
2014-05-29 00:25:28 +08:00
|
|
|
{
|
|
|
|
|
login_ = l;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-15 23:51:48 +08:00
|
|
|
void QAmqpPlainAuthenticator::setPassword(const QString &p)
|
2014-05-29 00:25:28 +08:00
|
|
|
{
|
|
|
|
|
password_ = p;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-15 23:51:48 +08:00
|
|
|
void QAmqpPlainAuthenticator::write(QDataStream &out)
|
2014-05-29 00:25:28 +08:00
|
|
|
{
|
2014-09-15 23:51:48 +08:00
|
|
|
QAmqpFrame::writeAmqpField(out, QAmqpMetaType::ShortString, type());
|
|
|
|
|
QAmqpTable response;
|
2014-05-29 00:25:28 +08:00
|
|
|
response["LOGIN"] = login_;
|
|
|
|
|
response["PASSWORD"] = password_;
|
2014-08-04 04:39:31 +08:00
|
|
|
out << response;
|
2014-05-29 00:25:28 +08:00
|
|
|
}
|