qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1233088 - in /qpid/trunk/qpid/cpp/src/qpid/broker: Connection.cpp Connection.h
Date Wed, 18 Jan 2012 22:09:02 GMT
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


Mime
View raw message