public static final class AuthorizationManager.Implementation extends Object implements AuthorizationManager
AuthorizationManager
default implementation that uses an internally created locking instance
and connects delegate PermissionManager
, RoleManager
and SubjectManager
instances to it.AuthorizationManager.Builder, AuthorizationManager.Implementation
Modifier and Type | Method and Description |
---|---|
AuthorizationRegistry |
authorizationRegistry() |
Object |
lockPermissionRegistry()
Returns the lock instance that is internally used by this registry instance.
|
Object |
lockRoleRegistry()
Returns the lock instance that is internally used by this registry instance.
|
Object |
lockSubjectRegistry()
Returns the lock instance that is internally used by this registry instance.
|
Permission |
permission(Resource resource,
Integer factor)
Looks up the
Permission instance representing the passed Resource instance with the passed
factor value. |
Permission |
providePermission(Resource resource,
Integer factor)
Provides a permission for the passed
Resource instance and the passed factor. |
void |
reloadAuthorizations()
Causes the authorization information to be reloaded and all depending data structures to be rebuilt
accordingly.
|
Resource |
resource(String name)
Returns the
Resource instance identified by the passed name. |
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). |
Subject |
subject(String subjectName)
Returns the
Subject instance identified by the passed subject name. |
Map<String,Subject> |
subjects()
Returns a read-only map of all known
Subject instances (values), identified by their names (keys). |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Builder, New, New, NewFromXmlFile
New, New, New
New, New, New, providePermission
New, New, New, New, permission
New, New, New, New
New, New, New
New, New, New, New
New, New, New
public final Object lockPermissionRegistry()
lockPermissionRegistry
in interface PermissionRegistry
public final Object lockRoleRegistry()
lockRoleRegistry
in interface RoleRegistry
public final Object lockSubjectRegistry()
lockSubjectRegistry
in interface SubjectRegistry
public final Resource resource(String name)
Resource
instance identified by the passed name.resource
in interface AuthorizationManager
name
- the name identifying the desired resource.Resource
instance identified by the passed name.public final Permission permission(Resource resource, Integer factor)
Permission
instance representing the passed Resource
instance with the passed
factor value. If no suitable Permission
instance can be found, null is returned.permission
in interface PermissionRegistry
resource
- the Resource
instance for which the associated Permission
instance shall be
returned.factor
- the factor value of the Resource
instance for which the associated Permission
instance shall be returned.Permission
instance specified by the passed values.public final Role role(String roleName)
Role
instance identified by the passed role name.role
in interface RoleRegistry
roleName
- the name identifying the desired Role
instance.Role
instance identified by the passed name.public final Subject subject(String subjectName)
Subject
instance identified by the passed subject name.subject
in interface SubjectRegistry
subjectName
- the name identifying the desired Subject
instance.Subject
instance identified by the passed name.public final 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 PermissionManager
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.PermissionManager.providePermission(Resource)
public final Map<String,Role> roles()
Role
instances (values), identified by their names (keys).roles
in interface RoleManager
roles
in interface RoleRegistry
public final Map<String,Subject> subjects()
Subject
instances (values), identified by their names (keys).subjects
in interface SubjectManager
subjects
in interface SubjectRegistry
public final AuthorizationRegistry authorizationRegistry()
authorizationRegistry
in interface AuthorizationManager
AuthorizationRegistry
instance, possibly this instance itself.public void reloadAuthorizations()
reloadAuthorizations
in interface AuthorizationManager