Class FallbackPrincipalProvider
- java.lang.Object
-
- org.apache.jackrabbit.core.security.principal.FallbackPrincipalProvider
-
- All Implemented Interfaces:
PrincipalProvider
public class FallbackPrincipalProvider extends Object implements PrincipalProvider
TheFallbackPrincipalProvideris used to provide any desired principal. It is used to defined ACE for principals that are not known to the repository yet or that were deleted.
-
-
Field Summary
Fields Modifier and Type Field Description static StringOPTION_DISABLEDname of the "disabled" option.
-
Constructor Summary
Constructors Constructor Description FallbackPrincipalProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanReadPrincipal(Session session, Principal principalToRead)Tests if the provided session is allowed to read the given principal.voidclose()This is called when a provider is not longer used by the repository.PrincipalIteratorfindPrincipals(String simpleFilter)Searches forPrincipals that match the given String.PrincipalIteratorfindPrincipals(String simpleFilter, int searchType)Searches forPrincipals that match the given String.PrincipalIteratorgetGroupMembership(Principal principal)Returns an iterator over all group principals for which the given principal is either direct or indirect member of.PrincipalgetPrincipal(String principalName)Returns the principal with the given name if is known to this providerPrincipalIteratorgetPrincipals(int searchType)Returns an iterator over all principals that match the given search type.voidinit(Properties options)Initialize this provider.
-
-
-
Field Detail
-
OPTION_DISABLED
public static final String OPTION_DISABLED
name of the "disabled" option.- See Also:
- Constant Field Values
-
-
Method Detail
-
getPrincipal
public Principal getPrincipal(String principalName)
Returns the principal with the given name if is known to this provider- Specified by:
getPrincipalin interfacePrincipalProvider- Parameters:
principalName- the name of the principal to retrieve- Returns:
- a
UnknownPrincipalwith the given name.
-
findPrincipals
public PrincipalIterator findPrincipals(String simpleFilter)
Searches forPrincipals that match the given String. NOTE:Groups are included in the search result.- Specified by:
findPrincipalsin interfacePrincipalProvider- Returns:
- an empty principal iterator
- See Also:
PrincipalProvider.findPrincipals(String,int)
-
findPrincipals
public PrincipalIterator findPrincipals(String simpleFilter, int searchType)
Searches forPrincipals that match the given String.- Specified by:
findPrincipalsin interfacePrincipalProvidersearchType- searchType Any of the following constants:- Returns:
- an empty principal iterator
- See Also:
PrincipalProvider.findPrincipals(String)
-
getPrincipals
public PrincipalIterator getPrincipals(int searchType)
Returns an iterator over all principals that match the given search type.- Specified by:
getPrincipalsin interfacePrincipalProvider- Parameters:
searchType- searchType Any of the following constants:- Returns:
- an empty principal iterator
-
getGroupMembership
public PrincipalIterator getGroupMembership(Principal principal)
Returns an iterator over all group principals for which the given principal is either direct or indirect member of. If a principal is a direct member of a group, thenevaluates toGroupPrincipal.isMember(Principal)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.Example:
If Principal is member of Group A, and Group A is member of Group B, this method will return Group A and Group B.- Specified by:
getGroupMembershipin interfacePrincipalProvider- Parameters:
principal- the principal to return it's membership from.- Returns:
- an empty principal iterator
-
init
public void init(Properties options)
Initialize this provider.- Specified by:
initin interfacePrincipalProvider- Parameters:
options- the options that are set
-
close
public void close()
This is called when a provider is not longer used by the repository. An implementation can then release any resources bound to this provider, eg. disconnect from a back end system.- Specified by:
closein interfacePrincipalProvider
-
canReadPrincipal
public boolean canReadPrincipal(Session session, Principal principalToRead)
Tests if the provided session is allowed to read the given principal. Since the principal providers do not restrict the access on the principals they provide, this method is used by the PrincipalManger to ensure proper access rights for the client requesting the principals.- Specified by:
canReadPrincipalin interfacePrincipalProviderprincipalToRead- The principal to be accessed by the specified subject.- Returns:
true
-
-