qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cctriel...@apache.org
Subject svn commit: r591715 - in /incubator/qpid/trunk/qpid/cpp/src/qpid/broker: ./ management/
Date Sun, 04 Nov 2007 00:40:46 GMT
Author: cctrieloff
Date: Sat Nov  3 17:40:44 2007
New Revision: 591715

URL: http://svn.apache.org/viewvc?rev=591715&view=rev
Log:
AMQP 670 This patch contains the following:

1) "using" clauses were removed from one header file.  This required changes in other header
and body files that were relying on that clause.
2) The object indexing scheme has been improved in the management schema.  Objects now properly
reference their parent/containing objects.
3) The framework for parsing management commands has been added.
4) The python management API has been improved and now includes an object-method call.

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/QueueRegistry.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/QueueRegistry.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementAgent.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementAgent.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObject.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObject.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectBroker.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectBroker.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectQueue.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectQueue.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectVhost.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectVhost.h

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp Sat Nov  3 17:40:44 2007
@@ -113,7 +113,18 @@
 {
     if(conf.enableMgmt){
         managementAgent = ManagementAgent::shared_ptr (new ManagementAgent (conf.mgmtPubInterval));
-        queues.setManagementAgent(managementAgent);
+
+        mgmtObject = ManagementObjectBroker::shared_ptr (new ManagementObjectBroker (conf));
+        managementAgent->addObject (dynamic_pointer_cast<ManagementObject>(mgmtObject));
+
+        // Since there is currently no support for virtual hosts, a management object
+        // representing the implied single virtual host is added here.
+        mgmtVhostObject = ManagementObjectVhost::shared_ptr
+            (new ManagementObjectVhost (mgmtObject->getObjectId (), conf));
+        managementAgent->addObject (dynamic_pointer_cast<ManagementObject>(mgmtVhostObject));
+
+        queues.setManagementAgent (managementAgent);
+        queues.setManagementVhost (dynamic_pointer_cast<ManagementObject>(mgmtVhostObject));
     }
 
     exchanges.declare(empty, DirectExchange::typeName); // Default exchange.
@@ -128,14 +139,6 @@
         Exchange::shared_ptr mExchange = exchanges.get (qpid_management);
         managementAgent->setExchange (mExchange);
         dynamic_pointer_cast<ManagementExchange>(mExchange)->setManagmentAgent (managementAgent);
-
-        mgmtObject = ManagementObjectBroker::shared_ptr (new ManagementObjectBroker (conf));
-        managementAgent->addObject (dynamic_pointer_cast<ManagementObject>(mgmtObject));
-
-        // Since there is currently no support for virtual hosts, a management object
-        // representing the implied single virtual host is added here.
-        mgmtVhostObject = ManagementObjectVhost::shared_ptr (new ManagementObjectVhost (conf));
-        managementAgent->addObject (dynamic_pointer_cast<ManagementObject>(mgmtVhostObject));
     }
     else
         QPID_LOG(info, "Management not enabled");

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/QueueRegistry.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/QueueRegistry.cpp?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/QueueRegistry.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/QueueRegistry.cpp Sat Nov  3 17:40:44 2007
@@ -47,7 +47,8 @@
         queues[name] = queue;
 
         if (managementAgent){
-            ManagementObjectQueue::shared_ptr mgmtObject(new ManagementObjectQueue (name,
durable, autoDelete));
+            ManagementObjectQueue::shared_ptr mgmtObject
+                (new ManagementObjectQueue (managementVhost->getObjectId (), name, durable,
autoDelete));
 
             queue->setMgmt (mgmtObject);
             managementAgent->addObject(dynamic_pointer_cast<ManagementObject>(mgmtObject));
@@ -115,3 +116,7 @@
     return managementAgent;
 }
 
+void QueueRegistry::setManagementVhost (ManagementObject::shared_ptr vhost)
+{
+    managementVhost = vhost;
+}

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/QueueRegistry.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/QueueRegistry.h?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/QueueRegistry.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/QueueRegistry.h Sat Nov  3 17:40:44 2007
@@ -95,6 +95,7 @@
      */
     void setManagementAgent (ManagementAgent::shared_ptr agent);
     ManagementAgent::shared_ptr getManagementAgent (void);
+    void setManagementVhost (ManagementObject::shared_ptr vhost);
 
 private:
     typedef std::map<string, Queue::shared_ptr> QueueMap;
