public interface RoleRegistry
Role
instances.
Note that a registry conceptually only provides reading access, not modifying access to its contents. For
modifying operations, see RoleManager
.Modifier and Type | Interface and Description |
---|---|
static class |
RoleRegistry.Implementation
A simple
RoleRegistry default implementation that synchronizes on a provided lock instance for
accessing the internal registry in order to avoid concurrency issues while the internal datastructure is
rebuilt. |
Modifier and Type | Method and Description |
---|---|
Object |
lockRoleRegistry()
Returns the lock instance that is internally used by this registry instance.
|
static RoleRegistry |
New(Collection<? extends Role> roles)
Creates a new
RoleRegistry instance using the passed Role instance to derive its
internal datastructure from and a newly instantiated object to be used as the synchronization lock. |
static RoleRegistry |
New(Collection<? extends Role> roles,
Object registryLock)
Creates a new
RoleRegistry instance using the passed Role instances to derive its
internal datastructure from and the passed registryLock instance as the synchronization lock for
accessing the registry. |
static RoleRegistry |
New(Map<String,Role> registry)
Creates a new
RoleRegistry instance using the passed map instance and a newly instantiated object
to be used a synchronization lock. |
static RoleRegistry |
New(Map<String,Role> registry,
Object registryLock)
Creates a new
RoleRegistry instance using the passed map instance as its internal datastructure
and the passed registryLock instance as the synchronization lock for accessing the registry. |
Role |
role(String roleName)
Returns the
Role instance identified by the passed role name. |
Map<String,Role> |
roles()
Returns a read-only map of all known
Role instances (values), identified by their names (keys). |
Map<String,Role> roles()
Role
instances (values), identified by their names (keys).Object lockRoleRegistry()
static RoleRegistry New(Map<String,Role> registry, Object registryLock)
RoleRegistry
instance using the passed map instance as its internal datastructure
and the passed registryLock instance as the synchronization lock for accessing the registry.registry
- the map instance to be used as the internal datastructure.registryLock
- the locking instance to be used to synchronize on for accessing the registry.RoleRegistry
instance using the passed instances.static RoleRegistry New(Map<String,Role> registry)
RoleRegistry
instance using the passed map instance and a newly instantiated object
to be used a synchronization lock.registry
- the map instance to be used as the internal datastructure.RoleRegistry
instance using the passed instance.static RoleRegistry New(Collection<? extends Role> roles, Object registryLock)
RoleRegistry
instance using the passed Role
instances to derive its
internal datastructure from and the passed registryLock instance as the synchronization lock for
accessing the registry.subjects
- the Role
instances to derive the internal datastructure from.registryLock
- the locking instance to be used to synchronize on for accessing the registry.RoleRegistry
instance using the passed instances.static RoleRegistry New(Collection<? extends Role> roles)
RoleRegistry
instance using the passed Role
instance to derive its
internal datastructure from and a newly instantiated object to be used as the synchronization lock.subjects
- the Role
instance to be used as the internal datastructure.RoleRegistry
instance using the passed instance.