public final class JndiPermission extends Permission implements Serializable
Action instances. The possible actions are "bind", "rebind",
"unbind", "lookup", "list", "listBindings", and "createSubcontext".
Their meaning is defined as follows:
Permission,
Permissions,
PermissionCollection| Modifier and Type | Class and Description |
|---|---|
static class |
JndiPermission.Action |
| Constructor and Description |
|---|
JndiPermission(Name path,
JndiPermission.Action... actions) |
JndiPermission(String path,
JndiPermission.Action... actions)
Creates a new JndiPermission object with the specified actions.
|
JndiPermission(String path,
String actions) |
| Modifier and Type | Method and Description |
|---|---|
static void |
check(Name name,
JndiPermission.Action... actions)
A utility method to check if the current access control context possesses
the JndiPermission for given JNDI name and actions.
|
boolean |
equals(Object obj)
Checks two JndiPermission objects for equality.
|
String |
getActions()
Returns the "canonical string representation" of the actions.
|
int |
hashCode()
Returns the hash code value for this object.
|
boolean |
implies(Permission p)
Checks if this JndiPermission object "implies" the specified permission.
|
PermissionCollection |
newPermissionCollection()
Returns a new PermissionCollection object for storing JndiPermission
objects.
|
checkGuard, getName, toStringpublic JndiPermission(String path, JndiPermission.Action... actions)
'/') indicates all the files and directories contained in
that directory. A pathname that ends with "/-" indicates (recursively) all
files and subdirectories contained in that directory. The special pathname
"<<ALL BINDINGS>>" matches any file.
A pathname consisting of a single "*" indicates all the files in the
current directory, while a pathname consisting of a single "-" indicates
all the files in the current directory and (recursively) all files and
subdirectories contained in the current directory.
A pathname containing an empty string represents an empty path.path - the pathname of the file/directory.actions - the action string.IllegalArgumentException - If actions is null, empty or contains an action
other than the specified possible actions.public JndiPermission(Name path, JndiPermission.Action... actions)
public JndiPermission(String path, String actions)
path - the pathname to grant the permissionactions - the comma separated string of actions grantedThe default policy file parser ({@code sun.security.provider.PolicyFile}) requires this constructor.public static void check(Name name, JndiPermission.Action... actions)
name - the JNDI nameactions - the actions to check the permission forpublic boolean implies(Permission p)
implies in class Permissionp - the permission to check against.true if the specified permission is not
null and is implied by this object,
false otherwise.public boolean equals(Object obj)
equals in class Permissionobj - the object we are testing for equality with this object.true if obj is a JndiPermission, and has the same
pathname and actions as this JndiPermission object,
false otherwise.public int hashCode()
hashCode in class Permissionpublic String getActions()
getActions will
return the string "bind,unbind".getActions in class Permissionpublic PermissionCollection newPermissionCollection()
implies method to be implemented in an
efficient (and consistent) manner.
For example, if you have two JndiPermissions:
"/tmp/-", "bind"
"/tmp/scratch/foo", "unbind"
implies method with the
JndiPermission:
"/tmp/scratch/foo", "bind,unbind",then the
implies function must take into account both the
"/tmp/-" and "/tmp/scratch/foo" permissions, so the effective permission
is "bind,unbind", and implies returns true. The "implies"
semantics for JndiPermissions are handled properly by the
PermissionCollection object returned by this
newPermissionCollection method.newPermissionCollection in class PermissionCopyright © 2015 JBoss by Red Hat. All rights reserved.