Package org.wildfly.security.permission
Class AbstractActionPermission<This extends AbstractActionPermission<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>
- All Implemented Interfaces:
Serializable,Guard,PermissionVerifier
- Direct Known Subclasses:
AbstractActionSetPermission
public abstract class AbstractActionPermission<This extends AbstractActionPermission<This>>
extends AbstractNamedPermission<This>
An abstract base class for named permissions that have actions, with useful API and implementation methods. All
the constraints described in
AbstractNamedPermission apply.- Author:
- David M. Lloyd
- See Also:
-
Field Summary
Fields inherited from interface org.wildfly.security.permission.PermissionVerifier
ALL, NONE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstruct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanactionsEquals(String actions) Determine whether the actions of this permission are equal to the givenactions.final booleanactionsEquals(Permission permission) Determine whether the actions of this permission are equal to the actions of givenpermission.abstract booleanactionsEquals(This permission) Determine whether the actions of this permission are equal to the actions of givenpermission.protected abstract intGet the actions hash code.final booleanDetermine whether this permission is equal to another permission.final inthashCode()Get the hash code of this permission.final booleanDetermine whether this permission implies another permission.abstract booleanimpliesActions(String actions) Determine whether this permission's actions value implies the given actions value.final booleanimpliesActions(Permission permission) Determine whether this permission's actions value implies the actions of the givenpermission.abstract booleanimpliesActions(This permission) Determine whether this permission's actions value implies the actions of the givenpermission.abstract 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.withActionsFrom(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.abstract ThiswithNewActions(String actionsString) Get a permission which is identical to this one, but with new actions as given byactionsString.withNewActionsFrom(This permission) Get a permission which is identical to this one, but with new actions as given byactionsString.abstract 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.withoutActionsFrom(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.AbstractNamedPermission
impliesName, impliesName, impliesName, nameEquals, nameEquals, nameEquals, nameHashCode, withNameMethods inherited from class org.wildfly.security.permission.AbstractPermission
equals, getActions, 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
-
AbstractActionPermission
Construct a new instance.- Parameters:
name- the permission name
-
-
Method Details
-
implies
Determine whether this permission implies another permission. Returnstrueif bothimpliesActions(AbstractActionPermission)andAbstractNamedPermission.impliesName(AbstractNamedPermission)returntrue.- Overrides:
impliesin classAbstractNamedPermission<This extends AbstractActionPermission<This>>- Parameters:
permission- the other permission- Returns:
trueif this permission implies the other;falseotherwise
-
equals
Determine whether this permission is equal to another permission. Returnstrueif bothactionsEquals(AbstractActionPermission)andAbstractNamedPermission.nameEquals(AbstractNamedPermission)returntrue.- Overrides:
equalsin classAbstractNamedPermission<This extends AbstractActionPermission<This>>- Parameters:
permission- the other permission- Returns:
trueif this permission implies the other;falseotherwise
-
hashCode
public final int hashCode()Description copied from class:AbstractPermissionGet the hash code of this permission. The result must be consistent with the definedAbstractPermission.equals(AbstractPermission)result.- Overrides:
hashCodein classAbstractNamedPermission<This extends AbstractActionPermission<This>>- Returns:
- the hash code of this permission
-
actionsEquals
Determine whether the actions of this permission are equal to the givenactions.- Parameters:
actions- the actions string (must not benull)- Returns:
trueif the actions are equal,falseotherwise
-
actionsEquals
Determine whether the actions of this permission are equal to the actions of givenpermission. If the permission is not of the same type as this permission,falseis returned.- Parameters:
permission- the permission whose actions are to be compared- Returns:
trueif the actions are equal,falseotherwise
-
actionsEquals
Determine whether the actions of this permission are equal to the actions of givenpermission.- Parameters:
permission- the permission whose actions are to be compared- Returns:
trueif the actions are equal,falseotherwise
-
actionsHashCode
protected abstract int actionsHashCode()Get the actions hash code.- Returns:
- the actions hash code
-
impliesActions
Determine whether this permission's actions value implies the given actions value.- Parameters:
actions- the actions to test (must not benull)- Returns:
trueif this permission implies the other;falseotherwise
-
impliesActions
Determine whether this permission's actions value implies the actions of the givenpermission. If the permission is not of the same type as this permission,falseis returned.- Parameters:
permission- the permission whose actions are to be compared- Returns:
trueif this permission implies the other;falseotherwise
-
impliesActions
Determine whether this permission's actions value implies the actions of the givenpermission.- Parameters:
permission- the permission whose actions are to be compared- Returns:
trueif this permission implies the other;falseotherwise
-
withActions
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. The returned permission may or may not be a new instance, and may be equal to this instance.- Parameters:
actionsString- the actions string (must not benull)- Returns:
- the permission (not
null)
-
withActionsFrom
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. The returned permission may or may not be a new instance, and may be equal to this instance.- Parameters:
permission- the other permission (must not benull)- Returns:
- the permission (not
null)
-
withoutActions
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. The returned permission may or may not be a new instance, and may be equal to this instance.- Parameters:
actionsString- the actions string (must not benull)- Returns:
- the permission (not
null)
-
withoutActionsFrom
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. The returned permission may or may not be a new instance, and may be equal to this instance.- Parameters:
permission- the other permission (must not benull)- Returns:
- the permission (not
null)
-
withNewActions
Get 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.- Parameters:
actionsString- the actions string (must not benull)- Returns:
- the permission (not
null)
-
withNewActionsFrom
Get 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.- Parameters:
permission- the other permission (must not benull)- Returns:
- the permission (not
null)
-