public interface PermissionManager extends PermissionRegistry, PermissionProvider
PermissionRegistry
with functionality for mutating (managing) the registered entries.
A PermissionManager
is also a relaying implementation of a PermissionProvider
.Modifier and Type | Interface and Description |
---|---|
static class |
PermissionManager.Implementation
A simple
PermissionManager default implementation that uses a shared synchronization lock. |
Modifier and Type | Method and Description |
---|---|
static PermissionManager |
New()
Creates a new
PermissionManager instance with a PermissionProvider default implementation. |
static PermissionManager |
New(Object registryLock,
PermissionProvider permissionProvider,
HashMap<Resource,HashMap<Integer,Permission>> table)
Creates a new
PermissionManager instance with the passed PermissionProvider instance the passed
registry lock instance to be used as the internal synchronization lock and the passed table as its internal
datastructure. |
static PermissionManager |
New(PermissionProvider permissionProvider)
Creates a new
PermissionManager instance with the passed PermissionProvider instance. |
default Permission |
providePermission(Resource resource)
Provides a permission for the passed
Resource instance and a factor of 0. |
Permission |
providePermission(Resource resource,
Integer factor)
Provides a permission for the passed
Resource instance and the passed factor. |
lockPermissionRegistry, New, New, New, New, permission, permission
Permission providePermission(Resource resource, Integer factor)
Resource
instance and the passed factor.
Providing means to either return a suitable existing Permission
instance of create, register and then
return a new one.providePermission
in interface PermissionProvider
resource
- the Resource
instance to be associated.factor
- the factor of the access to the passed Resource
instance.Permission
instance satisfiying the specified values.providePermission(Resource)
default Permission providePermission(Resource resource)
Resource
instance and a factor of 0.providePermission
in interface PermissionProvider
resource
- the Resource
instance to be associated.Permission
instance associated with the passed Resource
instance.providePermission(Resource, Integer)
static PermissionManager New()
PermissionManager
instance with a PermissionProvider
default implementation.
The PermissionProvider
is used whenever providePermission(Resource, Integer)
is unable to find
an existing suitable Permission
instance.PermissionManager
instance.Permission.New(Resource, int)
,
New(PermissionProvider)
,
New(Object, PermissionProvider, HashMap)
static PermissionManager New(PermissionProvider permissionProvider)
PermissionManager
instance with the passed PermissionProvider
instance.
The PermissionProvider
is used whenever providePermission(Resource, Integer)
is unable to find
an existing suitable Permission
instance.permissionProvider
- the PermissionProvider
instance to be used to provide Permission
instances.PermissionManager
instance.New()
,
New(Object, PermissionProvider, HashMap)
static PermissionManager New(Object registryLock, PermissionProvider permissionProvider, HashMap<Resource,HashMap<Integer,Permission>> table)
PermissionManager
instance with the passed PermissionProvider
instance the passed
registry lock instance to be used as the internal synchronization lock and the passed table as its internal
datastructure.registryLock
- the synchronization lock instance to be used for concurrency handling.permissionProvider
- permissionProvider the PermissionProvider
instance to be used to provide
Permission
instances.table
- the table to be used as the internal datastructure.PermissionManager
instance.New()
,
New(PermissionProvider)