Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 962E1B902 for ; Wed, 18 Jan 2012 22:09:23 +0000 (UTC) Received: (qmail 65929 invoked by uid 500); 18 Jan 2012 22:09:23 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 65890 invoked by uid 500); 18 Jan 2012 22:09:23 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 65883 invoked by uid 99); 18 Jan 2012 22:09:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jan 2012 22:09:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jan 2012 22:09:22 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3733423889C5 for ; Wed, 18 Jan 2012 22:09:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1233088 - in /qpid/trunk/qpid/cpp/src/qpid/broker: Connection.cpp Connection.h Date: Wed, 18 Jan 2012 22:09:02 -0000 To: commits@qpid.apache.org From: aconway@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120118220902.3733423889C5@eris.apache.org> Author: aconway Date: Wed Jan 18 22:09:01 2012 New Revision: 1233088 URL: http://svn.apache.org/viewvc?rev=1233088&view=rev Log: QPID-3603: Added public broker::Connection::isLink function. Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp?rev=1233088&r1=1233087&r2=1233088&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp (original) +++ qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp Wed Jan 18 22:09:01 2012 @@ -83,14 +83,14 @@ Connection::Connection(ConnectionOutputH Broker& broker_, const std::string& mgmtId_, const qpid::sys::SecuritySettings& external, - bool isLink_, + bool link_, uint64_t objectId_, bool shadow_, bool delayManagement) : ConnectionState(out_, broker_), securitySettings(external), - adapter(*this, isLink_, shadow_), - isLink(isLink_), + adapter(*this, link_, shadow_), + link(link_), mgmtClosing(false), mgmtId(mgmtId_), mgmtObject(0), @@ -103,7 +103,7 @@ Connection::Connection(ConnectionOutputH outboundTracker(*this) { outboundTracker.wrap(out); - if (isLink) + if (link) links.notifyConnection(mgmtId, this); // In a cluster, allow adding the management object to be delayed. if (!delayManagement) addManagementObject(); @@ -118,7 +118,7 @@ void Connection::addManagementObject() { agent = broker.getManagementAgent(); if (agent != 0) { // TODO set last bool true if system connection - mgmtObject = new _qmf::Connection(agent, this, parent, mgmtId, !isLink, false); + mgmtObject = new _qmf::Connection(agent, this, parent, mgmtId, !link, false); mgmtObject->set_shadow(shadow); agent->addObject(mgmtObject, objectId); } @@ -139,10 +139,10 @@ Connection::~Connection() mgmtObject->resourceDestroy(); // In a cluster, Connections destroyed during shutdown are in // a cluster-unsafe context. Don't raise an event in that case. - if (!isLink && isClusterSafe()) + if (!link && isClusterSafe()) agent->raiseEvent(_qmf::EventClientDisconnect(mgmtId, ConnectionState::getUserId())); } - if (isLink) + if (link) links.notifyClosed(mgmtId); if (heartbeatTimer) @@ -157,7 +157,7 @@ void Connection::received(framing::AMQFr // Received frame on connection so delay timeout restartTimeout(); adapter.handle(frame); - if (isLink) //i.e. we are acting as the client to another broker + if (link) //i.e. we are acting as the client to another broker recordFromServer(frame); else recordFromClient(frame); @@ -165,7 +165,7 @@ void Connection::received(framing::AMQFr void Connection::sent(const framing::AMQFrame& frame) { - if (isLink) //i.e. we are acting as the client to another broker + if (link) //i.e. we are acting as the client to another broker recordFromClient(frame); else recordFromServer(frame); @@ -204,7 +204,7 @@ void Connection::recordFromClient(const string Connection::getAuthMechanism() { - if (!isLink) + if (!link) return string("ANONYMOUS"); return links.getAuthMechanism(mgmtId); @@ -212,7 +212,7 @@ string Connection::getAuthMechanism() string Connection::getUsername ( ) { - if (!isLink) + if (!link) return string("anonymous"); return links.getUsername(mgmtId); @@ -220,7 +220,7 @@ string Connection::getUsername ( ) string Connection::getPassword ( ) { - if (!isLink) + if (!link) return string(""); return links.getPassword(mgmtId); @@ -228,7 +228,7 @@ string Connection::getPassword ( ) string Connection::getHost ( ) { - if (!isLink) + if (!link) return string(""); return links.getHost(mgmtId); @@ -236,7 +236,7 @@ string Connection::getHost ( ) uint16_t Connection::getPort ( ) { - if (!isLink) + if (!link) return 0; return links.getPort(mgmtId); @@ -244,7 +244,7 @@ uint16_t Connection::getPort ( ) string Connection::getAuthCredentials() { - if (!isLink) + if (!link) return string(); if (mgmtObject != 0) @@ -260,7 +260,7 @@ string Connection::getAuthCredentials() void Connection::notifyConnectionForced(const string& text) { - if (isLink) + if (link) links.notifyConnectionForced(mgmtId, text); } Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h?rev=1233088&r1=1233087&r2=1233088&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h (original) +++ qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h Wed Jan 18 22:09:01 2012 @@ -160,6 +160,8 @@ class Connection : public sys::Connectio /** @return true if the initial connection negotiation is complete. */ bool isOpen(); + bool isLink() { return link; } + // Used by cluster during catch-up, see cluster::OutputInterceptor void doIoCallbacks(); @@ -170,7 +172,7 @@ class Connection : public sys::Connectio ChannelMap channels; qpid::sys::SecuritySettings securitySettings; ConnectionHandler adapter; - const bool isLink; + const bool link; bool mgmtClosing; const std::string mgmtId; sys::Mutex ioCallbackLock; --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscribe@qpid.apache.org