Interface Group

    • Method Detail

      • getMembers

        @NotNull
        @NotNull Iterator<Authorizable> getMembers()
                                            throws RepositoryException
        Returns:
        Iterator of Authorizables which are members of this Group. This includes both declared members and all authorizables that are indirect group members.
        Throws:
        RepositoryException - If an error occurs.
      • isDeclaredMember

        boolean isDeclaredMember​(@NotNull
                                 @NotNull Authorizable authorizable)
                          throws RepositoryException
        Test whether an Authorizable is a declared member of this group.
        Parameters:
        authorizable - The Authorizable to test.
        Returns:
        true if the Authorizable to test is a direct member
        Throws:
        RepositoryException - If an error occurs.
      • isMember

        boolean isMember​(@NotNull
                         @NotNull Authorizable authorizable)
                  throws RepositoryException
        Parameters:
        authorizable - The Authorizable to test.
        Returns:
        true if the Authorizable to test is a direct or indirect member of this Group.
        Throws:
        RepositoryException - If an error occurs.
      • addMember

        boolean addMember​(@NotNull
                          @NotNull Authorizable authorizable)
                   throws RepositoryException
        Add a member to this Group.
        Parameters:
        authorizable - The Authorizable to be added as member to this group.
        Returns:
        true if the Authorizable has successfully been added to this Group, false otherwise (e.g. unknown implementation or if it already is a member or if the passed authorizable is this group itself or for some implementation specific constraint).
        Throws:
        RepositoryException - If an error occurs.
      • addMembers

        @NotNull
        @NotNull Set<String> addMembers​(@NotNull
                                        @NotNull String... memberIds)
                                 throws RepositoryException
        Add one or more member(s) to this Group. Note, that an implementation may define circumstances under which this method allows to add non-existing Authorizables as new members. Also an implementation may choose to (partially) postpone validation/verification util Session.save().
        Parameters:
        memberIds - The Ids of the authorizables to be added as members to this group.
        Returns:
        a set of those memberIds that could not be added or an empty set of all ids have been successfully processed. The former may include those cases where a given id cannot be resolved to an existing authorizable, one that is already member or if adding the member would create a cyclic group membership.
        Throws:
        RepositoryException - If one of the specified memberIds is invalid or if some other error occurs.
      • removeMember

        boolean removeMember​(@NotNull
                             @NotNull Authorizable authorizable)
                      throws RepositoryException
        Remove a member from this Group.
        Parameters:
        authorizable - The Authorizable to be removed from the list of group members.
        Returns:
        true if the Authorizable was successfully removed. False otherwise.
        Throws:
        RepositoryException - If an error occurs.
      • removeMembers

        @NotNull
        @NotNull Set<String> removeMembers​(@NotNull
                                           @NotNull String... memberIds)
                                    throws RepositoryException
        Remove one or several members from this Group. Note, that an implementation may define circumstances under which this method allows to remove members that (no longer) exist. An implementation may choose to (partially) postpone validation/verification util Session.save().
        Parameters:
        memberIds - The Ids of the authorizables to be removed from the members of this group.
        Returns:
        a set of those memberIds that could not be removed or an empty set if all ids have been successfully processed. The former may include those cases where a given id cannot be resolved to an existing authorizable.
        Throws:
        RepositoryException - If one of the specified memberIds is invalid or if some other error occurs.