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
|
|
|
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-27 02:02:43 +08:00
|
|
|
Frame::writeAmqpField(out, MetaType::ShortString, type());
|
2014-08-04 04:39:31 +08:00
|
|
|
Table 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
|
|
|
}
|