Interface UserGroup

    • Method Detail

      • getName

        java.lang.String getName()
        Gets the name of this group.
        Returns:
        group name.
      • getOwner

        User getOwner()
        Gets this group's owner.
        Returns:
        owner.
      • getUsers

        default java.util.Collection<User> getUsers()
        Gets the users in this group.
        Returns:
        users in the group.
      • getMembership

        java.util.Collection<UserGroupMembership> getMembership()
        Gets a collection of individual memberships, which is more definite than getUsers(), providing more specific information about membership.
        Returns:
        immutable collection of user group membership records.
      • setOwner

        void setOwner​(User user)
               throws java.lang.SecurityException
        Sets the owner of this group.
        Parameters:
        user - user to set as the new owner of this group.
        Throws:
        java.lang.SecurityException - if there is a security violation adding the user.
      • isMember

        default boolean isMember​(User user)
        Finds if the specified user is a member of this group.
        Parameters:
        user - User to check in the group.
        Returns:
        true if the user is a member of the group, false otherwise.
      • getMembership

        UserGroupMembership getMembership​(User user)
        Gets the membership record for a specific user.
        Parameters:
        user - User to search membership records for.
        Returns:
        membership instance.
      • addUser

        void addUser​(User user)
              throws java.lang.SecurityException
        Adds a user to this group.
        Parameters:
        user - user to add.
        Throws:
        java.lang.SecurityException - if there is a security violation adding the user.
      • removeUser

        default void removeUser​(User user)
                         throws java.lang.SecurityException
        Removes a user from this group.
        Parameters:
        user - user to remove.
        Throws:
        java.lang.SecurityException - if there is a security violation removing the user.