public class JMXSecurityMBeanImpl extends StandardMBean implements JMXSecurityMBean
JMXSecurityMBean.SecurityMBeanOpenTypeInitializerCAN_INVOKE_RESULT_COLUMNS, CAN_INVOKE_RESULT_ROW_TYPE, CAN_INVOKE_TABULAR_TYPE| Constructor and Description |
|---|
JMXSecurityMBeanImpl() |
| Modifier and Type | Method and Description |
|---|---|
TabularData |
canInvoke(Map<String,List<String>> bulkQuery)
Bulk operation to check whether the current user can access the requested MBeans or invoke the requested
methods.
|
boolean |
canInvoke(String objectName)
Checks whether the current user can invoke any methods on a JMX MBean.
|
boolean |
canInvoke(String objectName,
String methodName)
Checks whether the current user can invoke overload of the given method.
|
boolean |
canInvoke(String objectName,
String methodName,
String[] argumentTypes)
Checks whether the current user can invoke the given method.
|
KarafMBeanServerGuard |
getGuard() |
MBeanServer |
getMBeanServer() |
void |
setGuard(KarafMBeanServerGuard guard) |
void |
setMBeanServer(MBeanServer mbeanServer) |
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementationpublic JMXSecurityMBeanImpl()
throws NotCompliantMBeanException
NotCompliantMBeanExceptionpublic boolean canInvoke(String objectName) throws Exception
JMXSecurityMBeancanInvoke in interface JMXSecurityMBeanobjectName - the Object Name of the JMX MBean.true if there is at least one method on the MBean that the user can invoke, false else.Exceptionpublic boolean canInvoke(String objectName, String methodName) throws Exception
JMXSecurityMBeancanInvoke in interface JMXSecurityMBeanobjectName - the Object Name of the JMX MBean.methodName - the name of the method to check.true if there is an overload of the specified method that the user can invoke, false else.Exceptionpublic boolean canInvoke(String objectName, String methodName, String[] argumentTypes) throws Exception
JMXSecurityMBeancanInvoke in interface JMXSecurityMBeanobjectName - the Object Name of the JMX MBean.methodName - the name of the method to check.argumentTypes - the argument types of the method.true if the user is allowed to invoke the method, or any of the methods with the given name if
null is used for the arguments. There may still be certain values that the user does not have permissions
to pass to the method.Exceptionpublic TabularData canInvoke(Map<String,List<String>> bulkQuery) throws Exception
JMXSecurityMBeancanInvoke in interface JMXSecurityMBeanbulkQuery - a map of Object Name to requested operations. Operations can be specified with or without
argument types. An operation without arguments matches any overloaded method with this
name. If an empty list is provided for the operation names, a check is done whether the
current user can invoke any operation on the MBean.
Example:
Map<String, List<String>> query = new HashMap<>();
String objectName = "org.acme:type=SomeMBean";
query.put(objectName, Arrays.asList(
"testMethod(long,java.lang.String)", // check this testMethod
"otherMethod")); // check any overload of otherMethod
query.put("org.acme:type=SomeOtherMBean",
Collections.<String>emptyList()); // check any method of SomeOtherMBean
TabularData result = mb.canInvoke(query);
JMXSecurityMBean.CAN_INVOKE_TABULAR_TYPEExceptionpublic MBeanServer getMBeanServer()
public void setMBeanServer(MBeanServer mbeanServer)
public KarafMBeanServerGuard getGuard()
public void setGuard(KarafMBeanServerGuard guard)
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.