public final class JndiPermission extends Permission
This permission does not span into bound nested contexts; such contexts may be governed by their own permission scheme.
The name
segment of the permission is a JNDI path whose segments are separated by /
characters. The
name may be preceded with the string java:
for compatibility with previous schemes. A name of
<<ALL BINDINGS>>
is translated to -
for compatibility reasons.
Modifier and Type | Field and Description |
---|---|
static int |
ACTION_ADD_NAMING_LISTENER
The bitwise encoding of the
addNamingListener action. |
static int |
ACTION_ALL
The bitwise encoding of the
* action. |
static int |
ACTION_BIND
The bitwise encoding of the
bind action. |
static int |
ACTION_CREATE_SUBCONTEXT
The bitwise encoding of the
createSubcontext action. |
static int |
ACTION_DESTROY_SUBCONTEXT
The bitwise encoding of the
destroySubcontext action. |
static int |
ACTION_LIST
The bitwise encoding of the
list action. |
static int |
ACTION_LIST_BINDINGS
The bitwise encoding of the
listBindings action. |
static int |
ACTION_LOOKUP
The bitwise encoding of the
lookup action. |
static int |
ACTION_REBIND
The bitwise encoding of the
rebind action. |
static int |
ACTION_UNBIND
The bitwise encoding of the
unbind action. |
Constructor and Description |
---|
JndiPermission(String name,
int actionBits)
Construct a new instance using an action bitmask.
|
JndiPermission(String name,
String actions)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(JndiPermission other)
Determine whether this object is equal to another.
|
boolean |
equals(Object other)
Determine whether this object is equal to another.
|
int |
getActionBits()
Get the action bits.
|
String |
getActions()
Get the actions string.
|
int |
hashCode()
Get the hash code of this permission.
|
boolean |
implies(JndiPermission permission)
Determine if this permission implies the other permission.
|
boolean |
implies(Permission permission)
Determine if this permission implies the other permission.
|
boolean |
implies(String name,
int actionBits)
Determine if this permission implies the given
actionsBits on the given name . |
boolean |
implies(String name,
String actions)
Determine if this permission implies the given
actions on the given name . |
PermissionCollection |
newPermissionCollection()
Construct a new type-specific permission collection.
|
JndiPermission |
withActions(int actionBits)
Return a permission which is equal to this one except with additional action bits.
|
JndiPermission |
withActions(String actions)
Return a permission which is equal to this one except with additional actions.
|
JndiPermission |
withNewActions(int actionBits)
Return a permission which is equal to this one except with its actions reset to
actionBits . |
JndiPermission |
withNewActions(String actions)
Return a permission which is equal to this one except with its actions reset to
actions . |
JndiPermission |
withoutActions(int actionBits)
Return a permission which is equal to this one except without some action bits.
|
JndiPermission |
withoutActions(String actions)
Return a permission which is equal to this one except without some actions.
|
checkGuard, getName, toString
public static final int ACTION_BIND
bind
action.public static final int ACTION_REBIND
rebind
action.public static final int ACTION_UNBIND
unbind
action.public static final int ACTION_LOOKUP
lookup
action.public static final int ACTION_LIST
list
action.public static final int ACTION_LIST_BINDINGS
listBindings
action.public static final int ACTION_CREATE_SUBCONTEXT
createSubcontext
action.public static final int ACTION_DESTROY_SUBCONTEXT
destroySubcontext
action.public static final int ACTION_ADD_NAMING_LISTENER
addNamingListener
action.public static final int ACTION_ALL
*
action. This value is the bitwise-OR of all of the other action bits.public JndiPermission(String name, String actions)
name
- the path name (must not be null
)actions
- the actions (must not be null
)public JndiPermission(String name, int actionBits)
ACTION_ALL
, it
is stripped.name
- the path name (must not be null
)actionBits
- the action bitspublic boolean implies(Permission permission)
implies
in class Permission
permission
- the other permissiontrue
if this permission implies the other, false
if it does not or permission
is null
public boolean implies(JndiPermission permission)
permission
- the other permissiontrue
if this permission implies the other, false
if it does not or permission
is null
public boolean implies(String name, String actions)
actions
on the given name
.name
- the name (must not be null
)actions
- the actions (must not be null
)true
if this permission implies the actions
on the name
, false
otherwisepublic boolean implies(String name, int actionBits)
actionsBits
on the given name
.name
- the name (must not be null
)actionBits
- the action bitstrue
if this permission implies the actionBits
on the name
, false
otherwisepublic boolean equals(Object other)
equals
in class Permission
other
- the other objecttrue
if they are equal, false
otherwisepublic boolean equals(JndiPermission other)
other
- the other objecttrue
if they are equal, false
otherwisepublic int hashCode()
hashCode
in class Permission
public String getActions()
getActions
in class Permission
null
)public int getActionBits()
public JndiPermission withNewActions(int actionBits)
actionBits
. If the given
actionBits
equals the current bits of this permission, then this permission instance is returned; otherwise
a new permission is constructed. Any action bits which fall outside of ACTION_ALL
are silently ignored.actionBits
- the action bits to usenull
)public JndiPermission withNewActions(String actions)
actions
. If the given
actions
equals the current actions of this permission, then this permission instance is returned; otherwise
a new permission is constructed.actions
- the actions to use (must not be null
)null
)public JndiPermission withActions(int actionBits)
actionBits
do not add any new actions, then this permission instance is returned; otherwise a new permission is constructed.
Any action bits which fall outside of ACTION_ALL
are silently ignored.actionBits
- the action bits to addnull
)public JndiPermission withActions(String actions)
actionBits
do not add any new actions, then this permission instance is returned; otherwise a new permission is constructed.actions
- the actions to add (must not be null
)null
)public JndiPermission withoutActions(int actionBits)
actionBits
do not remove any actions, then this permission instance is returned; otherwise a new permission is constructed.
Any action bits which fall outside of ACTION_ALL
are silently ignored.actionBits
- the action bits to removenull
)public JndiPermission withoutActions(String actions)
actions
do not remove any actions, then this permission instance is returned; otherwise a new permission is constructed.actions
- the actions to remove (must not be null
)null
)public PermissionCollection newPermissionCollection()
newPermissionCollection
in class Permission
null
)Copyright © 2018 JBoss by Red Hat. All rights reserved.