@@ -102,7 +103,8 @@
     qpid::sys::RWlock lock;
     int counter;
     MessageStore* const store;
-    ManagementAgent::shared_ptr managementAgent;
+    ManagementAgent::shared_ptr  managementAgent;
+    ManagementObject::shared_ptr managementVhost;
 };
 
     

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp Sat Nov  3 17:40:44 2007
@@ -32,6 +32,7 @@
 namespace broker {
 using namespace framing;
 using namespace std;
+using namespace qpid::sys;
 
 SessionHandler::SessionHandler(Connection& c, ChannelId ch)
     : InOutHandler(0, &c.getOutput()),

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementAgent.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementAgent.cpp?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementAgent.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementAgent.cpp Sat Nov 
3 17:40:44 2007
@@ -31,7 +31,7 @@
 using namespace qpid::broker;
 using namespace qpid::sys;
 
-ManagementAgent::ManagementAgent (uint16_t _interval) : interval (_interval)
+ManagementAgent::ManagementAgent (uint16_t _interval) : interval (_interval), nextObjectId(1)
 {
     timer.add (TimerTask::shared_ptr (new Periodic(*this, interval)));
 }
@@ -43,6 +43,7 @@
 
 void ManagementAgent::addObject (ManagementObject::shared_ptr object)
 {
+    object->setObjectId (nextObjectId++);
     managementObjects.push_back (object);
     QPID_LOG(info, "Management Object Added");
 }
@@ -197,8 +198,37 @@
 }
 
 void ManagementAgent::dispatchCommand (Deliverable&      /*msg*/,
-                                       const string&     /*routingKey*/,
+                                       const string&     routingKey,
                                        const FieldTable* /*args*/)
 {
+    size_t pos, start;
+
+    if (routingKey.compare (0, 7, "method.") != 0)
+    {
+        QPID_LOG (debug, "Illegal routing key for dispatch: " << routingKey);
+        return;
+    }
+
+    start = 7;
+    if (routingKey.length () == start)
+    {
+        QPID_LOG (debug, "Missing class-key in routing key: " << routingKey);
+        return;
+    }
+
+    pos = routingKey.find ('.', start);
+    if (pos == string::npos || routingKey.length () == pos + 1)
+    {
+        QPID_LOG (debug, "Missing method-key in routing key: " << routingKey);
+        return;
+    }
+
+    string className = routingKey.substr (start, pos - start);
+
+    start = pos + 1;
+
+    string methodName = routingKey.substr (start, routingKey.length () - start);
+
+    QPID_LOG (debug, "Dispatch class: " << className << ", method: " <<
methodName);
 }
 

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementAgent.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementAgent.h?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementAgent.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementAgent.h Sat Nov  3
17:40:44 2007
@@ -45,7 +45,7 @@
     void clientAdded     (void);
     void dispatchCommand (Deliverable&      msg,
                           const string&     routingKey,
-                          const FieldTable* args);
+                          const qpid::framing::FieldTable* args);
     
   private:
 
@@ -62,6 +62,7 @@
     Timer                  timer;
     Exchange::shared_ptr   exchange;
     uint16_t               interval;
+    uint32_t               nextObjectId;
 
     void PeriodicProcessing (void);
 };

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObject.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObject.cpp?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObject.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObject.cpp Sat Nov
 3 17:40:44 2007
@@ -41,6 +41,11 @@
     buf.putShortString (description);
 }
 
