Class EmptyPrincipalProvider
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.principal.EmptyPrincipalProvider
-
- All Implemented Interfaces:
PrincipalProvider
public final class EmptyPrincipalProvider extends Object implements PrincipalProvider
Implementation of thePrincipalProvider
interface that never returns any principals.
-
-
Field Summary
Fields Modifier and Type Field Description static PrincipalProvider
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Iterator<? extends Principal>
findPrincipals(int searchType)
Find all principals that match the search type.@NotNull Iterator<? extends Principal>
findPrincipals(@Nullable String nameHint, int searchType)
Find the principals that match the specified nameHint and search type.@NotNull Set<Principal>
getMembershipPrincipals(@NotNull Principal principal)
Returns an iterator over all group principals for which the given principal is either direct or indirect member of.@Nullable Principal
getPrincipal(@NotNull String principalName)
Returns the principal with the specified name ornull
if the principal does not exist.@NotNull Set<? extends Principal>
getPrincipals(@NotNull String userID)
Tries to resolve the specifieduserID
to a valid principal and it's group membership.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.oak.spi.security.principal.PrincipalProvider
findPrincipals, getItemBasedPrincipal
-
-
-
-
Field Detail
-
INSTANCE
public static final PrincipalProvider INSTANCE
-
-
Method Detail
-
getPrincipal
@Nullable public @Nullable Principal getPrincipal(@NotNull @NotNull 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
-
getMembershipPrincipals
@NotNull public @NotNull Set<Principal> getMembershipPrincipals(@NotNull @NotNull 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 Set<? extends Principal> getPrincipals(@NotNull @NotNull 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 Iterator<? extends Principal> findPrincipals(@Nullable @Nullable 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 Iterator<? extends 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.
-
-