public interface JMXSecurityMBean
| Modifier and Type | Interface and Description |
|---|---|
static class |
JMXSecurityMBean.SecurityMBeanOpenTypeInitializer |
| Modifier and Type | Field and Description |
|---|---|
static String[] |
CAN_INVOKE_RESULT_COLUMNS
The columns contained in a
CAN_INVOKE_RESULT_ROW_TYPE. |
static CompositeType |
CAN_INVOKE_RESULT_ROW_TYPE
A row as returned by the
CAN_INVOKE_TABULAR_TYPE. |
static TabularType |
CAN_INVOKE_TABULAR_TYPE
The Tabular Type returned by the
canInvoke(Map) operation. |
| 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.
|
static final TabularType CAN_INVOKE_TABULAR_TYPE
canInvoke(Map) operation. The rows consist of
CAN_INVOKE_RESULT_ROW_TYPE entries.
It has a composite key composed by the "ObjectName" and "Method" columns.static final CompositeType CAN_INVOKE_RESULT_ROW_TYPE
CAN_INVOKE_TABULAR_TYPE. The columns of the row are defined
by CAN_INVOKE_RESULT_COLUMNSstatic final String[] CAN_INVOKE_RESULT_COLUMNS
CAN_INVOKE_RESULT_ROW_TYPE. The data types for these columns are
as follows:
SimpleType.STRINGSimpleType.STRINGSimpleType.BOOLEANboolean canInvoke(String objectName) throws Exception
objectName - 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.Exceptionboolean canInvoke(String objectName, String methodName) throws Exception
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, false else.Exceptionboolean canInvoke(String objectName, String methodName, String[] argumentTypes) throws Exception
objectName - 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.ExceptionTabularData canInvoke(Map<String,List<String>> bulkQuery) throws Exception
bulkQuery - 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);
CAN_INVOKE_TABULAR_TYPEExceptionCopyright © 2007–2017 The Apache Software Foundation. All rights reserved.