@ProviderType
public interface PrincipalProvider
PrincipalProvider defines methods to provide access to sources
of Principals. This allows the security framework share any external
sources for authorization and authentication, as may be used by a custom
LoginModule for example.
A single PrincipalProvider implementation is expected to exposed
principals from one single source. In contrast to the
PrincipalManager
which will expose all known and accessible principals from possibly
different sources. See also CompositePrincipalProvider for a
mechanism to combine principals of different providers.| Modifier and Type | Method and 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.
|
default @NotNull Set<Group> |
getGroupMembership(@NotNull Principal principal)
Deprecated.
|
default @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 or
null if the
principal does not exist. |
@NotNull Set<? extends Principal> |
getPrincipals(@NotNull String userID)
Tries to resolve the specified
userID to a valid principal and
it's group membership. |
@Nullable @Nullable Principal getPrincipal(@NotNull @NotNull String principalName)
null if the
principal does not exist.principalName - the name of the principal to retrievenull@NotNull default @NotNull Set<Group> getGroupMembership(@NotNull @NotNull Principal principal)
getMembershipPrincipals(Principal)Group.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.
principal - the principal to return it's membership from.Group.isMember(java.security.Principal)@NotNull default @NotNull Set<Principal> getMembershipPrincipals(@NotNull @NotNull Principal principal)
GroupPrincipal.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.
principal - the principal to return it's membership from.GroupPrincipal.isMember(java.security.Principal)@NotNull @NotNull Set<? extends Principal> getPrincipals(@NotNull @NotNull String userID)
userID to a valid principal and
it's group membership. This method returns an empty set if the
specified ID cannot be resolved.userID - A userID.userID
or an empty set if it cannot be resolved.@NotNull @NotNull Iterator<? extends Principal> findPrincipals(@Nullable @Nullable String nameHint, int searchType)
nameHint - A name hint to use for non-exact matching.searchType - Limit the search to certain types of principals. Valid
values are any of
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.