Package org.wildfly.security.permission
Class AbstractActionSetPermission<This extends AbstractActionSetPermission<This>>
java.lang.Object
java.security.Permission
org.wildfly.security.permission.AbstractPermission<This>
org.wildfly.security.permission.AbstractNamedPermission<This>
org.wildfly.security.permission.AbstractActionPermission<This>
org.wildfly.security.permission.AbstractActionSetPermission<This>
- All Implemented Interfaces:
Serializable,Guard,PermissionVerifier
- Direct Known Subclasses:
AbstractNamingPermission
public abstract class AbstractActionSetPermission<This extends AbstractActionSetPermission<This>>
extends AbstractActionPermission<This>
An abstract base class for permissions which use a bit set to represent actions.
- Author:
- David M. Lloyd
- See Also:
-
Field Summary
Fields inherited from interface org.wildfly.security.permission.PermissionVerifier
ALL, NONE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractActionSetPermission(String name, int actionBits, StringEnumeration actionEnumeration) Construct a new instance.protectedAbstractActionSetPermission(String name, String actions, StringEnumeration actionEnumeration) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanactionsEquals(This permission) Determine whether the actions of this permission are equal to the actions of givenpermission.protected final intGet the actions hash code.protected abstract ThisconstructWithActionBits(int actionBits) Construct or return a permission of this type with the same name as this one but with the given action bits.final intGet the action bits of this permission.final StringGet the actions string.final booleanimpliesActionBits(int actionBits) Determine whether this permission's actions value implies the given action bits.final booleanimpliesActions(String actions) Determine whether this permission's actions value implies the given actions value.final booleanimpliesActions(This permission) Determine whether this permission's actions value implies the actions of the givenpermission.final intparseActions(String actionsString) Parse the actions string into a bit set.final ThiswithActionBits(int actionBits) Get a permission which is identical to this one, but with new actions which consist of the union of the actions from this permission and the action bits from the given value.final ThiswithActions(String actionsString) Get a permission which is identical to this one, but with new actions which consist of the union of the actions from this permission and the actions from the given string.final ThiswithActionsFrom(This permission) Get a permission which is identical to this one, but with new actions which consist of the union of the actions from this permission and the actions from the given permission.final ThiswithNewActionBits(int actionBits) Get a permission which is identical to this one, but with new action bits as given byactionBits.final ThiswithNewActions(String actionsString) Get a permission which is identical to this one, but with new actions as given byactionsString.final ThiswithNewActionsFrom(This permission) Get a permission which is identical to this one, but with new actions as given byactionsString.final ThiswithoutActionBits(int actionBits) Get a permission which is identical to this one, but with new actions which consist of the actions from this permission without the action bits from the given value.final ThiswithoutActions(String actionsString) Get a permission which is identical to this one, but with new actions which consist of the actions from this permission without the actions from the given string.final ThiswithoutActionsFrom(This permission) Get a permission which is identical to this one, but with new actions which consist of the actions from this permission without the actions from the given permission.Methods inherited from class org.wildfly.security.permission.AbstractActionPermission
actionsEquals, actionsEquals, equals, hashCode, implies, impliesActionsMethods inherited from class org.wildfly.security.permission.AbstractNamedPermission
impliesName, impliesName, impliesName, nameEquals, nameEquals, nameEquals, nameHashCode, withNameMethods inherited from class org.wildfly.security.permission.AbstractPermission
equals, implies, newPermissionCollection, requireEmptyActionsMethods inherited from class java.security.Permission
checkGuard, getName, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.wildfly.security.permission.PermissionVerifier
and, checkPermission, not, or, toPermissionCollection, unless, xor
-
Constructor Details
-
AbstractActionSetPermission
protected AbstractActionSetPermission(String name, int actionBits, StringEnumeration actionEnumeration) Construct a new instance. The given bits are masked byactionsMask()before being stored in the object instance.- Parameters:
name- the permission nameactionBits- the permission action bitsactionEnumeration- the permission actions enumeration
-
AbstractActionSetPermission
protected AbstractActionSetPermission(String name, String actions, StringEnumeration actionEnumeration) Construct a new instance.- Parameters:
name- the permission nameactions- the permission actions stringactionEnumeration- the permission actions enumeration
-
-
Method Details
-
getActionBits
public final int getActionBits()Get the action bits of this permission.- Returns:
- the action bits
-
actionsEquals
Description copied from class:AbstractActionPermissionDetermine whether the actions of this permission are equal to the actions of givenpermission.- Specified by:
actionsEqualsin classAbstractActionPermission<This extends AbstractActionSetPermission<This>>- Parameters:
permission- the permission whose actions are to be compared- Returns:
trueif the actions are equal,falseotherwise
-
impliesActions
Description copied from class:AbstractActionPermissionDetermine whether this permission's actions value implies the actions of the givenpermission.- Specified by:
impliesActionsin classAbstractActionPermission<This extends AbstractActionSetPermission<This>>- Parameters:
permission- the permission whose actions are to be compared- Returns:
trueif this permission implies the other;falseotherwise
-
impliesActions
Description copied from class:AbstractActionPermissionDetermine whether this permission's actions value implies the given actions value.- Specified by:
impliesActionsin classAbstractActionPermission<This extends AbstractActionSetPermission<This>>- Parameters:
actions- the actions to test (must not benull)- Returns:
trueif this permission implies the other;falseotherwise
-
impliesActionBits
public final boolean impliesActionBits(int actionBits) Determine whether this permission's actions value implies the given action bits.- Parameters:
actionBits- the actions bits to test- Returns:
trueif this permission implies the given action bits;falseotherwise
-
actionsHashCode
protected final int actionsHashCode()Description copied from class:AbstractActionPermissionGet the actions hash code.- Specified by:
actionsHashCodein classAbstractActionPermission<This extends AbstractActionSetPermission<This>>- Returns:
- the actions hash code
-
getActions
Get the actions string. The string is computed the first time this method is called, and cached thereafter.- Overrides:
getActionsin classAbstractPermission<This extends AbstractActionSetPermission<This>>- Returns:
- the actions string (not
null)
-
parseActions
Parse the actions string into a bit set.- Parameters:
actionsString- the actions string- Returns:
- the bit set
- Throws:
IllegalArgumentException- if the actions string contained an invalid name or invalid syntax
-
withActions
Description copied from class:AbstractActionPermissionGet a permission which is identical to this one, but with new actions which consist of the union of the actions from this permission and the actions from the given string. The returned permission may or may not be a new instance, and may be equal to this instance.- Specified by:
withActionsin classAbstractActionPermission<This extends AbstractActionSetPermission<This>>- Parameters:
actionsString- the actions string (must not benull)- Returns:
- the permission (not
null)
-
withActionsFrom
Description copied from class:AbstractActionPermissionGet a permission which is identical to this one, but with new actions which consist of the union of the actions from this permission and the actions from the given permission. The returned permission may or may not be a new instance, and may be equal to this instance.- Overrides:
withActionsFromin classAbstractActionPermission<This extends AbstractActionSetPermission<This>>- Parameters:
permission- the other permission (must not benull)- Returns:
- the permission (not
null)
-
withActionBits
Get a permission which is identical to this one, but with new actions which consist of the union of the actions from this permission and the action bits from the given value. The returned permission may or may not be a new instance, and may be equal to this instance.- Parameters:
actionBits- the action bits- Returns:
- the permission (not
null)
-
withoutActions
Description copied from class:AbstractActionPermissionGet a permission which is identical to this one, but with new actions which consist of the actions from this permission without the actions from the given string. The returned permission may or may not be a new instance, and may be equal to this instance.- Specified by:
withoutActionsin classAbstractActionPermission<This extends AbstractActionSetPermission<This>>- Parameters:
actionsString- the actions string (must not benull)- Returns:
- the permission (not
null)
-
withoutActionsFrom
Description copied from class:AbstractActionPermissionGet a permission which is identical to this one, but with new actions which consist of the actions from this permission without the actions from the given permission. The returned permission may or may not be a new instance, and may be equal to this instance.- Overrides:
withoutActionsFromin classAbstractActionPermission<This extends AbstractActionSetPermission<This>>- Parameters:
permission- the other permission (must not benull)- Returns:
- the permission (not
null)
-
withoutActionBits
Get a permission which is identical to this one, but with new actions which consist of the actions from this permission without the action bits from the given value. The returned permission may or may not be a new instance, and may be equal to this instance.- Parameters:
actionBits- the action bits- Returns:
- the permission (not
null)
-
withNewActions
Description copied from class:AbstractActionPermissionGet a permission which is identical to this one, but with new actions as given byactionsString. The returned permission may or may not be a new instance, and may be equal to this instance.- Specified by:
withNewActionsin classAbstractActionPermission<This extends AbstractActionSetPermission<This>>- Parameters:
actionsString- the actions string (must not benull)- Returns:
- the permission (not
null)
-
withNewActionsFrom
Description copied from class:AbstractActionPermissionGet a permission which is identical to this one, but with new actions as given byactionsString. The returned permission may or may not be a new instance, and may be equal to this instance.- Overrides:
withNewActionsFromin classAbstractActionPermission<This extends AbstractActionSetPermission<This>>- Parameters:
permission- the other permission (must not benull)- Returns:
- the permission (not
null)
-
withNewActionBits
Get a permission which is identical to this one, but with new action bits as given byactionBits. The returned permission may or may not be a new instance, and may be equal to this instance.- Parameters:
actionBits- the action bits- Returns:
- the permission (not
null)
-
constructWithActionBits
Construct or return a permission of this type with the same name as this one but with the given action bits.- Parameters:
actionBits- the action bits- Returns:
- the permission
-