public final class EmptyPrincipalProvider extends Object implements PrincipalProvider
PrincipalProvider interface that never
returns any principals.| Modifier and Type | Field and Description |
|---|---|
static PrincipalProvider |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
Iterator<? extends Principal> |
findPrincipals(int searchType)
Find all principals that match the search type.
|
Iterator<? extends Principal> |
findPrincipals(String nameHint,
int searchType)
Find the principals that match the specified nameHint and search type.
|
Set<Group> |
getGroupMembership(Principal principal)
Returns an iterator over all group principals for which the given
principal is either direct or indirect member of.
|
Principal |
getPrincipal(String principalName)
Returns the principal with the specified name or
null if the
principal does not exist. |
Set<? extends Principal> |
getPrincipals(String userID)
Tries to resolve the specified
userID to a valid principal and
it's group membership. |
public static final PrincipalProvider INSTANCE
public Principal getPrincipal(@Nonnull String principalName)
PrincipalProvidernull if the
principal does not exist.getPrincipal in interface PrincipalProviderprincipalName - the name of the principal to retrievenull@Nonnull public Set<Group> getGroupMembership(@Nonnull Principal principal)
PrincipalProviderGroup.isMember(Principal)
must return true.
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.
getGroupMembership in interface PrincipalProviderprincipal - the principal to return it's membership from.Group.isMember(java.security.Principal)@Nonnull public Set<? extends Principal> getPrincipals(@Nonnull String userID)
PrincipalProvideruserID to a valid principal and
it's group membership. This method returns an empty set if the
specified ID cannot be resolved.getPrincipals in interface PrincipalProvideruserID - A userID.userID
or an empty set if it cannot be resolved.@Nonnull public Iterator<? extends Principal> findPrincipals(@Nullable String nameHint, int searchType)
PrincipalProviderfindPrincipals in interface PrincipalProvidernameHint - A name hint to use for non-exact matching.searchType - Limit the search to certain types of principals. Valid
values are any of
@Nonnull public Iterator<? extends Principal> findPrincipals(int searchType)
PrincipalProviderfindPrincipals in interface PrincipalProvidersearchType - Limit the search to certain types of principals. Valid
values are any of
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.