summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/ClusterPlugin.cpp
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2009-05-15 19:50:47 +0000
committerTed Ross <tross@apache.org>2009-05-15 19:50:47 +0000
commit07c653a04954bc61e25557f89d5b18a3925f3dac (patch)
treeac2a21a8605f37698bdc7f2fb4940210df0ef81c /cpp/src/qpid/cluster/ClusterPlugin.cpp
parente5a0aff72c3117114d2572c3e3d6e77238b2263b (diff)
downloadqpid-python-07c653a04954bc61e25557f89d5b18a3925f3dac.tar.gz
from (aconway)... added facility to disable management methods.
Use this facility to disable several methods that are unsafe for clusters when running in a cluster. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@775302 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/ClusterPlugin.cpp')
-rw-r--r--cpp/src/qpid/cluster/ClusterPlugin.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/cpp/src/qpid/cluster/ClusterPlugin.cpp b/cpp/src/qpid/cluster/ClusterPlugin.cpp
index 56c50eafae..1bebbe7a43 100644
--- a/cpp/src/qpid/cluster/ClusterPlugin.cpp
+++ b/cpp/src/qpid/cluster/ClusterPlugin.cpp
@@ -146,8 +146,21 @@ struct ClusterPlugin : public Plugin {
}
}
+ void disallow(ManagementAgent* agent, const string& className, const string& methodName) {
+ string message = "Management method " + className + ":" + methodName + " is not allowed on a clustered broker.";
+ agent->disallow(className, methodName, message);
+ }
+ void disallowManagementMethods(ManagementAgent* agent) {
+ if (!agent) return;
+ disallow(agent, "queue", "purge");
+ disallow(agent, "session", "detach");
+ disallow(agent, "session", "close");
+ disallow(agent, "connection", "close");
+ }
+
void initialize(Plugin::Target& target) {
Broker* broker = dynamic_cast<Broker*>(&target);
+ disallowManagementMethods(broker->getManagementAgent());
if (broker && cluster)
cluster->initialize();
}