Class CompositePrincipalProvider
java.lang.Object
org.apache.jackrabbit.oak.spi.security.principal.CompositePrincipalProvider
- All Implemented Interfaces:
PrincipalProvider
PrincipalProvider implementation that aggregates a list of principal
providers into a single.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindPrincipals(int searchType) Find all principals that match the search type.findPrincipals(@Nullable String nameHint, boolean fullText, int searchType, long offset, long limit) Find the principals that match the specified nameHint and search type.findPrincipals(@Nullable String nameHint, int searchType) Find the principals that match the specified nameHint and search type.@Nullable org.apache.jackrabbit.api.security.principal.ItemBasedPrincipalgetItemBasedPrincipal(@NotNull String principalOakPath) Returns theItemBasedPrincipalwith the specifiedprincipalOakPathornullif no principal with that path exists.getMembershipPrincipals(@NotNull Principal principal) Returns an iterator over all group principals for which the given principal is either direct or indirect member of.@Nullable PrincipalgetPrincipal(@NotNull String principalName) Returns the principal with the specified name ornullif the principal does not exist.getPrincipals(@NotNull String userID) Tries to resolve the specifieduserIDto a valid principal and it's group membership.static PrincipalProviderof(@NotNull List<PrincipalProvider> providers)
-
Constructor Details
-
CompositePrincipalProvider
-
-
Method Details
-
of
-
getPrincipal
Description copied from interface:PrincipalProviderReturns the principal with the specified name ornullif the principal does not exist.- Specified by:
getPrincipalin interfacePrincipalProvider- Parameters:
principalName- the name of the principal to retrieve- Returns:
- return the requested principal or
null
-
getItemBasedPrincipal
@Nullable public @Nullable org.apache.jackrabbit.api.security.principal.ItemBasedPrincipal getItemBasedPrincipal(@NotNull @NotNull String principalOakPath) Description copied from interface:PrincipalProviderReturns theItemBasedPrincipalwith the specifiedprincipalOakPathornullif no principal with that path exists.- Specified by:
getItemBasedPrincipalin interfacePrincipalProvider- Parameters:
principalOakPath- the Oak path of theItemBasedPrincipalto retrieve- Returns:
- return the requested principal or
null
-
getMembershipPrincipals
@NotNull public @NotNull Set<Principal> getMembershipPrincipals(@NotNull @NotNull Principal principal) Description copied from interface:PrincipalProviderReturns 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:
getMembershipPrincipalsin 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
Description copied from interface:PrincipalProviderTries to resolve the specifieduserIDto a valid principal and it's group membership. This method returns an empty set if the specified ID cannot be resolved.- Specified by:
getPrincipalsin interfacePrincipalProvider- Parameters:
userID- A userID.- Returns:
- The set of principals associated with the specified
userIDor an empty set if it cannot be resolved.
-
findPrincipals
@NotNull public @NotNull Iterator<Principal> findPrincipals(@Nullable @Nullable String nameHint, int searchType) Description copied from interface:PrincipalProviderFind the principals that match the specified nameHint and search type.- Specified by:
findPrincipalsin 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 ofPrincipalManager.SEARCH_TYPE_ALL
PrincipalManager.SEARCH_TYPE_NOT_GROUP
PrincipalManager.SEARCH_TYPE_GROUP
- Returns:
- An iterator of principals.
-
findPrincipals
Description copied from interface:PrincipalProviderFind all principals that match the search type.- Specified by:
findPrincipalsin interfacePrincipalProvider- Parameters:
searchType- Limit the search to certain types of principals. Valid values are any ofPrincipalManager.SEARCH_TYPE_ALL
PrincipalManager.SEARCH_TYPE_NOT_GROUP
PrincipalManager.SEARCH_TYPE_GROUP
- Returns:
- An iterator of principals.
-
findPrincipals
@NotNull public @NotNull Iterator<? extends Principal> findPrincipals(@Nullable @Nullable String nameHint, boolean fullText, int searchType, long offset, long limit) Description copied from interface:PrincipalProviderFind the principals that match the specified nameHint and search type.- Specified by:
findPrincipalsin 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 ofPrincipalManager.SEARCH_TYPE_ALL
PrincipalManager.SEARCH_TYPE_NOT_GROUP
PrincipalManager.SEARCH_TYPE_GROUP
offset- Offset from where to start returning results.0for no offset.limit- Maximal number of results to return. -1 for no limit.- Returns:
- An iterator of principals.
-