|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.management.snmp.uacl.JdmkUserAcl
public class JdmkUserAcl
Defines an implementation of the UserAcl
interface.
In this implementation the ACL information is stored on a flat file and its default location is specified in the following order:
jdmk.uacl.file
property.
getEtcDir("conf" + File.separator + "jdmk.uacl")
in class DefaultPaths
.
Constructor Summary | |
---|---|
JdmkUserAcl(String name)
Constructs the Java Dynamic Management(TM) Access Control List based on user names. |
|
JdmkUserAcl(String name,
String fileName)
Constructs the Java Dynamic Management(TM) Access Control List based on user names. |
Method Summary | |
---|---|
boolean |
checkContextName(String context)
Checks whether or not a context name is defined. |
boolean |
checkReadPermission(String user)
Checks whether or not the specified user has READ access. |
boolean |
checkReadPermission(String user,
String context,
int securityLevel)
Checks whether or not the specified user and context name have READ access. |
boolean |
checkWritePermission(String user)
Checks whether or not the specified user has WRITE access. |
boolean |
checkWritePermission(String user,
String context,
int securityLevel)
Checks whether or not the specified user and context name have WRITE access. |
Enumeration |
entries()
Returns an enumeration of the entries in this ACL. |
String |
getAuthorizedListFile()
Returns the full path of the file used to get ACL information. |
String |
getName()
Returns the name of the ACL. |
static com.sun.management.snmp.uacl.PermissionImpl |
getREAD()
Returns the read permission instance used. |
static com.sun.management.snmp.uacl.PermissionImpl |
getWRITE()
Returns the write permission instance used. |
void |
rereadTheFile()
Resets this ACL to the values contained in the configuration file. |
void |
setAuthorizedListFile(String filename)
Sets the full path of the file containing the ACL information. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JdmkUserAcl(String name, String fileName) throws IllegalArgumentException
name
- The name of the ACL.fileName
- The name of the ACL file.
IllegalArgumentException
- If the ACL file doesn't exist.public JdmkUserAcl(String name) throws IllegalArgumentException
name
- The name of the ACL.
IllegalArgumentException
- If the ACL file doesn't exist.Method Detail |
---|
public Enumeration entries()
java.security.acl.AclEntry
.
public String getName()
getName
in interface UserAcl
public static com.sun.management.snmp.uacl.PermissionImpl getREAD()
public static com.sun.management.snmp.uacl.PermissionImpl getWRITE()
public void setAuthorizedListFile(String filename) throws IllegalArgumentException, NotOwnerException
IllegalArgumentException
is thrown, the previous existing ACL configuration is not cleared.
filename
- The full path of the file containing the ACL information.
IllegalArgumentException
- If the passed ACL file is null or doesn't exist.
NotOwnerException
- This exception is never thrown.public void rereadTheFile() throws NotOwnerException
NotOwnerException
- If the principal attempting the reset is not an owner of this ACL.public String getAuthorizedListFile()
public boolean checkReadPermission(String user)
READ
access.
checkReadPermission
in interface UserAcl
user
- The user name to check.
true
if the host has read permission, false
otherwise.public boolean checkReadPermission(String user, String context, int securityLevel)
READ
access.
checkReadPermission
in interface UserAcl
user
- The user name to check.context
- The context name associated with the user.securityLevel
- The request security level.
true
if the pair (user, context) has read permission, false
otherwise.public boolean checkContextName(String context)
checkContextName
in interface UserAcl
context
- The context to check.
true
if the context is known, false
otherwise.public boolean checkWritePermission(String user)
WRITE
access.
checkWritePermission
in interface UserAcl
user
- The user to check.
true
if the user has write permission, false
otherwise.public boolean checkWritePermission(String user, String context, int securityLevel)
WRITE
access.
checkWritePermission
in interface UserAcl
user
- The user name to check.context
- The context name associated with the user.securityLevel
- The request security level.
true
if the pair (user, context) has write permission, false
otherwise.
|
Open Source build 02 opendmk-1.0-b02 2007.10.01_19:17:46_MEST |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |