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.
|
Modifier and Type | Method and Description |
---|---|
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, toString
public 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 boolean implies(Permission p)
implies
in class Permission
p
- 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 Permission
obj
- 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 Permission
public String getActions()
getActions
will
return the string "bind,unbind".getActions
in class Permission
public 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 Permission
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.