public class OddjobJMXFileAccessController extends java.lang.Object implements OddjobJMXAccessController
MBeanServerFileAccessController
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
READONLY |
static java.lang.String |
READWRITE |
Constructor and Description |
---|
OddjobJMXFileAccessController(java.util.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(java.lang.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 |
isAccessible(javax.management.MBeanOperationInfo opInfo) |
void |
refresh()
Refresh the set of username/access level entries.
|
public static final java.lang.String READONLY
public static final java.lang.String READWRITE
public OddjobJMXFileAccessController(java.lang.String accessFileName) throws java.io.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.java.io.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.java.lang.IllegalArgumentException
- if any of the supplied access
level values differs from "readonly" or "readwrite".public OddjobJMXFileAccessController(java.util.Properties accessFileProps) throws java.io.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.java.lang.IllegalArgumentException
- if accessFileProps
is
null
or if any of the supplied access level values differs
from "readonly" or "readwrite".java.io.IOException
public boolean isAccessible(javax.management.MBeanOperationInfo opInfo)
isAccessible
in interface OddjobJMXAccessController
public void refresh() throws java.io.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.
java.io.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.java.lang.IllegalArgumentException
- if any of the supplied access
level values differs from "readonly" or "readwrite".