summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Makefile.am21
-rw-r--r--cpp/src/qpid/broker/Broker.cpp37
-rw-r--r--cpp/src/qpid/broker/Queue.cpp69
-rw-r--r--cpp/src/qpid/broker/Vhost.cpp2
-rw-r--r--cpp/src/qpid/framing/AMQHeaderBody.h3
-rw-r--r--cpp/src/qpid/management/Args.h5
-rw-r--r--cpp/src/qpid/management/Broker.cpp254
-rw-r--r--cpp/src/qpid/management/Broker.h74
-rw-r--r--cpp/src/qpid/management/Manageable.cpp (renamed from cpp/src/qpid/management/ArgsBrokerEcho.h)26
-rw-r--r--cpp/src/qpid/management/Manageable.h7
-rw-r--r--cpp/src/qpid/management/ManagementAgent.cpp4
-rw-r--r--cpp/src/qpid/management/Queue.cpp391
-rw-r--r--cpp/src/qpid/management/Queue.h182
-rw-r--r--cpp/src/qpid/management/Vhost.cpp79
-rw-r--r--cpp/src/qpid/management/Vhost.h63
15 files changed, 116 insertions, 1101 deletions
diff --git a/cpp/src/Makefile.am b/cpp/src/Makefile.am
index 5c75fc7ce6..b3c6b8a13d 100644
--- a/cpp/src/Makefile.am
+++ b/cpp/src/Makefile.am
@@ -20,11 +20,19 @@ if GENERATE
rgen_dir=$(top_srcdir)/rubygen
rgen_cmd=ruby -I $(rgen_dir) $(rgen_dir)/generate $(srcdir)/gen $(specs) all $(srcdir)/rubygen.mk
+# Management generator.
+mgen_dir=$(top_srcdir)/managementgen
+mgen_cmd=$(mgen_dir)/main.py -o $(srcdir)/gen/qpid/management \
+ -t $(top_srcdir)/../specs/management-types.xml \
+ -s $(top_srcdir)/../specs/management-schema.xml \
+ -i $(mgen_dir)/templates -m $(srcdir)/managementgen.mk
+
endif # GENERATE
include $(srcdir)/rubygen.mk
+include $(srcdir)/managementgen.mk
-DISTCLEANFILES=rubygen.mk
+DISTCLEANFILES=rubygen.mk managementgen.mk
# Code generated by C++
noinst_PROGRAMS=generate_MaxMethodBodySize_h
@@ -137,6 +145,7 @@ libqpidcommon_la_SOURCES = \
libqpidbroker_la_LIBADD = libqpidcommon.la -lboost_iostreams
libqpidbroker_la_SOURCES = \
+ $(mgen_broker_cpp) \
qpid/broker/Broker.cpp \
qpid/broker/BrokerAdapter.cpp \
qpid/broker/BrokerSingleton.cpp \
@@ -189,12 +198,10 @@ libqpidbroker_la_SOURCES = \
qpid/broker/TxBuffer.cpp \
qpid/broker/TxPublish.cpp \
qpid/broker/Vhost.cpp \
- qpid/management/Broker.cpp \
+ qpid/management/Manageable.cpp \
qpid/management/ManagementAgent.cpp \
qpid/management/ManagementExchange.cpp \
- qpid/management/ManagementObject.cpp \
- qpid/management/Queue.cpp \
- qpid/management/Vhost.cpp
+ qpid/management/ManagementObject.cpp
libqpidclient_la_LIBADD = libqpidcommon.la
libqpidclient_la_SOURCES = \
@@ -383,15 +390,11 @@ nobase_include_HEADERS = \
qpid/log/Options.h \
qpid/log/Selector.h \
qpid/log/Statement.h \
- qpid/management/ArgsBrokerEcho.h \
qpid/management/Args.h \
- qpid/management/Broker.h \
qpid/management/Manageable.h \
qpid/management/ManagementAgent.h \
qpid/management/ManagementExchange.h \
qpid/management/ManagementObject.h \
- qpid/management/Queue.h \
- qpid/management/Vhost.h \
qpid/sys/Acceptor.h \
qpid/sys/AsynchIO.h \
qpid/sys/AtomicCount.h \
diff --git a/cpp/src/qpid/broker/Broker.cpp b/cpp/src/qpid/broker/Broker.cpp
index d61100d255..4e22cb7352 100644
--- a/cpp/src/qpid/broker/Broker.cpp
+++ b/cpp/src/qpid/broker/Broker.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "config.h"
#include "Broker.h"
#include "Connection.h"
#include "DirectExchange.h"
@@ -124,7 +125,19 @@ Broker::Broker(const Broker::Options& conf) :
managementAgent = ManagementAgent::getAgent ();
managementAgent->setInterval (conf.mgmtPubInterval);
- mgmtObject = management::Broker::shared_ptr (new management::Broker (this, conf));
+ mgmtObject = management::Broker::shared_ptr (new management::Broker (this, 0, 0, conf.port));
+ mgmtObject->set_workerThreads (conf.workerThreads);
+ mgmtObject->set_maxConns (conf.maxConnections);
+ mgmtObject->set_connBacklog (conf.connectionBacklog);
+ mgmtObject->set_stagingThreshold (conf.stagingThreshold);
+ mgmtObject->set_storeLib (conf.store);
+ mgmtObject->set_asyncStore (conf.storeAsync);
+ mgmtObject->set_mgmtPubInterval (conf.mgmtPubInterval);
+ mgmtObject->set_initialDiskPageSize (0);
+ mgmtObject->set_initialPagesPerQueue (0);
+ mgmtObject->set_clusterName ("");
+ mgmtObject->set_version (PACKAGE_VERSION);
+
managementAgent->addObject (mgmtObject);
// Since there is currently no support for virtual hosts, a placeholder object
@@ -248,11 +261,27 @@ ManagementObject::shared_ptr Broker::GetManagementObject(void) const
return dynamic_pointer_cast<ManagementObject> (mgmtObject);
}
-Manageable::status_t Broker::ManagementMethod (uint32_t /*methodId*/,
+Manageable::status_t Broker::ManagementMethod (uint32_t methodId,
Args& /*_args*/)
{
- QPID_LOG (debug, "Broker::ManagementMethod");
- return Manageable::STATUS_OK;
+ Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
+
+ QPID_LOG (debug, "Broker::ManagementMethod [id=" << methodId << "]");
+
+ switch (methodId)
+ {
+ case management::Broker::METHOD_ECHO :
+ status = Manageable::STATUS_OK;
+ break;
+
+ case management::Broker::METHOD_JOINCLUSTER :
+ case management::Broker::METHOD_LEAVECLUSTER :
+ case management::Broker::METHOD_CRASH :
+ status = Manageable::STATUS_NOT_IMPLEMENTED;
+ break;
+ }
+
+ return status;
}
}} // namespace qpid::broker
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp
index 41a5767457..376b9367d0 100644
--- a/cpp/src/qpid/broker/Queue.cpp
+++ b/cpp/src/qpid/broker/Queue.cpp
@@ -58,7 +58,7 @@ Queue::Queue(const string& _name, bool _autodelete,
if (parent != 0)
{
mgmtObject = management::Queue::shared_ptr
- (new management::Queue (this, parent, _name, _store != 0, _autodelete));
+ (new management::Queue (this, parent, _name, _store != 0, _autodelete, 0));
ManagementAgent::shared_ptr agent = ManagementAgent::getAgent ();
agent->addObject (mgmtObject);
@@ -92,11 +92,21 @@ void Queue::deliver(intrusive_ptr<Message>& msg){
if (!enqueue(0, msg)){
push(msg);
msg->enqueueComplete();
- if (mgmtObject != 0)
- mgmtObject->enqueue (msg->contentSize ());
+ if (mgmtObject != 0) {
+ mgmtObject->inc_msgTotalEnqueues ();
+ mgmtObject->inc_byteTotalEnqueues (msg->contentSize ());
+ mgmtObject->inc_msgDepth ();
+ mgmtObject->inc_byteDepth (msg->contentSize ());
+ }
}else {
- if (mgmtObject != 0)
- mgmtObject->enqueue (msg->contentSize (), management::MSG_MASK_PERSIST);
+ if (mgmtObject != 0) {
+ mgmtObject->inc_msgTotalEnqueues ();
+ mgmtObject->inc_byteTotalEnqueues (msg->contentSize ());
+ mgmtObject->inc_msgDepth ();
+ mgmtObject->inc_byteDepth (msg->contentSize ());
+ mgmtObject->inc_msgPersistEnqueues ();
+ mgmtObject->inc_bytePersistEnqueues (msg->contentSize ());
+ }
push(msg);
}
QPID_LOG(debug, "Message " << msg << " enqueued on " << name << "[" << this << "]");
@@ -108,8 +118,15 @@ void Queue::deliver(intrusive_ptr<Message>& msg){
void Queue::recover(intrusive_ptr<Message>& msg){
push(msg);
msg->enqueueComplete(); // mark the message as enqueued
- if (mgmtObject != 0)
- mgmtObject->enqueue (msg->contentSize (), management::MSG_MASK_PERSIST);
+ if (mgmtObject != 0) {
+ mgmtObject->inc_msgTotalEnqueues ();
+ mgmtObject->inc_byteTotalEnqueues (msg->contentSize ());
+ mgmtObject->inc_msgPersistEnqueues ();
+ mgmtObject->inc_bytePersistEnqueues (msg->contentSize ());
+ mgmtObject->inc_msgDepth ();
+ mgmtObject->inc_byteDepth (msg->contentSize ());
+ }
+
if (store && !msg->isContentLoaded()) {
//content has not been loaded, need to ensure that lazy loading mode is set:
//TODO: find a nicer way to do this
@@ -118,15 +135,19 @@ void Queue::recover(intrusive_ptr<Message>& msg){
}
void Queue::process(intrusive_ptr<Message>& msg){
-
- uint32_t mask = management::MSG_MASK_TX;
-
- if (msg->isPersistent ())
- mask |= management::MSG_MASK_PERSIST;
-
push(msg);
- if (mgmtObject != 0)
- mgmtObject->enqueue (msg->contentSize (), mask);
+ if (mgmtObject != 0) {
+ mgmtObject->inc_msgTotalEnqueues ();
+ mgmtObject->inc_byteTotalEnqueues (msg->contentSize ());
+ mgmtObject->inc_msgTxnEnqueues ();
+ mgmtObject->inc_byteTxnEnqueues (msg->contentSize ());
+ mgmtObject->inc_msgDepth ();
+ mgmtObject->inc_byteDepth (msg->contentSize ());
+ if (msg->isPersistent ()) {
+ mgmtObject->inc_msgPersistEnqueues ();
+ mgmtObject->inc_bytePersistEnqueues (msg->contentSize ());
+ }
+ }
serializer.execute(dispatchCallback);
}
@@ -309,7 +330,7 @@ void Queue::consume(Consumer::ptr c, bool requestExclusive){
}
if (mgmtObject != 0){
- mgmtObject->incConsumers ();
+ mgmtObject->inc_consumers ();
}
}
@@ -321,7 +342,7 @@ void Queue::cancel(Consumer::ptr c){
cancel(c, browsers);
}
if (mgmtObject != 0){
- mgmtObject->decConsumers ();
+ mgmtObject->dec_consumers ();
}
if(exclusive == c) exclusive.reset();
}
@@ -341,12 +362,14 @@ QueuedMessage Queue::dequeue(){
msg = messages.front();
pop();
if (mgmtObject != 0){
- uint32_t mask = 0;
-
- if (msg.payload->isPersistent ())
- mask |= management::MSG_MASK_PERSIST;
-
- mgmtObject->dequeue (msg.payload->contentSize (), mask);
+ mgmtObject->inc_msgTotalDequeues ();
+ //mgmtObject->inc_byteTotalDequeues (msg->contentSize ());
+ mgmtObject->dec_msgDepth ();
+ //mgmtObject->dec_byteDepth (msg->contentSize ());
+ if (0){//msg->isPersistent ()) {
+ mgmtObject->inc_msgPersistDequeues ();
+ //mgmtObject->inc_bytePersistDequeues (msg->contentSize ());
+ }
}
}
return msg;
diff --git a/cpp/src/qpid/broker/Vhost.cpp b/cpp/src/qpid/broker/Vhost.cpp
index bf0521904f..635f345a86 100644
--- a/cpp/src/qpid/broker/Vhost.cpp
+++ b/cpp/src/qpid/broker/Vhost.cpp
@@ -28,7 +28,7 @@ Vhost::Vhost (management::Manageable* parentBroker)
if (parentBroker != 0)
{
mgmtObject = management::Vhost::shared_ptr
- (new management::Vhost (this, parentBroker));
+ (new management::Vhost (this, parentBroker, "/"));
ManagementAgent::shared_ptr agent = ManagementAgent::getAgent ();
agent->addObject (mgmtObject);
diff --git a/cpp/src/qpid/framing/AMQHeaderBody.h b/cpp/src/qpid/framing/AMQHeaderBody.h
index 524cfa1fec..96bd396330 100644
--- a/cpp/src/qpid/framing/AMQHeaderBody.h
+++ b/cpp/src/qpid/framing/AMQHeaderBody.h
@@ -62,7 +62,8 @@ class AMQHeaderBody : public AMQBody
}
void print(std::ostream& out) const {
const boost::optional<T>& p=this->OptProps<T>::props;
- Base::print(out << *p);
+ if (p) out << *p;
+ Base::print(out);
}
};
diff --git a/cpp/src/qpid/management/Args.h b/cpp/src/qpid/management/Args.h
index 75d0b4dd70..da1fb033b9 100644
--- a/cpp/src/qpid/management/Args.h
+++ b/cpp/src/qpid/management/Args.h
@@ -34,6 +34,11 @@ class Args
inline Args::~Args (void) {}
+class ArgsNone : public Args
+{
+};
+
}}
+
#endif /*!_Args_*/
diff --git a/cpp/src/qpid/management/Broker.cpp b/cpp/src/qpid/management/Broker.cpp
deleted file mode 100644
index 2c27512669..0000000000
--- a/cpp/src/qpid/management/Broker.cpp
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "config.h"
-#include "qpid/broker/Broker.h"
-#include "qpid/framing/FieldTable.h"
-#include "Broker.h"
-#include "ArgsBrokerEcho.h"
-
-using namespace qpid::management;
-using namespace qpid::sys;
-using namespace qpid::framing;
-
-bool Broker::schemaNeeded = true;
-
-Broker::Broker (Manageable* _core, const Options& _conf) :
- ManagementObject (_core, "broker")
-{
- broker::Broker::Options& conf = (broker::Broker::Options&) _conf;
-
- sysId = "sysId";
- port = conf.port;
- workerThreads = conf.workerThreads;
- maxConns = conf.maxConnections;
- connBacklog = conf.connectionBacklog;
- stagingThreshold = conf.stagingThreshold;
- storeLib = conf.store;
- asyncStore = conf.storeAsync;
- mgmtPubInterval = conf.mgmtPubInterval;
- initialDiskPageSize = 0;
- initialPagesPerQueue = 0;
- clusterName = "";
- version = PACKAGE_VERSION;
-}
-
-Broker::~Broker () {}
-
-void Broker::writeSchema (Buffer& buf)
-{
- FieldTable ft;
- FieldTable arg;
-
- schemaNeeded = false;
-
- // Schema class header:
- buf.putShortString (className); // Class Name
- buf.putShort (13); // Config Element Count
- buf.putShort (0); // Inst Element Count
- buf.putShort (1); // Method Count
- buf.putShort (0); // Event Count
-
- // Config Elements
- ft = FieldTable ();
- ft.setString ("name", "systemRef");
- ft.setInt ("type", TYPE_U64);
- ft.setInt ("access", ACCESS_RC);
- ft.setInt ("index", 1);
- ft.setString ("desc", "System ID");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "port");
- ft.setInt ("type", TYPE_U16);
- ft.setInt ("access", ACCESS_RC);
- ft.setInt ("index", 1);
- ft.setString ("desc", "TCP Port for AMQP Service");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "workerThreads");
- ft.setInt ("type", TYPE_U16);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 0);
- ft.setString ("desc", "Thread pool size");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "maxConns");
- ft.setInt ("type", TYPE_U16);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 0);
- ft.setString ("desc", "Maximum allowed connections");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "connBacklog");
- ft.setInt ("type", TYPE_U16);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 0);
- ft.setString ("desc", "Connection backlog limit for listening socket");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "stagingThreshold");
- ft.setInt ("type", TYPE_U32);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 0);
- ft.setString ("desc", "Broker stages messages over this size to disk");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "storeLib");
- ft.setInt ("type", TYPE_SSTR);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 0);
- ft.setString ("desc", "Name of persistent storage library");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "asyncStore");
- ft.setInt ("type", TYPE_U8);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 0);
- ft.setString ("desc", "Use async persistent store");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "mgmtPubInterval");
- ft.setInt ("type", TYPE_U16);
- ft.setInt ("access", ACCESS_RW);
- ft.setInt ("index", 0);
- ft.setInt ("min", 1);
- ft.setString ("unit", "second");
- ft.setString ("desc", "Interval for management broadcasts");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "initialDiskPageSize");
- ft.setInt ("type", TYPE_U32);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 0);
- ft.setString ("desc", "Number of disk pages allocated for storage");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "initialPagesPerQueue");
- ft.setInt ("type", TYPE_U32);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 0);
- ft.setString ("desc", "Number of disk pages allocated per queue");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "clusterName");
- ft.setInt ("type", TYPE_SSTR);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 0);
- ft.setString ("desc", "Name of cluster this server is a member of, zero-length for standalone server");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "version");
- ft.setInt ("type", TYPE_SSTR);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 0);
- ft.setString ("desc", "Running software version");
- buf.put (ft);
-
- // Inst Elements
-
- return; // TODO - Remove
-
- // Methods
- ft = FieldTable ();
- ft.setString ("name", "echo");
- ft.setInt ("args", 2);
-
- arg = FieldTable ();
- arg.setString ("name", "sequence");
- arg.setInt ("type", TYPE_U32);
- arg.setInt ("dir", DIR_IO);
- ft.setTable ("arg", arg);
-
- arg = FieldTable ();
- arg.setString ("name", "body");
- arg.setInt ("type", TYPE_LSTR);
- arg.setInt ("dir", DIR_IO);
- ft.setTable ("arg", arg);
-
- buf.put (ft);
-
- // Events
-}
-
-void Broker::writeConfig (Buffer& buf)
-{
- configChanged = false;
-
- writeTimestamps (buf);
- buf.putLongLong (0);
- buf.putShort (port);
- buf.putShort (workerThreads);
- buf.putShort (maxConns);
- buf.putShort (connBacklog);
- buf.putLong (stagingThreshold);
- buf.putShortString (storeLib);
- buf.putOctet (asyncStore ? 1 : 0);
- buf.putShort (mgmtPubInterval);
- buf.putLong (initialDiskPageSize);
- buf.putLong (initialPagesPerQueue);
- buf.putShortString (clusterName);
- buf.putShortString (version);
-}
-
-void Broker::doMethod (string methodName,
- Buffer& inBuf,
- Buffer& outBuf)
-{
- if (methodName.compare ("echo") == 0)
- {
- ArgsBrokerEcho args;
- uint32_t result;
-
- args.io_sequence = inBuf.getLong ();
- inBuf.getLongString (args.io_body);
-
- result = coreObject->ManagementMethod (1, args);
-
- outBuf.putLong (result);
- outBuf.putShortString ("OK");
- outBuf.putLong (args.io_sequence);
- outBuf.putLongString (args.io_body);
- }
-
- // TODO - Remove this method prior to beta
- else if (methodName.compare ("crash") == 0)
- {
- assert (0);
- }
- else
- {
- outBuf.putLong (1);
- outBuf.putShortString ("Unknown Method");
- }
-}
-
diff --git a/cpp/src/qpid/management/Broker.h b/cpp/src/qpid/management/Broker.h
deleted file mode 100644
index 2a8ef153d1..0000000000
--- a/cpp/src/qpid/management/Broker.h
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef _ManagementBroker_
-#define _ManagementBroker_
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "ManagementObject.h"
-#include "qpid/Options.h"
-#include "boost/shared_ptr.hpp"
-
-namespace qpid {
-namespace management {
-
-class Broker : public ManagementObject
-{
- public:
-
- typedef boost::shared_ptr<Broker> shared_ptr;
-
- Broker (Manageable* coreObject, const Options& conf);
- ~Broker (void);
-
- private:
-
- static bool schemaNeeded;
-
- std::string sysId;
- uint16_t port;
- uint16_t workerThreads;
- uint16_t maxConns;
- uint16_t connBacklog;
- uint32_t stagingThreshold;
- std::string storeLib;
- bool asyncStore;
- uint16_t mgmtPubInterval;
- uint32_t initialDiskPageSize;
- uint32_t initialPagesPerQueue;
- std::string clusterName;
- std::string version;
-
- 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; }
- void doMethod (std::string methodName,
- qpid::framing::Buffer& inBuf,
- qpid::framing::Buffer& outBuf);
-
- inline bool getInstChanged (void) { return false; }
-};
-
-}}
-
-
-#endif /*!_ManagementBroker_*/
diff --git a/cpp/src/qpid/management/ArgsBrokerEcho.h b/cpp/src/qpid/management/Manageable.cpp
index ad9d7e0813..c5adb22694 100644
--- a/cpp/src/qpid/management/ArgsBrokerEcho.h
+++ b/cpp/src/qpid/management/Manageable.cpp
@@ -1,6 +1,3 @@
-#ifndef _ArgsBrokerEcho_
-#define _ArgsBrokerEcho_
-
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
@@ -20,19 +17,20 @@
// under the License.
//
-#include "Args.h"
-#include <string>
+#include "Manageable.h"
-namespace qpid {
-namespace management {
+using namespace qpid::management;
-class ArgsBrokerEcho : public Args
+std::string Manageable::StatusText (status_t status)
{
- public:
- uint32_t io_sequence;
- std::string io_body;
-};
+ switch (status)
+ {
+ case STATUS_OK : return "OK";
+ case STATUS_UNKNOWN_OBJECT : return "UnknownObject";
+ case STATUS_UNKNOWN_METHOD : return "UnknownMethod";
+ case STATUS_NOT_IMPLEMENTED : return "NotImplemented";
+ }
-}}
+ return "??";
+}
-#endif /*!_ArgsBrokerEcho_*/
diff --git a/cpp/src/qpid/management/Manageable.h b/cpp/src/qpid/management/Manageable.h
index 7c9b49be9a..155b71da54 100644
--- a/cpp/src/qpid/management/Manageable.h
+++ b/cpp/src/qpid/management/Manageable.h
@@ -22,10 +22,7 @@
#include "ManagementObject.h"
#include "Args.h"
-#include "qpid/sys/Time.h"
-#include <qpid/framing/Buffer.h>
-#include <boost/shared_ptr.hpp>
-#include <map>
+#include <string>
namespace qpid {
namespace management {
@@ -39,10 +36,12 @@ class Manageable
// status_t is a type used to pass completion status from the method handler.
//
typedef uint32_t status_t;
+ static std::string StatusText (status_t status);
static const status_t STATUS_OK = 0;
static const status_t STATUS_UNKNOWN_OBJECT = 1;
static const status_t STATUS_UNKNOWN_METHOD = 2;
+ static const status_t STATUS_NOT_IMPLEMENTED = 3;
// Every "Manageable" object must hold a reference to exactly one
// management object. This object is always of a class derived from
diff --git a/cpp/src/qpid/management/ManagementAgent.cpp b/cpp/src/qpid/management/ManagementAgent.cpp
index 7aad7e7ce1..fa51a6b82a 100644
--- a/cpp/src/qpid/management/ManagementAgent.cpp
+++ b/cpp/src/qpid/management/ManagementAgent.cpp
@@ -271,8 +271,8 @@ void ManagementAgent::dispatchCommand (Deliverable& deliverable,
ManagementObjectMap::iterator iter = managementObjects.find (objId);
if (iter == managementObjects.end ())
{
- outBuffer.putLong (2);
- outBuffer.putShortString ("Invalid Object Id");
+ outBuffer.putLong (Manageable::STATUS_UNKNOWN_OBJECT);
+ outBuffer.putShortString (Manageable::StatusText (Manageable::STATUS_UNKNOWN_OBJECT));
}
else
{
diff --git a/cpp/src/qpid/management/Queue.cpp b/cpp/src/qpid/management/Queue.cpp
deleted file mode 100644
index b30ff2a6a7..0000000000
--- a/cpp/src/qpid/management/Queue.cpp
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "qpid/log/Statement.h"
-#include "qpid/framing/FieldTable.h"
-#include "Manageable.h"
-#include "Queue.h"
-
-using namespace qpid::management;
-using namespace qpid::sys;
-using namespace qpid::framing;
-
-bool Queue::schemaNeeded = true;
-
-Queue::Queue (Manageable* _core, Manageable* _parent,
- const std::string& _name,
- bool _durable, bool _autoDelete) :
- ManagementObject(_core, "queue"), name(_name),
- durable(_durable), autoDelete(_autoDelete)
-{
- vhostRef = _parent->GetManagementObject ()->getObjectId ();
-
- msgTotalEnqueues = 0;
- msgTotalDequeues = 0;
- msgTxEnqueues = 0;
- msgTxDequeues = 0;
- msgPersistEnqueues = 0;
- msgPersistDequeues = 0;
-
- msgDepth = 0;
- msgDepthLow = 0;
- msgDepthHigh = 0;
-
- byteTotalEnqueues = 0;
- byteTotalDequeues = 0;
- byteTxEnqueues = 0;
- byteTxDequeues = 0;
- bytePersistEnqueues = 0;
- bytePersistDequeues = 0;
-
- byteDepth = 0;
- byteDepthLow = 0;
- byteDepthHigh = 0;
-
- enqueueTxStarts = 0;
- enqueueTxCommits = 0;
- enqueueTxRejects = 0;
- dequeueTxStarts = 0;
- dequeueTxCommits = 0;
- dequeueTxRejects = 0;
-
- enqueueTxCount = 0;
- enqueueTxCountLow = 0;
- enqueueTxCountHigh = 0;
-
- dequeueTxCount = 0;
- dequeueTxCountLow = 0;
- dequeueTxCountHigh = 0;
-
- consumers = 0;
- consumersLow = 0;
- consumersHigh = 0;
-}
-
-Queue::~Queue () {}
-
-void Queue::writeSchema (Buffer& buf)
-{
- FieldTable ft;
-
- schemaNeeded = false;
-
- // Schema class header:
- buf.putShortString (className); // Class Name
- buf.putShort (4); // Config Element Count
- buf.putShort (33); // Inst Element Count
- buf.putShort (0); // Method Count
- buf.putShort (0); // Event Count
-
- // Config Elements
- ft = FieldTable ();
- ft.setString ("name", "vhostRef");
- ft.setInt ("type", TYPE_U64);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 1);
- ft.setString ("desc", "Virtual Host Ref");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "name");
- ft.setInt ("type", TYPE_SSTR);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 1);
- ft.setString ("desc", "Queue Name");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "durable");
- ft.setInt ("type", TYPE_U8);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 0);
- ft.setString ("desc", "Durable");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "autoDelete");
- ft.setInt ("type", TYPE_U8);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 0);
- ft.setString ("desc", "AutoDelete");
- buf.put (ft);
-
- // Inst Elements
- ft = FieldTable ();
- ft.setString ("name", "msgTotalEnqueues");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Total messages enqueued");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "msgTotalDequeues");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Total messages dequeued");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "msgTxnEnqueues");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Transactional messages enqueued");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "msgTxnDequeues");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Transactional messages dequeued");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "msgPersistEnqueues");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Persistent messages enqueued");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "msgPersistDequeues");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Persistent messages dequeued");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "msgDepth");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "Current size of queue in messages");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "msgDepthLow");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "Low-water queue size, this interval");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "msgDepthHigh");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "High-water queue size, this interval");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "byteTotalEnqueues");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Total messages enqueued");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "byteTotalDequeues");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Total messages dequeued");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "byteTxnEnqueues");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Transactional messages enqueued");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "byteTxnDequeues");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Transactional messages dequeued");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "bytePersistEnqueues");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Persistent messages enqueued");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "bytePersistDequeues");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Persistent messages dequeued");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "byteDepth");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "Current size of queue in bytes");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "byteDepthLow");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "Low-water mark this interval");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "byteDepthHigh");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "High-water mark this interval");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "enqueueTxnStarts");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Total enqueue transactions started ");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "enqueueTxnCommits");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Total enqueue transactions committed");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "enqueueTxnRejects");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Total enqueue transactions rejected");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "enqueueTxnCount");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "Current pending enqueue transactions");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "enqueueTxnCountLow");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "Low water mark this interval");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "enqueueTxnCountHigh");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "High water mark this interval");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "dequeueTxnStarts");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Total dequeue transactions started ");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "dequeueTxnCommits");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Total dequeue transactions committed");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "dequeueTxnRejects");
- ft.setInt ("type", TYPE_U64);
- ft.setString ("desc", "Total dequeue transactions rejected");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "dequeueTxnCount");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "Current pending dequeue transactions");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "dequeueTxnCountLow");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "Transaction low water mark this interval");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "dequeueTxnCountHigh");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "Transaction high water mark this interval");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "consumers");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "Current consumers on queue");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "consumersLow");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "Consumer low water mark this interval");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "consumersHigh");
- ft.setInt ("type", TYPE_U32);
- ft.setString ("desc", "Consumer high water mark this interval");
- buf.put (ft);
-}
-
-void Queue::writeConfig (Buffer& buf)
-{
- configChanged = false;
-
- writeTimestamps (buf);
- buf.putLongLong (vhostRef);
- buf.putShortString (name);
- buf.putOctet (durable ? 1 : 0);
- buf.putOctet (autoDelete ? 1 : 0);
-}
-
-void Queue::writeInstrumentation (Buffer& buf)
-{
- instChanged = false;
-
- writeTimestamps (buf);
- buf.putLongLong (msgTotalEnqueues);
- buf.putLongLong (msgTotalDequeues);
- buf.putLongLong (msgTxEnqueues);
- buf.putLongLong (msgTxDequeues);
- buf.putLongLong (msgPersistEnqueues);
- buf.putLongLong (msgPersistDequeues);
- buf.putLong (msgDepth);
- buf.putLong (msgDepthLow);
- buf.putLong (msgDepthHigh);
- buf.putLongLong (byteTotalEnqueues);
- buf.putLongLong (byteTotalDequeues);
- buf.putLongLong (byteTxEnqueues);
- buf.putLongLong (byteTxDequeues);
- buf.putLongLong (bytePersistEnqueues);
- buf.putLongLong (bytePersistDequeues);
- buf.putLong (byteDepth);
- buf.putLong (byteDepthLow);
- buf.putLong (byteDepthHigh);
- buf.putLongLong (enqueueTxStarts);
- buf.putLongLong (enqueueTxCommits);
- buf.putLongLong (enqueueTxRejects);
- buf.putLong (enqueueTxCount);
- buf.putLong (enqueueTxCountLow);
- buf.putLong (enqueueTxCountHigh);
- buf.putLongLong (dequeueTxStarts);
- buf.putLongLong (dequeueTxCommits);
- buf.putLongLong (dequeueTxRejects);
- buf.putLong (dequeueTxCount);
- buf.putLong (dequeueTxCountLow);
- buf.putLong (dequeueTxCountHigh);
- buf.putLong (consumers);
- buf.putLong (consumersLow);
- buf.putLong (consumersHigh);
-
- msgDepthLow = msgDepth;
- msgDepthHigh = msgDepth;
- byteDepthLow = byteDepth;
- byteDepthHigh = byteDepth;
- enqueueTxCountLow = enqueueTxCount;
- enqueueTxCountHigh = enqueueTxCount;
- dequeueTxCountLow = dequeueTxCount;
- dequeueTxCountHigh = dequeueTxCount;
- consumersLow = consumers;
- consumersHigh = consumers;
-}
diff --git a/cpp/src/qpid/management/Queue.h b/cpp/src/qpid/management/Queue.h
deleted file mode 100644
index 2ed43e5576..0000000000
--- a/cpp/src/qpid/management/Queue.h
+++ /dev/null
@@ -1,182 +0,0 @@
-#ifndef _ManagementQueue_
-#define _ManagementQueue_
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "ManagementObject.h"
-
-namespace qpid {
-namespace management {
-
-const uint32_t MSG_MASK_TX = 1; // Transactional message
-const uint32_t MSG_MASK_PERSIST = 2; // Persistent message
-
-class Queue : public ManagementObject
-{
- private:
-
- static bool schemaNeeded;
-
- uint64_t vhostRef;
- std::string name;
- bool durable;
- bool autoDelete;
-
- uint64_t msgTotalEnqueues; // Total messages enqueued
- uint64_t msgTotalDequeues; // Total messages dequeued
- uint64_t msgTxEnqueues; // Transactional messages enqueued
- uint64_t msgTxDequeues; // Transactional messages dequeued
- uint64_t msgPersistEnqueues; // Persistent messages enqueued
- uint64_t msgPersistDequeues; // Persistent messages dequeued
-
- uint32_t msgDepth; // Current size of queue in messages
- uint32_t msgDepthLow; // Low-water queue size, this interval
- uint32_t msgDepthHigh; // High-water queue size, this interval
-
- uint64_t byteTotalEnqueues; // Total messages enqueued
- uint64_t byteTotalDequeues; // Total messages dequeued
- uint64_t byteTxEnqueues; // Transactional messages enqueued
- uint64_t byteTxDequeues; // Transactional messages dequeued
- uint64_t bytePersistEnqueues; // Persistent messages enqueued
- uint64_t bytePersistDequeues; // Persistent messages dequeued
-
- uint32_t byteDepth; // Current size of queue in bytes
- uint32_t byteDepthLow; // Low-water mark this interval
- uint32_t byteDepthHigh; // High-water mark this interval
-
- uint64_t enqueueTxStarts; // Total enqueue transactions started
- uint64_t enqueueTxCommits; // Total enqueue transactions committed
- uint64_t enqueueTxRejects; // Total enqueue transactions rejected
-
- uint32_t enqueueTxCount; // Current pending enqueue transactions
- uint32_t enqueueTxCountLow; // Low water mark this interval
- uint32_t enqueueTxCountHigh; // High water mark this interval
-
- uint64_t dequeueTxStarts; // Total dequeue transactions started
- uint64_t dequeueTxCommits; // Total dequeue transactions committed
- uint64_t dequeueTxRejects; // Total dequeue transactions rejected
-
- uint32_t dequeueTxCount; // Current pending dequeue transactions
- uint32_t dequeueTxCountLow; // Low water mark this interval
- uint32_t dequeueTxCountHigh; // High water mark this interval
-
- uint32_t consumers; // Current consumers on queue
- uint32_t consumersLow; // Low water mark this interval
- uint32_t consumersHigh; // High water mark this interval
-
- 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; }
- void doMethod (std::string /*methodName*/,
- qpid::framing::Buffer& /*inBuf*/,
- qpid::framing::Buffer& /*outBuf*/) {}
-
- inline void adjustQueueHiLo (void){
- if (msgDepth > msgDepthHigh) msgDepthHigh = msgDepth;
- if (msgDepth < msgDepthLow) msgDepthLow = msgDepth;
-
- if (byteDepth > byteDepthHigh) byteDepthHigh = byteDepth;
- if (byteDepth < byteDepthLow) byteDepthLow = byteDepth;
- instChanged = true;
- }
-
- inline void adjustTxHiLo (void){
- if (enqueueTxCount > enqueueTxCountHigh) enqueueTxCountHigh = enqueueTxCount;
- if (enqueueTxCount < enqueueTxCountLow) enqueueTxCountLow = enqueueTxCount;
- if (dequeueTxCount > dequeueTxCountHigh) dequeueTxCountHigh = dequeueTxCount;
- if (dequeueTxCount < dequeueTxCountLow) dequeueTxCountLow = dequeueTxCount;
- instChanged = true;
- }
-
- inline void adjustConsumerHiLo (void){
- if (consumers > consumersHigh) consumersHigh = consumers;
- if (consumers < consumersLow) consumersLow = consumers;
- instChanged = true;
- }
-
- public:
-
- typedef boost::shared_ptr<Queue> shared_ptr;
-
- Queue (Manageable* coreObject, Manageable* parentObject,
- const std::string& name, bool durable, bool autoDelete);
- ~Queue (void);
-
- // The following mask contents are used to describe enqueued or dequeued
- // messages when counting statistics.
-
- inline void enqueue (uint64_t bytes, uint32_t attrMask = 0){
- msgTotalEnqueues++;
- byteTotalEnqueues += bytes;
-
- if (attrMask & MSG_MASK_TX){
- msgTxEnqueues++;
- byteTxEnqueues += bytes;
- }
-
- if (attrMask & MSG_MASK_PERSIST){
- msgPersistEnqueues++;
- bytePersistEnqueues += bytes;
- }
-
- msgDepth++;
- byteDepth += bytes;
- adjustQueueHiLo ();
- }
-
- inline void dequeue (uint64_t bytes, uint32_t attrMask = 0){
- msgTotalDequeues++;
- byteTotalDequeues += bytes;
-
- if (attrMask & MSG_MASK_TX){
- msgTxDequeues++;
- byteTxDequeues += bytes;
- }
-
- if (attrMask & MSG_MASK_PERSIST){
- msgPersistDequeues++;
- bytePersistDequeues += bytes;
- }
-
- msgDepth--;
- byteDepth -= bytes;
- adjustQueueHiLo ();
- }
-
- inline void incConsumers (void){
- consumers++;
- adjustConsumerHiLo ();
- }
-
- inline void decConsumers (void){
- consumers--;
- adjustConsumerHiLo ();
- }
-};
-
-}}
-
-
-
-#endif /*!_ManagementQueue_*/
diff --git a/cpp/src/qpid/management/Vhost.cpp b/cpp/src/qpid/management/Vhost.cpp
deleted file mode 100644
index c4fb84e8f2..0000000000
--- a/cpp/src/qpid/management/Vhost.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "Manageable.h"
-#include "Vhost.h"
-#include "qpid/framing/FieldTable.h"
-
-using namespace qpid::management;
-using namespace qpid::sys;
-using namespace qpid::framing;
-
-bool Vhost::schemaNeeded = true;
-
-Vhost::Vhost (Manageable* _core, Manageable* _parent) :
- ManagementObject (_core, "vhost"), name("/")
-{
- brokerRef = _parent->GetManagementObject ()->getObjectId ();
-}
-
-Vhost::~Vhost () {}
-
-void Vhost::writeSchema (Buffer& buf)
-{
- FieldTable ft;
-
- schemaNeeded = false;
-
- // Schema class header:
- buf.putShortString (className); // Class Name
- buf.putShort (2); // Config Element Count
- buf.putShort (0); // Inst Element Count
- buf.putShort (0); // Method Count
- buf.putShort (0); // Event Count
-
- // Config Elements
- ft = FieldTable ();
- ft.setString ("name", "brokerRef");
- ft.setInt ("type", TYPE_U64);
- ft.setInt ("access", ACCESS_RC);
- ft.setInt ("index", 1);
- ft.setString ("desc", "Broker Reference");
- buf.put (ft);
-
- ft = FieldTable ();
- ft.setString ("name", "name");
- ft.setInt ("type", TYPE_SSTR);
- ft.setInt ("access", ACCESS_RO);
- ft.setInt ("index", 1);
- ft.setString ("desc", "Name of virtual host");
- buf.put (ft);
-}
-
-void Vhost::writeConfig (Buffer& buf)
-{
- configChanged = false;
-
- writeTimestamps (buf);
- buf.putLongLong (brokerRef);
- buf.putShortString (name);
-}
-
diff --git a/cpp/src/qpid/management/Vhost.h b/cpp/src/qpid/management/Vhost.h
deleted file mode 100644
index 286514d7d7..0000000000
--- a/cpp/src/qpid/management/Vhost.h
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef _ManagementVhost_
-#define _ManagementVhost_
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "Manageable.h"
-#include "ManagementObject.h"
-#include "boost/shared_ptr.hpp"
-
-namespace qpid {
-namespace management {
-
-class Vhost : public ManagementObject
-{
- public:
-
- typedef boost::shared_ptr<Vhost> shared_ptr;
-
- Vhost (Manageable* coreObject, Manageable* parentObject);
- ~Vhost (void);
-
- private:
-
- static bool schemaNeeded;
-
- uint64_t brokerRef;
- std::string name;
-
- 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; }
- void doMethod (std::string /*methodName*/,
- qpid::framing::Buffer& /*inBuf*/,
- qpid::framing::Buffer& /*outBuf*/) {}
-
- inline bool getInstChanged (void) { return false; }
-};
-
-}}
-
-
-#endif /*!_ManagementVhost_*/