Package org.wildfly.security.permission
Class ByNamePermissionCollection
- java.lang.Object
-
- java.security.PermissionCollection
-
- org.wildfly.security.permission.AbstractPermissionCollection
-
- org.wildfly.security.permission.ByNamePermissionCollection
-
- All Implemented Interfaces:
Serializable
,Iterable<Permission>
,PermissionVerifier
public final class ByNamePermissionCollection extends AbstractPermissionCollection
A permission collection for actionless permissions which are organized by name.- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private Permission
all
private ConcurrentHashMap<String,Permission>
byName
-
Fields inherited from interface org.wildfly.security.permission.PermissionVerifier
ALL, NONE
-
-
Constructor Summary
Constructors Constructor Description ByNamePermissionCollection(AbstractPermission<?> sourcePermission)
The source permission used to construct this collection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doAdd(AbstractPermission<?> permission)
Perform the work of adding a permission.Enumeration<Permission>
elements()
Iterate over this permission collection.private Collection<Permission>
getIterablePermissions()
boolean
implies(Permission permission)
Determine if the permission is verified by this object.Iterator<Permission>
iterator()
Iterate over this permission collection.int
size()
Get the size of this permission collection.-
Methods inherited from class org.wildfly.security.permission.AbstractPermissionCollection
add, getSourcePermission, writeReplace
-
Methods inherited from class java.security.PermissionCollection
elementsAsStream, isReadOnly, setReadOnly, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.wildfly.security.permission.PermissionVerifier
and, checkPermission, not, or, toPermissionCollection, unless, xor
-
-
-
-
Field Detail
-
byName
private final ConcurrentHashMap<String,Permission> byName
-
all
private volatile Permission all
-
-
Constructor Detail
-
ByNamePermissionCollection
public ByNamePermissionCollection(AbstractPermission<?> sourcePermission)
The source permission used to construct this collection.- Parameters:
sourcePermission
- the source permission (must not benull
)
-
-
Method Detail
-
size
public int size()
Description copied from class:AbstractPermissionCollection
Get the size of this permission collection.- Specified by:
size
in classAbstractPermissionCollection
- Returns:
- the size of this permission collection
-
iterator
public Iterator<Permission> iterator()
Description copied from class:AbstractPermissionCollection
Iterate over this permission collection.- Specified by:
iterator
in interfaceIterable<Permission>
- Specified by:
iterator
in classAbstractPermissionCollection
- Returns:
- the iterator (not
null
)
-
elements
public Enumeration<Permission> elements()
Description copied from class:AbstractPermissionCollection
Iterate over this permission collection.- Specified by:
elements
in classAbstractPermissionCollection
- Returns:
- the iterator (not
null
)
-
getIterablePermissions
private Collection<Permission> getIterablePermissions()
-
doAdd
protected void doAdd(AbstractPermission<?> permission)
Description copied from class:AbstractPermissionCollection
Perform the work of adding a permission. The permission is guaranteed to be of the correct type and the collection is guaranteed to have been writable at the time theAbstractPermissionCollection.add(Permission)
method was called.- Specified by:
doAdd
in classAbstractPermissionCollection
- Parameters:
permission
- the non-null
permission
-
implies
public boolean implies(Permission permission)
Description copied from interface:PermissionVerifier
Determine if the permission is verified by this object.- Specified by:
implies
in interfacePermissionVerifier
- Specified by:
implies
in classPermissionCollection
- Parameters:
permission
- the permission to verify (must not benull
)- Returns:
true
if the permission is implied by this verifier,false
otherwise
-
-