diff options
author | Ted Ross <tross@apache.org> | 2008-11-13 22:04:59 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2008-11-13 22:04:59 +0000 |
commit | fde0d6af59f7ff8d958c56aab6d57be3b491222a (patch) | |
tree | 15e7f08a879b5809d878ffd3e61b30aaa1b5b487 /cpp/src/qpid/broker/Connection.cpp | |
parent | 0272430b4dd7ad2f05492d527d5f5f1bb50e7356 (diff) | |
download | qpid-python-fde0d6af59f7ff8d958c56aab6d57be3b491222a.tar.gz |
QPID-1461 - Added qmf event support for connections.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@713838 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Connection.cpp')
-rw-r--r-- | cpp/src/qpid/broker/Connection.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp index 4dbfb153f2..f0b9980861 100644 --- a/cpp/src/qpid/broker/Connection.cpp +++ b/cpp/src/qpid/broker/Connection.cpp @@ -25,8 +25,9 @@ #include "qpid/log/Statement.h" #include "qpid/ptr_map.h" #include "qpid/framing/AMQP_ClientProxy.h" -#include "qpid/agent/ManagementAgent.h" #include "qpid/framing/enum.h" +#include "qmf/org/apache/qpid/broker/EventClientConnect.h" +#include "qmf/org/apache/qpid/broker/EventClientDisconnect.h" #include <boost/bind.hpp> #include <boost/ptr_container/ptr_vector.hpp> @@ -55,7 +56,8 @@ Connection::Connection(ConnectionOutputHandler* out_, Broker& broker_, const std mgmtClosing(false), mgmtId(mgmtId_), mgmtObject(0), - links(broker_.getLinks()) + links(broker_.getLinks()), + agent(0) { Manageable* parent = broker.GetVhostObject(); @@ -64,7 +66,7 @@ Connection::Connection(ConnectionOutputHandler* out_, Broker& broker_, const std if (parent != 0) { - ManagementAgent* agent = ManagementAgent::Singleton::getInstance(); + agent = ManagementAgent::Singleton::getInstance(); // TODO set last bool true if system connection @@ -83,8 +85,11 @@ void Connection::requestIOProcessing(boost::function0<void> callback) Connection::~Connection() { - if (mgmtObject != 0) + if (mgmtObject != 0) { mgmtObject->resourceDestroy(); + if (!isLink) + agent->raiseEvent(_qmf::EventClientDisconnect(mgmtId, ConnectionState::getUserId())); + } if (isLink) links.notifyClosed(mgmtId); } @@ -153,8 +158,10 @@ void Connection::notifyConnectionForced(const string& text) void Connection::setUserId(const string& userId) { ConnectionState::setUserId(userId); - if (mgmtObject != 0) + if (mgmtObject != 0) { mgmtObject->set_authIdentity(userId); + agent->raiseEvent(_qmf::EventClientConnect(mgmtId, userId)); + } } void Connection::setFederationLink(bool b) |