|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.security.principal.AbstractPrincipalProvider
org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider
public class DefaultPrincipalProvider
Provides principals for the users contained within the Repository.
EachAuthorizable accessible via UserManager
is respected and the provider serves Principals retrieved from those Authorizable objects.
In addition this provider exposes the everyone principal, which has no
content (user/group) represention.
| Field Summary |
|---|
| Fields inherited from class org.apache.jackrabbit.core.security.principal.AbstractPrincipalProvider |
|---|
MAXSIZE_KEY |
| Constructor Summary | |
|---|---|
DefaultPrincipalProvider(Session securitySession,
UserManagerImpl userManager)
Creates a new DefaultPrincipalProvider reading the principals from the storage below the given security root node. |
|
| Method Summary | |
|---|---|
boolean |
canReadPrincipal(Session session,
Principal principal)
Tests if the provided session is allowed to read the given principal. |
void |
close()
Clears the cache and calls the implementation to close their resources |
PrincipalIterator |
findPrincipals(String simpleFilter)
Searches for Principals that match the given String. |
PrincipalIterator |
findPrincipals(String simpleFilter,
int searchType)
Searches for Principals that match the given String. |
PrincipalIterator |
getGroupMembership(Principal userPrincipal)
Returns an iterator over all group principals for which the given principal is either direct or indirect member of. |
PrincipalIterator |
getPrincipals(int searchType)
Returns an iterator over all principals that match the given search type. |
void |
onEvent(EventIterator eventIterator)
|
protected Principal |
providePrincipal(String principalName)
Called if the cache does not contain the principal requested. Implementations should return a Principal from their source,
if it contains one for the given name or null. |
| Methods inherited from class org.apache.jackrabbit.core.security.principal.AbstractPrincipalProvider |
|---|
addToCache, checkInitialized, clearCache, getPrincipal, init |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultPrincipalProvider(Session securitySession,
UserManagerImpl userManager)
throws RepositoryException
securitySession - for repository access.userManager - Used to retrieve the principals.
RepositoryException - if an error accessing the repository occurs.| Method Detail |
|---|
protected Principal providePrincipal(String principalName)
Principal from their source,
if it contains one for the given name or null.
This implementation uses the user and node resolver to find the
appropriate nodes.
providePrincipal in class AbstractPrincipalProviderprincipalName - Name of the principal to be returned.
AbstractPrincipalProvider.getPrincipal(String)public PrincipalIterator findPrincipals(String simpleFilter)
PrincipalProviderPrincipals that match the given String.
NOTE: Groups are included in the search result.
findPrincipals in interface PrincipalProviderPrincipalProvider.findPrincipals(String)
public PrincipalIterator findPrincipals(String simpleFilter,
int searchType)
PrincipalProviderPrincipals that match the given String.
findPrincipals in interface PrincipalProvidersearchType - searchType Any of the following constants:
PrincipalProvider.findPrincipals(String, int)public PrincipalIterator getPrincipals(int searchType)
PrincipalProvider
getPrincipals in interface PrincipalProvidersearchType - Any of the following search types:
PrincipalProvider.getPrincipals(int),
PrincipalProvider.getPrincipals(int)public PrincipalIterator getGroupMembership(Principal userPrincipal)
PrincipalProviderGroup.isMember(Principal)
evaluates to true. A principal is an indirect member of a
group if any of its groups (to any degree of separation) is direct memeber
of the group.
Example:
getGroupMembership in interface PrincipalProvideruserPrincipal - the principal to return it's membership from.
PrincipalProvider.getGroupMembership(Principal)public void close()
AbstractPrincipalProvider
close in interface PrincipalProviderclose in class AbstractPrincipalProviderPrincipalProvider.close()
public boolean canReadPrincipal(Session session,
Principal principal)
PrincipalProvider
canReadPrincipal in interface PrincipalProviderprincipal - The principal to be accessed by the specified subject.
true if the session is allowed to read the principal;
false otherwise.PrincipalProvider.canReadPrincipal(javax.jcr.Session,java.security.Principal)public void onEvent(EventIterator eventIterator)
onEvent in interface EventListenerEventListener.onEvent(EventIterator)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||