Class EmptyPrincipalProvider

  • All Implemented Interfaces:
    PrincipalProvider

    public final class EmptyPrincipalProvider
    extends java.lang.Object
    implements PrincipalProvider
    Implementation of the PrincipalProvider interface that never returns any principals.
    • Method Summary

      All 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, int searchType)
      Find the principals that match the specified nameHint and search type.
      @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 or null if the principal does not exist.
      @NotNull java.util.Set<? extends java.security.Principal> getPrincipals​(@NotNull java.lang.String userID)
      Tries to resolve the specified userID 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
    • Method Detail

      • 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 or null if the principal does not exist.
        Specified by:
        getPrincipal in interface PrincipalProvider
        Parameters:
        principalName - the name of the principal 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 iterator 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.

        Specified by:
        getMembershipPrincipals in interface PrincipalProvider
        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<? extends java.security.Principal> getPrincipals​(@NotNull
                                                                                       @NotNull java.lang.String userID)
        Description copied from interface: PrincipalProvider
        Tries to resolve the specified userID 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 interface PrincipalProvider
        Parameters:
        userID - A userID.
        Returns:
        The set of principals associated with the specified userID or an empty set if it cannot be resolved.