From 07c653a04954bc61e25557f89d5b18a3925f3dac Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Fri, 15 May 2009 19:50:47 +0000 Subject: 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 --- cpp/src/qpid/cluster/ClusterPlugin.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cpp/src/qpid/cluster/ClusterPlugin.cpp') 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(&target); + disallowManagementMethods(broker->getManagementAgent()); if (broker && cluster) cluster->initialize(); } -- cgit v1.2.1