Package io.hawt.jmx
Class JMXSecurity
java.lang.Object
io.hawt.util.MBeanSupport
io.hawt.jmx.JMXSecurity
- All Implemented Interfaces:
JMXSecurityMBean
Dummy version that implements JMXSecurityMBean that lets the current user
invoke anything
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.hawt.jmx.JMXSecurityMBean
JMXSecurityMBean.SecurityMBeanOpenTypeInitializer -
Field Summary
Fields inherited from interface io.hawt.jmx.JMXSecurityMBean
CAN_INVOKE_RESULT_COLUMNS, CAN_INVOKE_RESULT_ROW_TYPE, CAN_INVOKE_TABULAR_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether the current user can invoke any methods on a JMX MBean.booleanChecks whether the current user can invoke any overload of the given method.booleanChecks whether the current user can invoke the given method.Bulk operation to check whether the current user can access the requested MBeans or invoke the requested methods.protected StringMethods inherited from class io.hawt.util.MBeanSupport
destroy, getMBeanServer, getObjectName, init, setMBeanServer, setObjectName
-
Constructor Details
-
JMXSecurity
public JMXSecurity()
-
-
Method Details
-
canInvoke
Description copied from interface:JMXSecurityMBeanChecks whether the current user can invoke any methods on a JMX MBean.- Specified by:
canInvokein interfaceJMXSecurityMBean- Parameters:
objectName- The Object Name of the JMX MBean.- Returns:
trueif there is at least one method on the MBean that the user can invoke.
-
canInvoke
Description copied from interface:JMXSecurityMBeanChecks whether the current user can invoke any overload of the given method.- Specified by:
canInvokein interfaceJMXSecurityMBean- Parameters:
objectName- The Object Name of the JMX MBean.methodName- The name of the method to check.- Returns:
trueif there is an overload of the specified method that the user can invoke.
-
canInvoke
public boolean canInvoke(String objectName, String methodName, String[] argumentTypes) throws Exception Description copied from interface:JMXSecurityMBeanChecks whether the current user can invoke the given method.- Specified by:
canInvokein interfaceJMXSecurityMBean- Parameters:
objectName- The Object Name of the JMX MBean.methodName- The name of the method to check.argumentTypes- The argument types of to method.- Returns:
trueif the user is allowed to invoke the method, or any of the methods with the given name ifnullis used for the arguments. There may still be certain values that the user does not have permission to pass to the method.- Throws:
Exception
-
canInvoke
Description copied from interface:JMXSecurityMBeanBulk operation to check whether the current user can access the requested MBeans or invoke the requested methods.- Specified by:
canInvokein interfaceJMXSecurityMBean- Parameters:
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);- Returns:
- A Tabular Data object with the result. This object conforms the structure as defined
in
JMXSecurityMBean.CAN_INVOKE_TABULAR_TYPE. - Throws:
Exception
-
getDefaultObjectName
- Specified by:
getDefaultObjectNamein classMBeanSupport
-