Class CompositePrincipalProvider
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.principal.CompositePrincipalProvider
-
- All Implemented Interfaces:
PrincipalProvider
public class CompositePrincipalProvider extends java.lang.Object implements PrincipalProvider
PrincipalProvider
implementation that aggregates a list of principal providers into a single.
-
-
Constructor Summary
Constructors Constructor Description CompositePrincipalProvider(java.util.List<PrincipalProvider> providers)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull java.util.Iterator<? extends java.security.Principal>
findPrincipals(int searchType)
Find all principals that match the search type.@NotNull java.util.Iterator<? extends java.security.Principal>
findPrincipals(@Nullable java.lang.String nameHint, boolean fullText, int searchType, long offset, long limit)
Find the principals that match the specified nameHint and search type.@NotNull java.util.Iterator<java.security.Principal>
findPrincipals(@Nullable java.lang.String nameHint, int searchType)
Find the principals that match the specified nameHint and search type.@Nullable ItemBasedPrincipal
getItemBasedPrincipal(@NotNull java.lang.String principalOakPath)
Returns theItemBasedPrincipal
with the specifiedprincipalOakPath
ornull
if no principal with that path exists.@NotNull java.util.Set<java.security.Principal>
getMembershipPrincipals(@NotNull java.security.Principal principal)
Returns an iterator over all group principals for which the given principal is either direct or indirect member of.@Nullable java.security.Principal
getPrincipal(@NotNull java.lang.String principalName)
Returns the principal with the specified name ornull
if the principal does not exist.@NotNull java.util.Set<java.security.Principal>
getPrincipals(@NotNull java.lang.String userID)
Tries to resolve the specifieduserID
to a valid principal and it's group membership.static PrincipalProvider
of(@NotNull java.util.List<PrincipalProvider> providers)
-
-
-
Constructor Detail
-
CompositePrincipalProvider
public CompositePrincipalProvider(java.util.List<PrincipalProvider> providers)
-
-
Method Detail
-
of
public static PrincipalProvider of(@NotNull @NotNull java.util.List<PrincipalProvider> providers)
-
getPrincipal
@Nullable public @Nullable java.security.Principal getPrincipal(@NotNull @NotNull java.lang.String principalName)
Description copied from interface:PrincipalProvider
Returns the principal with the specified name ornull
if the principal does not exist.- Specified by:
getPrincipal
in interfacePrincipalProvider
- Parameters:
principalName
- the name of the principal to retrieve- Returns:
- return the requested principal or
null
-
getItemBasedPrincipal
@Nullable public @Nullable ItemBasedPrincipal getItemBasedPrincipal(@NotNull @NotNull java.lang.String principalOakPath)
Description copied from interface:PrincipalProvider
Returns theItemBasedPrincipal
with the specifiedprincipalOakPath
ornull
if no principal with that path exists.- Specified by:
getItemBasedPrincipal
in interfacePrincipalProvider
- Parameters:
principalOakPath
- the Oak path of theItemBasedPrincipal
to retrieve- Returns:
- return the requested principal or
null
-
getMembershipPrincipals
@NotNull public @NotNull java.util.Set<java.security.Principal> getMembershipPrincipals(@NotNull @NotNull java.security.Principal principal)
Description copied from interface:PrincipalProvider
Returns an iterator over all group principals for which the given principal is either direct or indirect member of. Thus for any principal returned in the iteratorGroupPrincipal.isMember(Principal)
must returntrue
.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:
getMembershipPrincipals
in interfacePrincipalProvider
- Parameters:
principal
- the principal to return it's membership from.- Returns:
- an iterator returning all groups the given principal is member of.
- See Also:
GroupPrincipal.isMember(java.security.Principal)
-
getPrincipals
@NotNull public @NotNull java.util.Set<java.security.Principal> getPrincipals(@NotNull @NotNull java.lang.String userID)
Description copied from interface:PrincipalProvider
Tries to resolve the specifieduserID
to a valid principal and it's group membership. This method returns an empty set if the specified ID cannot be resolved.- Specified by:
getPrincipals
in interfacePrincipalProvider
- Parameters:
userID
- A userID.- Returns:
- The set of principals associated with the specified
userID
or an empty set if it cannot be resolved.
-
findPrincipals
@NotNull public @NotNull java.util.Iterator<java.security.Principal> findPrincipals(@Nullable @Nullable java.lang.String nameHint, int searchType)
Description copied from interface:PrincipalProvider
Find the principals that match the specified nameHint and search type.- Specified by:
findPrincipals
in interfacePrincipalProvider
- Parameters:
nameHint
- A name hint to use for non-exact matching.searchType
- Limit the search to certain types of principals. Valid values are any of- Returns:
- An iterator of principals.
-
findPrincipals
@NotNull public @NotNull java.util.Iterator<? extends java.security.Principal> findPrincipals(int searchType)
Description copied from interface:PrincipalProvider
Find all principals that match the search type.- Specified by:
findPrincipals
in interfacePrincipalProvider
- Parameters:
searchType
- Limit the search to certain types of principals. Valid values are any of- Returns:
- An iterator of principals.
-
findPrincipals
@NotNull public @NotNull java.util.Iterator<? extends java.security.Principal> findPrincipals(@Nullable @Nullable java.lang.String nameHint, boolean fullText, int searchType, long offset, long limit)
Description copied from interface:PrincipalProvider
Find the principals that match the specified nameHint and search type.- Specified by:
findPrincipals
in interfacePrincipalProvider
- Parameters:
nameHint
- A name hint to use for non-exact matching.fullText
- hint to use a full text query for searchsearchType
- Limit the search to certain types of principals. Valid values are any ofoffset
- Offset from where to start returning results.0
for no offset.limit
- Maximal number of results to return. -1 for no limit.- Returns:
- An iterator of principals.
-
-