public class OddjobJMXFileAccessController extends Object implements OddjobJMXAccessController
com.sun.jmx.remote.security.MBeanServerFileAccessController| Modifier and Type | Field and Description |
|---|---|
static String |
READONLY |
static String |
READWRITE |
| Constructor and Description |
|---|
OddjobJMXFileAccessController(Properties accessFileProps)
Create a new MBeanServerAccessController that forwards all the
MBeanServer requests to the MBeanServer set by invoking the
#setMBeanServer method after doing access checks based on read and
write permissions. |
OddjobJMXFileAccessController(String accessFileName)
Create a new MBeanServerAccessController that forwards all the
MBeanServer requests to the MBeanServer set by invoking the
#setMBeanServer method after doing access checks based on read and
write permissions. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAccessable(MBeanOperationInfo opInfo) |
void |
refresh()
Refresh the set of username/access level entries.
|
public static final String READONLY
public static final String READWRITE
public OddjobJMXFileAccessController(String accessFileName) throws IOException
Create a new MBeanServerAccessController that forwards all the
MBeanServer requests to the MBeanServer set by invoking the #setMBeanServer method after doing access checks based on read and
write permissions.
This instance is initialized from the specified properties file.
accessFileName - name of the file which denotes a properties
file on disk containing the username/access level entries.IOException - if the file does not exist, is a
directory rather than a regular file, or for some other
reason cannot be opened for reading.IllegalArgumentException - if any of the supplied access
level values differs from "readonly" or "readwrite".public OddjobJMXFileAccessController(Properties accessFileProps) throws IOException
Create a new MBeanServerAccessController that forwards all the
MBeanServer requests to the MBeanServer set by invoking the #setMBeanServer method after doing access checks based on read and
write permissions.
This instance is initialized from the specified properties instance.
This constructor makes a copy of the properties instance using its
clone method and it is the copy that is consulted to check
the username and access level of an incoming connection. The original
properties object can be modified without affecting the copy. If the
refresh() method is then called, the
MBeanServerFileAccessController will make a new copy of the
properties object at that time.
accessFileProps - properties list containing the username/access
level entries.IllegalArgumentException - if accessFileProps is
null or if any of the supplied access level values differs
from "readonly" or "readwrite".IOExceptionpublic boolean isAccessable(MBeanOperationInfo opInfo)
isAccessable in interface OddjobJMXAccessControllerpublic void refresh()
throws IOException
Refresh the set of username/access level entries.
If this instance was created using the
#MBeanServerFileAccessController(String) or
#MBeanServerFileAccessController(String,MBeanServer)
constructors to specify a file from which the entries are read,
the file is re-read.
If this instance was created using the
#MBeanServerFileAccessController(Properties) or
#MBeanServerFileAccessController(Properties,MBeanServer)
constructors then a new copy of the Properties object
is made.
IOException - if the file does not exist, is a
directory rather than a regular file, or for some other
reason cannot be opened for reading.IllegalArgumentException - if any of the supplied access
level values differs from "readonly" or "readwrite".