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 inAbstractNamedPermissionapply.- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID-
Fields inherited from interface org.wildfly.security.permission.PermissionVerifier
ALL, NONE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractActionPermission(String name)Construct a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanactionsEquals(String actions)Determine whether the actions of this permission are equal to the givenactions.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 intactionsHashCode()Get the actions hash code.booleanequals(This permission)Determine whether this permission is equal to another permission.inthashCode()Get the hash code of this permission.booleanimplies(This permission)Determine whether this permission implies another permission.abstract booleanimpliesActions(String actions)Determine whether this permission's actions value implies the given actions value.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.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.abstract 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.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.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.AbstractNamedPermission
impliesName, impliesName, impliesName, nameEquals, nameEquals, nameEquals, nameHashCode, withName
-
Methods inherited from class org.wildfly.security.permission.AbstractPermission
equals, getActions, implies, newPermissionCollection, requireEmptyActions, writeReplace
-
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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractActionPermission
protected AbstractActionPermission(String name)
Construct a new instance.- Parameters:
name- the permission name
-
-
Method Detail
-
implies
public final boolean implies(This permission)
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
public final boolean equals(This permission)
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
public abstract boolean actionsEquals(String actions)
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
public final boolean actionsEquals(Permission permission)
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
public abstract boolean actionsEquals(This permission)
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
public abstract boolean impliesActions(String actions)
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
public final boolean impliesActions(Permission permission)
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
public abstract boolean impliesActions(This permission)
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
public abstract This withActions(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. 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
public This 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. 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
public abstract This withoutActions(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. 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
public This 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. 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
public abstract This withNewActions(String actionsString)
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
public This withNewActionsFrom(This permission)
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)
-
-