public class JMXSecurity extends io.hawt.util.MBeanSupport implements JMXSecurityMBean
JMXSecurityMBean.SecurityMBeanOpenTypeInitializer
CAN_INVOKE_RESULT_COLUMNS, CAN_INVOKE_RESULT_ROW_TYPE, CAN_INVOKE_TABULAR_TYPE
Constructor and Description |
---|
JMXSecurity() |
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 any overload of the given method.
|
boolean |
canInvoke(String objectName,
String methodName,
String[] argumentTypes)
Checks whether the current user can invoke the given method.
|
protected String |
getDefaultObjectName() |
public boolean canInvoke(String objectName) throws Exception
JMXSecurityMBean
canInvoke
in interface JMXSecurityMBean
objectName
- The Object Name of the JMX MBean.true
if there is at least one method on the MBean that the
user can invoke.Exception
public boolean canInvoke(String objectName, String methodName) throws Exception
JMXSecurityMBean
canInvoke
in interface JMXSecurityMBean
objectName
- 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.Exception
public boolean canInvoke(String objectName, String methodName, String[] argumentTypes) throws Exception
JMXSecurityMBean
canInvoke
in interface JMXSecurityMBean
objectName
- The Object Name of the JMX MBean.methodName
- The name of the method to check.argumentTypes
- The argument types of to 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 permission to pass to the method.Exception
public TabularData canInvoke(Map<String,List<String>> bulkQuery) throws Exception
JMXSecurityMBean
canInvoke
in interface JMXSecurityMBean
bulkQuery
- A map of Object Name to requested operations. Operations can be specified
with or without arguments 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_TYPE
.Exception
protected String getDefaultObjectName()
getDefaultObjectName
in class io.hawt.util.MBeanSupport
Copyright © 2018 JBoss by Red Hat. All rights reserved.