Class EmptyPrincipalProvider

  • All Implemented Interfaces:
    PrincipalProvider

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

      • getPrincipal

        public Principal getPrincipal​(@NotNull
                                      @NotNull 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
      • getGroupMembership

        @NotNull
        public @NotNull Set<Group> getGroupMembership​(@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 iterator 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.

        Specified by:
        getGroupMembership 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:
        Group.isMember(java.security.Principal)
      • 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 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 Set<? extends Principal> getPrincipals​(@NotNull
                                                               @NotNull 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.
      • 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 interface PrincipalProvider
        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
        • PrincipalManager.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​(int searchType)
        Description copied from interface: PrincipalProvider
        Find all principals that match the search type.
        Specified by:
        findPrincipals in interface PrincipalProvider
        Parameters:
        searchType - Limit the search to certain types of principals. Valid values are any of
        • PrincipalManager.SEARCH_TYPE_ALL
        • PrincipalManager.SEARCH_TYPE_NOT_GROUP
        • PrincipalManager.SEARCH_TYPE_GROUP
        Returns:
        An iterator of principals.