C
- the type of the credentials instance to be authenticated.R
- the type of the result/response instance to be returned upon an authentication attempt.public static final class XdevSecurityManager.Implementation<C,R> extends Object implements XdevSecurityManager<C,R>
XdevSecurityManager
implementation that wraps delegate Authenticator
and
AuthorizationManager
instances.
This implementation is immutable.
XdevSecurityManager.Implementation<C,R>
AuthorizationManager.Builder
Modifier and Type | Method and Description |
---|---|
R |
authenticate(C credentials)
Tries to authenticate the passed credentials and returns an apropriate
result.
|
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)
Looks up the
Permission instance representing the passed Resource instance with a factor of 0. |
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)
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. |
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
New
lambda, sequence, then
Builder, New, New, NewFromXmlFile
New, New, New
New, New, New
New, New, New, New
New, New, New, New
New, New, New
New, New, New, New
New, New, New
public final R authenticate(C credentials) throws AuthenticationFailedException
authenticate
in interface Authenticator<C,R>
credentials
- the credentials to be authenticatedAuthenticationFailedException
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 Permission providePermission(Resource resource)
Resource
instance and a factor of 0.providePermission
in interface PermissionManager
providePermission
in interface PermissionProvider
resource
- the Resource
instance to be associated.Permission
instance associated with the passed Resource
instance.PermissionManager.providePermission(Resource, Integer)
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 Object lockPermissionRegistry()
lockPermissionRegistry
in interface PermissionRegistry
public final Object lockRoleRegistry()
lockRoleRegistry
in interface RoleRegistry
public final Object lockSubjectRegistry()
lockSubjectRegistry
in interface SubjectRegistry
public final Permission permission(Resource resource)
Permission
instance representing the passed Resource
instance with a factor of 0.
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.Permission
instance specified by the passed Resource
instance.public final AuthorizationRegistry authorizationRegistry()
authorizationRegistry
in interface AuthorizationManager
AuthorizationRegistry
instance, possibly this instance itself.public final void reloadAuthorizations()
reloadAuthorizations
in interface AuthorizationManager