diff options
| author | Gordon Sim <gsim@apache.org> | 2013-06-25 13:28:15 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2013-06-25 13:28:15 +0000 |
| commit | 35cb597c315b5bc3e17611cb40fe8492b0a4e45c (patch) | |
| tree | 39d79c9ec301089de7b4471d23245f92bf10a0d1 /cpp/src/qpid/broker/SessionAdapter.cpp | |
| parent | 167069c6d6eb3ca2c5f997cbb16f296302160ad7 (diff) | |
| download | qpid-python-35cb597c315b5bc3e17611cb40fe8492b0a4e45c.tar.gz | |
QPID-4712: authorisation for AMQP 1.0 connections
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1496466 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SessionAdapter.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/SessionAdapter.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/cpp/src/qpid/broker/SessionAdapter.cpp b/cpp/src/qpid/broker/SessionAdapter.cpp index f7ca4890b4..2d4868628f 100644 --- a/cpp/src/qpid/broker/SessionAdapter.cpp +++ b/cpp/src/qpid/broker/SessionAdapter.cpp @@ -18,7 +18,7 @@ #include "qpid/broker/SessionAdapter.h" #include "qpid/broker/Broker.h" -#include "qpid/broker/Connection.h" +#include "qpid/broker/amqp_0_10/Connection.h" #include "qpid/broker/DtxTimeout.h" #include "qpid/broker/Queue.h" #include "qpid/Exception.h" @@ -96,14 +96,14 @@ void SessionAdapter::ExchangeHandlerImpl::declare(const string& exchange, const try{ std::pair<Exchange::shared_ptr, bool> response = getBroker().createExchange(exchange, type, durable, alternateExchange, args, - getConnection().getUserId(), getConnection().getUrl()); + getConnection().getUserId(), getConnection().getMgmtId()); if (!response.second) { //exchange already there, not created checkType(response.first, type); checkAlternate(response.first, alternate); QPID_LOG_CAT(debug, model, "Create exchange. name:" << exchange << " user:" << getConnection().getUserId() - << " rhost:" << getConnection().getUrl() + << " rhost:" << getConnection().getMgmtId() << " type:" << type << " alternateExchange:" << alternateExchange << " durable:" << (durable ? "T" : "F")); @@ -134,7 +134,7 @@ void SessionAdapter::ExchangeHandlerImpl::checkAlternate(Exchange::shared_ptr ex void SessionAdapter::ExchangeHandlerImpl::delete_(const string& name, bool /*ifUnused*/) { //TODO: implement if-unused - getBroker().deleteExchange(name, getConnection().getUserId(), getConnection().getUrl()); + getBroker().deleteExchange(name, getConnection().getUserId(), getConnection().getMgmtId()); } ExchangeQueryResult SessionAdapter::ExchangeHandlerImpl::query(const string& name) @@ -156,7 +156,7 @@ void SessionAdapter::ExchangeHandlerImpl::bind(const string& queueName, const FieldTable& arguments) { getBroker().bind(queueName, exchangeName, routingKey, arguments, - getConnection().getUserId(), getConnection().getUrl()); + getConnection().getUserId(), getConnection().getMgmtId()); state.addBinding(queueName, exchangeName, routingKey, arguments); } @@ -166,7 +166,7 @@ void SessionAdapter::ExchangeHandlerImpl::unbind(const string& queueName, { state.removeBinding(queueName, exchangeName, routingKey); getBroker().unbind(queueName, exchangeName, routingKey, - getConnection().getUserId(), getConnection().getUrl()); + getConnection().getUserId(), getConnection().getMgmtId()); } ExchangeBoundResult SessionAdapter::ExchangeHandlerImpl::bound(const std::string& exchangeName, @@ -209,7 +209,7 @@ ExchangeBoundResult SessionAdapter::ExchangeHandlerImpl::bound(const std::string SessionAdapter::QueueHandlerImpl::QueueHandlerImpl(SemanticState& session) : HandlerHelper(session), broker(getBroker()), //record connection id and userid for deleting exclsuive queues after session has ended: - connectionId(getConnection().getUrl()), userId(getConnection().getUserId()) + connectionId(getConnection().getMgmtId()), userId(getConnection().getUserId()) {} @@ -302,7 +302,7 @@ void SessionAdapter::QueueHandlerImpl::declare(const string& name, const string& exclusive ? &session : 0, alternateExchange, getConnection().getUserId(), - getConnection().getUrl()); + getConnection().getMgmtId()); queue = queue_created.first; assert(queue); if (queue_created.second) { // This is a new queue @@ -316,7 +316,7 @@ void SessionAdapter::QueueHandlerImpl::declare(const string& name, const string& } QPID_LOG_CAT(debug, model, "Create queue. name:" << name << " user:" << getConnection().getUserId() - << " rhost:" << getConnection().getUrl() + << " rhost:" << getConnection().getMgmtId() << " durable:" << (durable ? "T" : "F") << " exclusive:" << (exclusive ? "T" : "F") << " autodelete:" << (autoDelete ? "T" : "F") @@ -363,7 +363,7 @@ void SessionAdapter::QueueHandlerImpl::checkDelete(Queue::shared_ptr queue, bool void SessionAdapter::QueueHandlerImpl::delete_(const string& queue, bool ifUnused, bool ifEmpty) { - getBroker().deleteQueue(queue, getConnection().getUserId(), getConnection().getUrl(), + getBroker().deleteQueue(queue, getConnection().getUserId(), getConnection().getMgmtId(), boost::bind(&SessionAdapter::QueueHandlerImpl::checkDelete, this, _1, ifUnused, ifEmpty)); } @@ -429,12 +429,12 @@ SessionAdapter::MessageHandlerImpl::subscribe(const string& queueName, ManagementAgent* agent = getBroker().getManagementAgent(); if (agent) - agent->raiseEvent(_qmf::EventSubscribe(getConnection().getUrl(), getConnection().getUserId(), + agent->raiseEvent(_qmf::EventSubscribe(getConnection().getMgmtId(), getConnection().getUserId(), queueName, destination, exclusive, ManagementAgent::toMap(arguments))); QPID_LOG_CAT(debug, model, "Create subscription. queue:" << queueName << " destination:" << destination << " user:" << getConnection().getUserId() - << " rhost:" << getConnection().getUrl() + << " rhost:" << getConnection().getMgmtId() << " exclusive:" << (exclusive ? "T" : "F") ); } @@ -448,10 +448,10 @@ SessionAdapter::MessageHandlerImpl::cancel(const string& destination ) ManagementAgent* agent = getBroker().getManagementAgent(); if (agent) - agent->raiseEvent(_qmf::EventUnsubscribe(getConnection().getUrl(), getConnection().getUserId(), destination)); + agent->raiseEvent(_qmf::EventUnsubscribe(getConnection().getMgmtId(), getConnection().getUserId(), destination)); QPID_LOG_CAT(debug, model, "Delete subscription. destination:" << destination << " user:" << getConnection().getUserId() - << " rhost:" << getConnection().getUrl() ); + << " rhost:" << getConnection().getMgmtId() ); } void |
