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 inAbstractNamedPermission
apply.- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Fields inherited from interface org.wildfly.security.permission.PermissionVerifier
ALL, NONE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractActionPermission(String name)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
actionsEquals(String actions)
Determine whether the actions of this permission are equal to the givenactions
.boolean
actionsEquals(Permission permission)
Determine whether the actions of this permission are equal to the actions of givenpermission
.abstract boolean
actionsEquals(This permission)
Determine whether the actions of this permission are equal to the actions of givenpermission
.protected abstract int
actionsHashCode()
Get the actions hash code.boolean
equals(This permission)
Determine whether this permission is equal to another permission.int
hashCode()
Get the hash code of this permission.boolean
implies(This permission)
Determine whether this permission implies another permission.abstract boolean
impliesActions(String actions)
Determine whether this permission's actions value implies the given actions value.boolean
impliesActions(Permission permission)
Determine whether this permission's actions value implies the actions of the givenpermission
.abstract boolean
impliesActions(This permission)
Determine whether this permission's actions value implies the actions of the givenpermission
.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.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.abstract This
withNewActions(String actionsString)
Get a permission which is identical to this one, but with new actions as given byactionsString
.This
withNewActionsFrom(This permission)
Get a permission which is identical to this one, but with new actions as given byactionsString
.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.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.-
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. Returnstrue
if bothimpliesActions(AbstractActionPermission)
andAbstractNamedPermission.impliesName(AbstractNamedPermission)
returntrue
.- Overrides:
implies
in classAbstractNamedPermission<This extends AbstractActionPermission<This>>
- Parameters:
permission
- the other permission- Returns:
true
if this permission implies the other;false
otherwise
-
equals
public final boolean equals(This permission)
Determine whether this permission is equal to another permission. Returnstrue
if bothactionsEquals(AbstractActionPermission)
andAbstractNamedPermission.nameEquals(AbstractNamedPermission)
returntrue
.- Overrides:
equals
in classAbstractNamedPermission<This extends AbstractActionPermission<This>>
- Parameters:
permission
- the other permission- Returns:
true
if this permission implies the other;false
otherwise
-
hashCode
public final int hashCode()
Description copied from class:AbstractPermission
Get the hash code of this permission. The result must be consistent with the definedAbstractPermission.equals(AbstractPermission)
result.- Overrides:
hashCode
in 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:
true
if the actions are equal,false
otherwise
-
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,false
is returned.- Parameters:
permission
- the permission whose actions are to be compared- Returns:
true
if the actions are equal,false
otherwise
-
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:
true
if the actions are equal,false
otherwise
-
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:
true
if this permission implies the other;false
otherwise
-
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,false
is returned.- Parameters:
permission
- the permission whose actions are to be compared- Returns:
true
if this permission implies the other;false
otherwise
-
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:
true
if this permission implies the other;false
otherwise
-
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
)
-
-