Class JndiPermission
java.lang.Object
java.security.Permission
org.wildfly.naming.java.permission.JndiPermission
- All Implemented Interfaces:
Serializable,Guard
Permission to access an object within the "java:" JNDI namespace.
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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe bitwise encoding of theaddNamingListeneraction.static final intThe bitwise encoding of the*action.static final intThe bitwise encoding of thebindaction.static final intThe bitwise encoding of thecreateSubcontextaction.static final intThe bitwise encoding of thedestroySubcontextaction.static final intThe bitwise encoding of thelistaction.static final intThe bitwise encoding of thelistBindingsaction.static final intThe bitwise encoding of thelookupaction.static final intThe bitwise encoding of therebindaction.static final intThe bitwise encoding of theunbindaction. -
Constructor Summary
ConstructorsConstructorDescriptionJndiPermission(String name, int actionBits) Construct a new instance using an action bitmask.JndiPermission(String name, String actions) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine whether this object is equal to another.booleanequals(JndiPermission other) Determine whether this object is equal to another.intGet the action bits.Get the actions string.inthashCode()Get the hash code of this permission.booleanDetermine if this permission implies the givenactionsBitson the givenname.booleanDetermine if this permission implies the givenactionson the givenname.booleanimplies(Permission permission) Determine if this permission implies the other permission.booleanimplies(JndiPermission permission) Determine if this permission implies the other permission.Construct a new type-specific permission collection.withActions(int actionBits) Return a permission which is equal to this one except with additional action bits.withActions(String actions) Return a permission which is equal to this one except with additional actions.withNewActions(int actionBits) Return a permission which is equal to this one except with its actions reset toactionBits.withNewActions(String actions) Return a permission which is equal to this one except with its actions reset toactions.withoutActions(int actionBits) Return a permission which is equal to this one except without some action bits.withoutActions(String actions) Return a permission which is equal to this one except without some actions.Methods inherited from class java.security.Permission
checkGuard, getName, toString
-
Field Details
-
ACTION_BIND
public static final int ACTION_BINDThe bitwise encoding of thebindaction.- See Also:
-
ACTION_REBIND
public static final int ACTION_REBINDThe bitwise encoding of therebindaction.- See Also:
-
ACTION_UNBIND
public static final int ACTION_UNBINDThe bitwise encoding of theunbindaction.- See Also:
-
ACTION_LOOKUP
public static final int ACTION_LOOKUPThe bitwise encoding of thelookupaction.- See Also:
-
ACTION_LIST
public static final int ACTION_LISTThe bitwise encoding of thelistaction.- See Also:
-
ACTION_LIST_BINDINGS
public static final int ACTION_LIST_BINDINGSThe bitwise encoding of thelistBindingsaction.- See Also:
-
ACTION_CREATE_SUBCONTEXT
public static final int ACTION_CREATE_SUBCONTEXTThe bitwise encoding of thecreateSubcontextaction.- See Also:
-
ACTION_DESTROY_SUBCONTEXT
public static final int ACTION_DESTROY_SUBCONTEXTThe bitwise encoding of thedestroySubcontextaction.- See Also:
-
ACTION_ADD_NAMING_LISTENER
public static final int ACTION_ADD_NAMING_LISTENERThe bitwise encoding of theaddNamingListeneraction.- See Also:
-
ACTION_ALL
public static final int ACTION_ALLThe bitwise encoding of the*action. This value is the bitwise-OR of all of the other action bits.- See Also:
-
-
Constructor Details
-
JndiPermission
Construct a new instance.- Parameters:
name- the path name (must not benull)actions- the actions (must not benull)
-
JndiPermission
Construct a new instance using an action bitmask. If a bit in the mask falls outside ofACTION_ALL, it is stripped.- Parameters:
name- the path name (must not benull)actionBits- the action bits
-
-
Method Details
-
implies
Determine if this permission implies the other permission.- Specified by:
impliesin classPermission- Parameters:
permission- the other permission- Returns:
trueif this permission implies the other,falseif it does not orpermissionisnull
-
implies
Determine if this permission implies the other permission.- Parameters:
permission- the other permission- Returns:
trueif this permission implies the other,falseif it does not orpermissionisnull
-
implies
Determine if this permission implies the givenactionson the givenname.- Parameters:
name- the name (must not benull)actions- the actions (must not benull)- Returns:
trueif this permission implies theactionson thename,falseotherwise
-
implies
Determine if this permission implies the givenactionsBitson the givenname.- Parameters:
name- the name (must not benull)actionBits- the action bits- Returns:
trueif this permission implies theactionBitson thename,falseotherwise
-
equals
Determine whether this object is equal to another.- Specified by:
equalsin classPermission- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
equals
Determine whether this object is equal to another.- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
hashCode
public int hashCode()Get the hash code of this permission.- Specified by:
hashCodein classPermission- Returns:
- the hash code of this permission
-
getActions
Get the actions string. The actions string will be a canonical version of the one passed in at construction.- Specified by:
getActionsin classPermission- Returns:
- the actions string (not
null)
-
getActionBits
public int getActionBits()Get the action bits.- Returns:
- the action bits
-
withNewActions
Return a permission which is equal to this one except with its actions reset toactionBits. If the givenactionBitsequals the current bits of this permission, then this permission instance is returned; otherwise a new permission is constructed. Any action bits which fall outside ofACTION_ALLare silently ignored.- Parameters:
actionBits- the action bits to use- Returns:
- a permission with only the given action bits (not
null)
-
withNewActions
Return a permission which is equal to this one except with its actions reset toactions. If the givenactionsequals the current actions of this permission, then this permission instance is returned; otherwise a new permission is constructed.- Parameters:
actions- the actions to use (must not benull)- Returns:
- a permission with only the given action bits (not
null)
-
withActions
Return a permission which is equal to this one except with additional action bits. If the givenactionBitsdo not add any new actions, then this permission instance is returned; otherwise a new permission is constructed. Any action bits which fall outside ofACTION_ALLare silently ignored.- Parameters:
actionBits- the action bits to add- Returns:
- a permission with the union of permissions from this instance and the given bits (not
null)
-
withActions
Return a permission which is equal to this one except with additional actions. If the givenactionBitsdo not add any new actions, then this permission instance is returned; otherwise a new permission is constructed.- Parameters:
actions- the actions to add (must not benull)- Returns:
- a permission with the union of permissions from this instance and the given bits (not
null)
-
withoutActions
Return a permission which is equal to this one except without some action bits. If the givenactionBitsdo not remove any actions, then this permission instance is returned; otherwise a new permission is constructed. Any action bits which fall outside ofACTION_ALLare silently ignored.- Parameters:
actionBits- the action bits to remove- Returns:
- a permission with the given bits subtracted from this instance (not
null)
-
withoutActions
Return a permission which is equal to this one except without some actions. If the givenactionsdo not remove any actions, then this permission instance is returned; otherwise a new permission is constructed.- Parameters:
actions- the actions to remove (must not benull)- Returns:
- a permission with the given bits subtracted from this instance (not
null)
-
newPermissionCollection
Construct a new type-specific permission collection.- Overrides:
newPermissionCollectionin classPermission- Returns:
- the new permission collection instance (not
null)
-