public class DefaultPrincipalProvider extends AbstractPrincipalProvider implements SynchronousEventListener
Authorizable accessible via
is respected and the provider serves
Principals retrieved from those
In addition this provider exposes the everyone principal, which has no content (user/group) representation.
Unless explicitly configured (see
option this implementation of the
caches both positive and negative (null) results of the
method. The cache is kept up to date by observation listening to creation
and removal of users and groups.
In addition to the caching provided by
this implementation keeps an extra membership cache, which is notified in
case of changes made to the members of any group.
|Constructor and Description|
Creates a new DefaultPrincipalProvider reading the principals from the storage below the given security root node.
|Modifier and Type||Method and Description|
Tests if the provided session is allowed to read the given principal.
Clears the cache and calls the implementation to close their resources
Returns an iterator over all group principals for which the given principal is either direct or indirect member of.
Returns an iterator over all principals that match the given search type.
Called if the cache does not contain the principal requested.
Implementations should return a
addToCache, checkInitialized, clearCache, getPrincipal
public DefaultPrincipalProvider(Session systemSession, UserManagerImpl systemUserManager) throws RepositoryException
systemSession- for repository access.
systemUserManager- Used to retrieve the principals.
RepositoryException- if an error accessing the repository occurs.
Principalfrom their source, if it contains one for the given name or
This implementation uses the user and node resolver to find the appropriate nodes.
public void init(Properties options)
AbstractPrincipalProvider.NEGATIVE_ENTRY_KEYoption value to
trueif it isn't included yet in the passed options, before calling the init method of the base class.
public org.apache.jackrabbit.api.security.principal.PrincipalIterator findPrincipals(String simpleFilter)
Principals that match the given String. NOTE:
Groups are included in the search result.
public org.apache.jackrabbit.api.security.principal.PrincipalIterator findPrincipals(String simpleFilter, int searchType)
Principals that match the given String.
public org.apache.jackrabbit.api.security.principal.PrincipalIterator getPrincipals(int searchType)
searchType- Any of the following search types:
public org.apache.jackrabbit.api.security.principal.PrincipalIterator getGroupMembership(Principal userPrincipal)
true. A principal is an indirect member of a group if any of its groups (to any degree of separation) is direct member of the group.
If Principal is member of Group A, and Group A is member of Group B, this method will return Group A and Group B.
public void close()
principal- The principal to be accessed by the specified subject.
trueif the session is allowed to read the principal;
Copyright © 2004–2023 The Apache Software Foundation. All rights reserved.