public class ACL extends NetDB_Logger
The file is is expected to confrom to the following:
* Each line is expected to be in the format:
[access] [user name]
* [access] is expected to be "allow", or "monitor" (case insensitive). All other values evaluate to "deny".
* [user name] is expected to be the user's netid.
* Comments are allowed anywhere; must be preceded with a hashmark (#), and continue to
the end of the line.
* Any amount of whitespace between access and user name is permitted.
* Blank lines are ignored.
* Multiple entries for any name will not throw an error. The last
value encountered will be the access level for that name.
If a particular name doesn't have an entry in the ACL file, the default access level (the access level for all) will be used. By default all has the access level allow.
| Constructor and Description |
|---|
ACL(java.lang.String path,
java.lang.String name)
Create a new ACL with an age of 300 (five minutes).
|
ACL(java.lang.String path,
java.lang.String name,
long age)
Create a new ACL with an arbitrary age.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
access(java.lang.String user_name)
Fetch the access value associated with a user name.
|
long |
age()
Fetch the maximum age before this cache is considered old.
|
ACL |
age(long age)
Set the maximum age before this cache is considered old.
|
java.lang.Boolean |
has_access(java.lang.String user_name)
Transform the access string for name into a boolean value.
|
java.lang.Boolean |
has_access(java.lang.String user_name,
java.lang.String access_check)
Check if user_name has access_check access.
|
backup_logger, backup_logger, default_logger, default_logger, entered, entered, entered, exited, exited, exited, get_method_name, log_enter_exit, log_message, logger, loggerpublic ACL(java.lang.String path,
java.lang.String name)
path - Path to the ACL file on the disk.name - Name of the ACL. All instances of ACL with the same name will share the
same cache.public ACL(java.lang.String path,
java.lang.String name,
long age)
path - Path to the ACL file on the disk.name - Name of the ACL. All instances of ACL with the same name will share the
same cache.public java.lang.String access(java.lang.String user_name)
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.Boolean has_access(java.lang.String user_name)
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.Boolean has_access(java.lang.String user_name,
java.lang.String access_check)
throws java.lang.Exception
java.lang.Exceptionpublic long age()
public ACL age(long age)