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
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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.wildfly.security.permission.PermissionVerifier
ALL, NONE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractActionSetPermission(String name, int actionBits, org.wildfly.security.util.StringEnumeration actionEnumeration)Construct a new instance.protectedAbstractActionSetPermission(String name, String actions, org.wildfly.security.util.StringEnumeration actionEnumeration)Construct a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanactionsEquals(This permission)Determine whether the actions of this permission are equal to the actions of givenpermission.protected intactionsHashCode()Get 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.intgetActionBits()Get the action bits of this permission.StringgetActions()Get the actions string.booleanimpliesActionBits(int actionBits)Determine whether this permission's actions value implies the given action bits.booleanimpliesActions(String actions)Determine whether this permission's actions value implies the given actions value.booleanimpliesActions(This permission)Determine whether this permission's actions value implies the actions of the givenpermission.intparseActions(String actionsString)Parse the actions string into a bit set.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.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.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.ThiswithNewActionBits(int actionBits)Get a permission which is identical to this one, but with new action bits as given byactionBits.ThiswithNewActions(String actionsString)Get a permission which is identical to this one, but with new actions as given byactionsString.ThiswithNewActionsFrom(This permission)Get a permission which is identical to this one, but with new actions as given byactionsString.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.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.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, impliesActions
-
Methods inherited from class org.wildfly.security.permission.AbstractNamedPermission
impliesName, impliesName, impliesName, nameEquals, nameEquals, nameEquals, nameHashCode, withName
-
Methods inherited from class org.wildfly.security.permission.AbstractPermission
equals, implies, newPermissionCollection, requireEmptyActions
-
Methods inherited from class java.security.Permission
checkGuard, getName, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.wildfly.security.permission.PermissionVerifier
and, checkPermission, not, or, toPermissionCollection, unless, xor
-
-
-
-
Constructor Detail
-
AbstractActionSetPermission
protected AbstractActionSetPermission(String name, int actionBits, org.wildfly.security.util.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, org.wildfly.security.util.StringEnumeration actionEnumeration)
Construct a new instance.- Parameters:
name- the permission nameactions- the permission actions stringactionEnumeration- the permission actions enumeration
-
-
Method Detail
-
getActionBits
public final int getActionBits()
Get the action bits of this permission.- Returns:
- the action bits
-
actionsEquals
public final boolean actionsEquals(This permission)
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
public final boolean impliesActions(This permission)
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
public final boolean impliesActions(String actions)
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
public final String 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
public final int parseActions(String actionsString) throws IllegalArgumentException
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
public final This withActions(String actionsString)
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
public final This withActionsFrom(This permission)
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
public final This withActionBits(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. 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
public final This withoutActions(String actionsString)
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
public final This withoutActionsFrom(This permission)
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
public final This withoutActionBits(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. 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
public final This withNewActions(String actionsString)
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
public final This withNewActionsFrom(This permission)
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
public final This withNewActionBits(int actionBits)
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
protected abstract This constructWithActionBits(int actionBits)
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
-
-