2014-05-29 00:25:28 +08:00
|
|
|
#include "amqp_authenticator.h"
|
|
|
|
|
#include "amqp_frame.h"
|
|
|
|
|
|
|
|
|
|
using namespace QAMQP;
|
|
|
|
|
|
|
|
|
|
AMQPlainAuthenticator::AMQPlainAuthenticator(const QString &l, const QString &p)
|
|
|
|
|
: login_(l),
|
|
|
|
|
password_(p)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AMQPlainAuthenticator::~AMQPlainAuthenticator()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString AMQPlainAuthenticator::login() const
|
|
|
|
|
{
|
|
|
|
|
return login_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString AMQPlainAuthenticator::password() const
|
|
|
|
|
{
|
|
|
|
|
return password_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString AMQPlainAuthenticator::type() const
|
|
|
|
|
{
|
|
|
|
|
return "AMQPLAIN";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AMQPlainAuthenticator::setLogin(const QString &l)
|
|
|
|
|
{
|
|
|
|
|
login_ = l;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AMQPlainAuthenticator::setPassword(const QString &p)
|
|
|
|
|
{
|
|
|
|
|
password_ = p;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AMQPlainAuthenticator::write(QDataStream &out)
|
|
|
|
|
{
|
2014-08-04 02:11:21 +08:00
|
|
|
Frame::writeField('s', out, type());
|
|
|
|
|
Frame::TableField response;
|
2014-05-29 00:25:28 +08:00
|
|
|
response["LOGIN"] = login_;
|
|
|
|
|
response["PASSWORD"] = password_;
|
2014-08-04 02:11:21 +08:00
|
|
|
Frame::serialize(out, response);
|
2014-05-29 00:25:28 +08:00
|
|
|
}
|