summaryrefslogtreecommitdiff
path: root/qpid/java/broker-plugins/management-jmx
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2014-03-21 17:16:34 +0000
committerKeith Wall <kwall@apache.org>2014-03-21 17:16:34 +0000
commitd77447d7230dd29d7dc9ee0575caf1997ec3a7a6 (patch)
treea6e4dcfe2edf677b6c20bd361886edc6dfbf01d3 /qpid/java/broker-plugins/management-jmx
parent801e80d3b2361375c357b2f33feaeae77b3f8a14 (diff)
downloadqpid-python-d77447d7230dd29d7dc9ee0575caf1997ec3a7a6.tar.gz
QPID-5634: [Java Broker] Remove support for AccessPlugins at the level of the virtualhost. Introduce supports for ACLs rules that include virtualhost predicate.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1579986 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins/management-jmx')
-rw-r--r--qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/MBeanInvocationHandlerImpl.java25
1 files changed, 10 insertions, 15 deletions
diff --git a/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/MBeanInvocationHandlerImpl.java b/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/MBeanInvocationHandlerImpl.java
index 7b0a48cac1..5a7674d4fd 100644
--- a/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/MBeanInvocationHandlerImpl.java
+++ b/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/MBeanInvocationHandlerImpl.java
@@ -60,15 +60,15 @@ public class MBeanInvocationHandlerImpl implements InvocationHandler
private MBeanServer _mbs;
private final boolean _managementRightsInferAllAccess;
- private final Broker _broker;
+ private final Broker<?> _broker;
- MBeanInvocationHandlerImpl(Broker broker)
+ MBeanInvocationHandlerImpl(Broker<?> broker)
{
_managementRightsInferAllAccess = Boolean.valueOf(System.getProperty(BrokerProperties.PROPERTY_MANAGEMENT_RIGHTS_INFER_ALL_ACCESS, "true"));
_broker = broker;
}
- public static MBeanServerForwarder newProxyInstance(Broker broker)
+ public static MBeanServerForwarder newProxyInstance(Broker<?> broker)
{
final InvocationHandler handler = new MBeanInvocationHandlerImpl(broker);
final Class<?>[] interfaces = new Class[] { MBeanServerForwarder.class };
@@ -195,28 +195,23 @@ public class MBeanInvocationHandlerImpl implements InvocationHandler
String methodName;
// Get the component, type and impact, which may be null
String type = getType(method, args);
- String vhost = getVirtualHost(method, args);
+ String virtualHostName = getVirtualHost(method, args);
int impact = getImpact(method, args);
- // Get the security manager for the virtual host (if set)
- SecurityManager security;
- if (vhost == null)
+ if (virtualHostName != null)
{
- security = _broker.getSecurityManager();
- }
- else
- {
- VirtualHost virtualHost = _broker.findVirtualHostByName(vhost);
+ VirtualHost<?> virtualHost = _broker.findVirtualHostByName(virtualHostName);
if (virtualHost == null)
{
- throw new IllegalArgumentException("Virtual host with name '" + vhost + "' is not found.");
+ throw new IllegalArgumentException("Virtual host with name '" + virtualHostName + "' is not found.");
}
- security = virtualHost.getSecurityManager();
}
methodName = getMethodName(method, args);
Operation operation = (isAccessMethod(methodName) || impact == MBeanOperationInfo.INFO) ? Operation.ACCESS : Operation.UPDATE;
- security.authoriseMethod(operation, type, methodName);
+
+ SecurityManager security = _broker.getSecurityManager();
+ security.authoriseMethod(operation, type, methodName, virtualHostName);
if (_managementRightsInferAllAccess)
{