summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@apache.org>2014-02-28 14:40:23 +0000
committerPavel Moravec <pmoravec@apache.org>2014-02-28 14:40:23 +0000
commita0c0de6f529e7ea92945a45f4e281f2f31e5b528 (patch)
treec74f67ca6dc374c74b6bd25a00d7bfd53698850d /cpp/src
parent6280791efdfb402d84e858d8065a7368b405bb59 (diff)
downloadqpid-python-a0c0de6f529e7ea92945a45f4e281f2f31e5b528.tar.gz
QPID-5587: QMF to track queue owner (userId)
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1572963 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/broker/Queue.cpp6
-rw-r--r--cpp/src/qpid/broker/Queue.h2
-rw-r--r--cpp/src/qpid/broker/management-schema.xml5
3 files changed, 10 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp
index 2c8f8c2f0e..d8bc59eaf1 100644
--- a/cpp/src/qpid/broker/Queue.cpp
+++ b/cpp/src/qpid/broker/Queue.cpp
@@ -1660,6 +1660,12 @@ void Queue::setMgmtRedirectState( std::string peer, bool enabled, bool isSrc ) {
}
}
+void Queue::setOwningUser(std::string& _userId) {
+ userId = _userId;
+ if (mgmtObject != 0)
+ mgmtObject->set_creator(userId);
+}
+
bool Queue::reroute(boost::shared_ptr<Exchange> e, const Message& m)
{
if (e) {
diff --git a/cpp/src/qpid/broker/Queue.h b/cpp/src/qpid/broker/Queue.h
index 6e7b17e1c5..21a8b7ef99 100644
--- a/cpp/src/qpid/broker/Queue.h
+++ b/cpp/src/qpid/broker/Queue.h
@@ -400,7 +400,7 @@ class Queue : public boost::enable_shared_from_this<Queue>,
QPID_BROKER_EXTERN bool find(framing::SequenceNumber pos, Message& msg ) const;
// Remember the queue's owner so acl quotas can be restored after restart
- void setOwningUser(std::string& _userId) { userId = _userId; }
+ void setOwningUser(std::string& _userId);
void updateAclUserQueueCount();
QPID_BROKER_EXTERN void setAlternateExchange(boost::shared_ptr<Exchange> exchange);
diff --git a/cpp/src/qpid/broker/management-schema.xml b/cpp/src/qpid/broker/management-schema.xml
index bb15a244ba..2db8df4e85 100644
--- a/cpp/src/qpid/broker/management-schema.xml
+++ b/cpp/src/qpid/broker/management-schema.xml
@@ -282,8 +282,9 @@
<statistic name="flowStopped" type="bool" desc="Flow control active."/>
<statistic name="flowStoppedCount" type="count32" desc="Number of times flow control was activated for this queue"/>
- <statistic name="redirectPeer" type="sstr" desc="Partner queue for redirected pair"/>
- <statistic name="redirectSource" type="bool" desc="This queue is the redirect source"/>
+ <statistic name="redirectPeer" type="sstr" desc="Partner queue for redirected pair"/>
+ <statistic name="redirectSource" type="bool" desc="This queue is the redirect source"/>
+ <statistic name="creator" type="sstr" desc="userId of creator of the queue"/>
<method name="purge" desc="Discard all or some messages on a queue">
<arg name="request" dir="I" type="uint32" desc="0 for all messages or n>0 for n messages"/>