+void ManagementObject::schemaListBegin (Buffer& buf)
+{
+    schemaItem (buf, TYPE_UINT32, "id", "Object ID", true, true);
+}
+
 void ManagementObject::schemaListEnd (Buffer& buf)
 {
     buf.putOctet (FLAG_END);
@@ -51,4 +56,5 @@
     buf.putLongLong (uint64_t (Duration (now ())));
     buf.putLongLong (createTime);
     buf.putLongLong (destroyTime);
+    buf.putLong     (objectId);
 }

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObject.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObject.h?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObject.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObject.h Sat Nov  3
17:40:44 2007
@@ -30,9 +30,6 @@
 namespace qpid { 
 namespace broker {
 
-using namespace qpid::framing;
-using namespace qpid::sys;
-
 const uint16_t OBJECT_SYSTEM      = 1;
 const uint16_t OBJECT_BROKER      = 2;
 const uint16_t OBJECT_VHOST       = 3;
@@ -52,6 +49,7 @@
     
     uint64_t createTime;
     uint64_t destroyTime;
+    uint32_t objectId;
     bool     configChanged;
     bool     instChanged;
     bool     deleted;
@@ -67,31 +65,34 @@
     static const uint8_t FLAG_INDEX  = 0x02;
     static const uint8_t FLAG_END    = 0x80;
     
-    void schemaItem (Buffer&     buf,
-                     uint8_t     typeCode,
-                     std::string name,
-                     std::string description,
-                     bool        isConfig = false,
-                     bool        isIndex  = false);
-    void schemaListEnd   (Buffer& buf);
-    void writeTimestamps (Buffer& buf);
+    void schemaItem      (qpid::framing::Buffer& buf,
+                          uint8_t     typeCode,
+                          std::string name,
+                          std::string description,
+                          bool        isConfig = false,
+                          bool        isIndex  = false);
+    void schemaListBegin (qpid::framing::Buffer& buf);
+    void schemaListEnd   (qpid::framing::Buffer& buf);
+    void writeTimestamps (qpid::framing::Buffer& buf);
 
   public:
     typedef boost::shared_ptr<ManagementObject> shared_ptr;
 
-    ManagementObject () : destroyTime(0), configChanged(true),
+    ManagementObject () : destroyTime(0), objectId (), configChanged(true),
                           instChanged(true), deleted(false)
-    { createTime = uint64_t (Duration (now ())); }
+        { createTime = uint64_t (qpid::sys::Duration (qpid::sys::now ())); }
     virtual ~ManagementObject () {}
 
-    virtual uint16_t    getObjectType        (void)        = 0;
-    virtual std::string getObjectName        (void)        = 0;
-    virtual void        writeSchema          (Buffer& buf) = 0;
-    virtual void        writeConfig          (Buffer& buf) = 0;
-    virtual void        writeInstrumentation (Buffer& buf) = 0;
-    virtual bool        getSchemaNeeded      (void)        = 0;
-    virtual void        setSchemaNeeded      (void)        = 0;
+    virtual uint16_t    getObjectType        (void) = 0;
+    virtual std::string getObjectName        (void) = 0;
+    virtual void        writeSchema          (qpid::framing::Buffer& buf) = 0;
+    virtual void        writeConfig          (qpid::framing::Buffer& buf) = 0;
+    virtual void        writeInstrumentation (qpid::framing::Buffer& buf) = 0;
+    virtual bool        getSchemaNeeded      (void) = 0;
+    virtual void        setSchemaNeeded      (void) = 0;
 
+    void         setObjectId      (uint32_t oid) { objectId = oid; }
+    uint32_t     getObjectId      (void) { return objectId; }
     inline  bool getConfigChanged (void) { return configChanged; }
     virtual bool getInstChanged   (void) { return instChanged; }
     inline  void setAllChanged    (void)
@@ -101,7 +102,7 @@
     }
 
     inline void resourceDestroy  (void) {
-        destroyTime = uint64_t (Duration (now ()));
+        destroyTime = uint64_t (qpid::sys::Duration (qpid::sys::now ()));
         deleted     = true;
     }
     bool isDeleted (void) { return deleted; }

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectBroker.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectBroker.cpp?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectBroker.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectBroker.cpp Sat
Nov  3 17:40:44 2007
@@ -54,8 +54,9 @@
 {
     schemaNeeded = false;
 
-    schemaItem (buf, TYPE_STRING, "sysId",         "System ID", true, true);
-    schemaItem (buf, TYPE_UINT16, "port",          "TCP Port for AMQP Service", true);
+    schemaListBegin (buf);
+    schemaItem (buf, TYPE_UINT32, "systemRef",     "System ID",                 true, true);
+    schemaItem (buf, TYPE_UINT16, "port",          "TCP Port for AMQP Service", true, true);
     schemaItem (buf, TYPE_UINT16, "workerThreads", "Thread pool size", true);
     schemaItem (buf, TYPE_UINT16, "maxConns",      "Maximum allowed connections", true);
     schemaItem (buf, TYPE_UINT16, "connBacklog",
@@ -72,7 +73,6 @@
     schemaItem (buf, TYPE_STRING, "clusterName",
                 "Name of cluster this server is a member of, zero-length for standalone server",
true);
     schemaItem (buf, TYPE_STRING, "version", "Running software version", true);
-
     schemaListEnd (buf);
 }
 
@@ -81,7 +81,7 @@
     configChanged = false;
 
     writeTimestamps    (buf);
-    buf.putShortString (sysId);
+    buf.putLong        (0);
     buf.putShort       (port);
     buf.putShort       (workerThreads);
     buf.putShort       (maxConns);

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectBroker.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectBroker.h?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectBroker.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectBroker.h Sat
Nov  3 17:40:44 2007
@@ -42,8 +42,6 @@
 
     static bool schemaNeeded;
 
-    std::string objectName;
-
     std::string sysId;
     uint16_t    port;
     uint16_t    workerThreads;
@@ -59,10 +57,10 @@
     std::string version;
 
     uint16_t    getObjectType        (void) { return OBJECT_BROKER; }
-    std::string getObjectName        (void) { return objectName; }
-    void        writeSchema          (Buffer& buf);
-    void        writeConfig          (Buffer& buf);
-    void        writeInstrumentation (Buffer& /*buf*/) {}
+    std::string getObjectName        (void) { return "broker"; }
+    void        writeSchema          (qpid::framing::Buffer& buf);
+    void        writeConfig          (qpid::framing::Buffer& buf);
+    void        writeInstrumentation (qpid::framing::Buffer& /*buf*/) {}
     bool        getSchemaNeeded      (void) { return schemaNeeded; }
     void        setSchemaNeeded      (void) { schemaNeeded = true; }
 

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectQueue.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectQueue.cpp?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectQueue.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectQueue.cpp Sat
Nov  3 17:40:44 2007
@@ -27,9 +27,9 @@
 
 bool ManagementObjectQueue::schemaNeeded = true;
 
-ManagementObjectQueue::ManagementObjectQueue (std::string& _name,
+ManagementObjectQueue::ManagementObjectQueue (uint32_t _vhostRef, std::string& _name,
                                               bool _durable, bool _autoDelete) :
-    vhostName("/"), name(_name), durable(_durable), autoDelete(_autoDelete)
+    vhostRef(_vhostRef), name(_name), durable(_durable), autoDelete(_autoDelete)
 {
     msgTotalEnqueues     = 0;
     msgTotalDequeues     = 0;
@@ -79,15 +79,15 @@
 {
     schemaNeeded = false;
 
-    schemaItem (buf, TYPE_STRING, "vhostRef",            "Virtual Host Ref", true, true);
-    schemaItem (buf, TYPE_STRING, "name",                "Queue Name", true, true);
+    schemaListBegin (buf);
+    schemaItem (buf, TYPE_UINT32, "vhostRef",            "Virtual Host Ref", true);
+    schemaItem (buf, TYPE_STRING, "name",                "Queue Name", true);
     schemaItem (buf, TYPE_BOOL,   "durable",             "Durable",    true);
     schemaItem (buf, TYPE_BOOL,   "autoDelete",          "AutoDelete", true);
-
     schemaItem (buf, TYPE_UINT64, "msgTotalEnqueues",    "Total messages enqueued");
     schemaItem (buf, TYPE_UINT64, "msgTotalDequeues",    "Total messages dequeued");
-    schemaItem (buf, TYPE_UINT64, "msgTxEnqueues",       "Transactional messages enqueued");
-    schemaItem (buf, TYPE_UINT64, "msgTxDequeues",       "Transactional messages dequeued");
+    schemaItem (buf, TYPE_UINT64, "msgTxnEnqueues",      "Transactional messages enqueued");
+    schemaItem (buf, TYPE_UINT64, "msgTxnDequeues",      "Transactional messages dequeued");
     schemaItem (buf, TYPE_UINT64, "msgPersistEnqueues",  "Persistent messages enqueued");
     schemaItem (buf, TYPE_UINT64, "msgPersistDequeues",  "Persistent messages dequeued");
     schemaItem (buf, TYPE_UINT32, "msgDepth",            "Current size of queue in messages");
@@ -95,29 +95,28 @@
     schemaItem (buf, TYPE_UINT32, "msgDepthHigh",        "High-water queue size, this interval");
     schemaItem (buf, TYPE_UINT64, "byteTotalEnqueues",   "Total messages enqueued");
     schemaItem (buf, TYPE_UINT64, "byteTotalDequeues",   "Total messages dequeued");
-    schemaItem (buf, TYPE_UINT64, "byteTxEnqueues",      "Transactional messages enqueued");
-    schemaItem (buf, TYPE_UINT64, "byteTxDequeues",      "Transactional messages dequeued");
+    schemaItem (buf, TYPE_UINT64, "byteTxnEnqueues",     "Transactional messages enqueued");
+    schemaItem (buf, TYPE_UINT64, "byteTxnDequeues",     "Transactional messages dequeued");
     schemaItem (buf, TYPE_UINT64, "bytePersistEnqueues", "Persistent messages enqueued");
     schemaItem (buf, TYPE_UINT64, "bytePersistDequeues", "Persistent messages dequeued");
     schemaItem (buf, TYPE_UINT32, "byteDepth",           "Current size of queue in bytes");
     schemaItem (buf, TYPE_UINT32, "byteDepthLow",        "Low-water mark this interval");
     schemaItem (buf, TYPE_UINT32, "byteDepthHigh",       "High-water mark this interval");
-    schemaItem (buf, TYPE_UINT64, "enqueueTxStarts",     "Total enqueue transactions started
");
-    schemaItem (buf, TYPE_UINT64, "enqueueTxCommits",    "Total enqueue transactions committed");
-    schemaItem (buf, TYPE_UINT64, "enqueueTxRejects",    "Total enqueue transactions rejected");
-    schemaItem (buf, TYPE_UINT32, "enqueueTxCount",      "Current pending enqueue transactions");
-    schemaItem (buf, TYPE_UINT32, "enqueueTxCountLow",   "Low water mark this interval");
-    schemaItem (buf, TYPE_UINT32, "enqueueTxCountHigh",  "High water mark this interval");
-    schemaItem (buf, TYPE_UINT64, "dequeueTxStarts",     "Total dequeue transactions started
");
-    schemaItem (buf, TYPE_UINT64, "dequeueTxCommits",    "Total dequeue transactions committed");
-    schemaItem (buf, TYPE_UINT64, "dequeueTxRejects",    "Total dequeue transactions rejected");
-    schemaItem (buf, TYPE_UINT32, "dequeueTxCount",      "Current pending dequeue transactions");
-    schemaItem (buf, TYPE_UINT32, "dequeueTxCountLow",   "Transaction low water mark this
interval");
-    schemaItem (buf, TYPE_UINT32, "dequeueTxCountHigh",  "Transaction high water mark this
interval");
+    schemaItem (buf, TYPE_UINT64, "enqueueTxnStarts",    "Total enqueue transactions started
");
+    schemaItem (buf, TYPE_UINT64, "enqueueTxnCommits",   "Total enqueue transactions committed");
+    schemaItem (buf, TYPE_UINT64, "enqueueTxnRejects",   "Total enqueue transactions rejected");
+    schemaItem (buf, TYPE_UINT32, "enqueueTxnCount",     "Current pending enqueue transactions");
+    schemaItem (buf, TYPE_UINT32, "enqueueTxnCountLow",  "Low water mark this interval");
+    schemaItem (buf, TYPE_UINT32, "enqueueTxnCountHigh", "High water mark this interval");
+    schemaItem (buf, TYPE_UINT64, "dequeueTxnStarts",    "Total dequeue transactions started
");
+    schemaItem (buf, TYPE_UINT64, "dequeueTxnCommits",   "Total dequeue transactions committed");
+    schemaItem (buf, TYPE_UINT64, "dequeueTxnRejects",   "Total dequeue transactions rejected");
+    schemaItem (buf, TYPE_UINT32, "dequeueTxnCount",     "Current pending dequeue transactions");
+    schemaItem (buf, TYPE_UINT32, "dequeueTxnCountLow",  "Transaction low water mark this
interval");
+    schemaItem (buf, TYPE_UINT32, "dequeueTxnCountHigh", "Transaction high water mark this
interval");
     schemaItem (buf, TYPE_UINT32, "consumers",           "Current consumers on queue");
     schemaItem (buf, TYPE_UINT32, "consumersLow",        "Consumer low water mark this interval");
     schemaItem (buf, TYPE_UINT32, "consumersHigh",       "Consumer high water mark this interval");
-
     schemaListEnd (buf);
 }
 
@@ -126,7 +125,7 @@
     configChanged = false;
 
     writeTimestamps    (buf);
-    buf.putShortString (vhostName);
+    buf.putLong        (vhostRef);
     buf.putShortString (name);
     buf.putOctet       (durable    ? 1 : 0);
     buf.putOctet       (autoDelete ? 1 : 0);
@@ -137,8 +136,6 @@
     instChanged = false;
 
     writeTimestamps (buf);
-    buf.putShortString (vhostName);
-    buf.putShortString (name);
     buf.putLongLong (msgTotalEnqueues);
     buf.putLongLong (msgTotalDequeues);
     buf.putLongLong (msgTxEnqueues);

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectQueue.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectQueue.h?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectQueue.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectQueue.h Sat Nov
 3 17:40:44 2007
@@ -36,8 +36,7 @@
 
     static bool schemaNeeded;
 
-    std::string objectName;
-    std::string vhostName;
+    uint32_t    vhostRef;
     std::string name;
     bool        durable;
     bool        autoDelete;
@@ -85,10 +84,10 @@
     uint32_t  consumersHigh;        // High water mark this interval
 
     uint16_t    getObjectType        (void) { return OBJECT_QUEUE; }
-    std::string getObjectName        (void) { return objectName; }
-    void        writeSchema          (Buffer& buf);
-    void        writeConfig          (Buffer& buf);
-    void        writeInstrumentation (Buffer& buf);
+    std::string getObjectName        (void) { return "queue"; }
+    void        writeSchema          (qpid::framing::Buffer& buf);
+    void        writeConfig          (qpid::framing::Buffer& buf);
+    void        writeInstrumentation (qpid::framing::Buffer& buf);
     bool        getSchemaNeeded      (void) { return schemaNeeded; }
     void        setSchemaNeeded      (void) { schemaNeeded = true; }
     
@@ -119,7 +118,8 @@
 
     typedef boost::shared_ptr<ManagementObjectQueue> shared_ptr;
 
-    ManagementObjectQueue  (std::string& name, bool durable, bool autoDelete);
+    ManagementObjectQueue  (uint32_t _vhostRef, std::string& name,
+                            bool durable, bool autoDelete);
     ~ManagementObjectQueue (void);
 
     // The following mask contents are used to describe enqueued or dequeued

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectVhost.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectVhost.cpp?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectVhost.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectVhost.cpp Sat
Nov  3 17:40:44 2007
@@ -28,10 +28,8 @@
 
 bool ManagementObjectVhost::schemaNeeded = true;
 
-ManagementObjectVhost::ManagementObjectVhost (const Options& /*_conf*/)
-{
-    name = "/";
-}
+ManagementObjectVhost::ManagementObjectVhost (uint32_t _sysRef, const Options& /*_conf*/)
:
+    sysRef(_sysRef), name("/") {}
 
 ManagementObjectVhost::~ManagementObjectVhost () {}
 
@@ -39,8 +37,9 @@
 {
     schemaNeeded = false;
 
-    schemaItem (buf, TYPE_STRING, "name", "Name of virtual host",      true, true);
-
+    schemaListBegin (buf);
+    schemaItem (buf, TYPE_UINT32, "brokerRef", "Broker Reference" ,    true);
+    schemaItem (buf, TYPE_STRING, "name",      "Name of virtual host", true);
     schemaListEnd (buf);
 }
 
@@ -49,6 +48,7 @@
     configChanged = false;
 
     writeTimestamps    (buf);
+    buf.putLong        (sysRef);
     buf.putShortString (name);
 }
 

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectVhost.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectVhost.h?rev=591715&r1=591714&r2=591715&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectVhost.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/management/ManagementObjectVhost.h Sat Nov
 3 17:40:44 2007
@@ -35,22 +35,21 @@
 
     typedef boost::shared_ptr<ManagementObjectVhost> shared_ptr;
 
-    ManagementObjectVhost  (const Options& conf);
+    ManagementObjectVhost  (uint32_t sysRef, const Options& conf);
     ~ManagementObjectVhost (void);
 
   private:
 
     static bool schemaNeeded;
 
-    std::string objectName;
-
+    uint32_t    sysRef;
     std::string name;
 
     uint16_t    getObjectType        (void) { return OBJECT_VHOST; }
-    std::string getObjectName        (void) { return objectName; }
-    void        writeSchema          (Buffer& buf);
-    void        writeConfig          (Buffer& buf);
-    void        writeInstrumentation (Buffer& /*buf*/) {}
+    std::string getObjectName        (void) { return "vhost"; }
+    void        writeSchema          (qpid::framing::Buffer& buf);
+    void        writeConfig          (qpid::framing::Buffer& buf);
+    void        writeInstrumentation (qpid::framing::Buffer& /*buf*/) {}
     bool        getSchemaNeeded      (void) { return schemaNeeded; }
     void        setSchemaNeeded      (void) { schemaNeeded = true; }
 



Mime
View raw message