Interface Group

All Superinterfaces:
Comparable<Principal>, Principal
All Known Subinterfaces:
ExternalGroup

public interface Group extends Principal
A user group.
Since:
2.3
  • Field Summary

    Fields inherited from interface de.espirit.firstspirit.access.Principal

    GROUP, USER
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addUser(User user)
    Adds the given user to this group.
    void
    addUsers(User[] users)
    Adds the given users to this group.
    @Nullable String
    Gets email address of the group.
    Get name of the group
    long
    Provides the project ID this group is defined for.
    Get all users in this group
    boolean
    Is this an admin group.
    boolean
    Is this the everyone group
    boolean
    Indicates whether this is an external group.
    boolean
    isMember(User user)
    Verifies whether the given user to be a member of this group.
    boolean
    Remove user from group
    void
    removeUsers(User[] users)
    Remove the given users from this group.
    void
    setAdmin(boolean admin)
    Sets or clears the admin flag of this group.
    void
    setEmail(@Nullable String email)
    Sets the email address of the group
    void
    Sets group's name.

    Methods inherited from interface java.lang.Comparable

    compareTo

    Methods inherited from interface de.espirit.firstspirit.access.Principal

    getId, getType
  • Method Details

    • getName

      String getName()
      Get name of the group
      Specified by:
      getName in interface Principal
      Returns:
      the name
      Since:
      2.3
    • setName

      void setName(String name)
      Sets group's name.
      Parameters:
      name - new name.
      Throws:
      IllegalArgumentException - if a group with this name already exists.
      Since:
      4.0.17
    • getUsers

      User[] getUsers()
      Get all users in this group
      Returns:
      the users
      Since:
      2.3
    • addUser

      boolean addUser(User user) throws IllegalArgumentException
      Adds the given user to this group.
      Parameters:
      user - user to add.
      Returns:
      true if the user was added, false if the user is already member if this group.
      Throws:
      IllegalArgumentException - if the user has no access rights to the project.
      Since:
      2.3
    • addUsers

      void addUsers(User[] users) throws IllegalArgumentException
      Adds the given users to this group.
      Parameters:
      users - users to add.
      Throws:
      IllegalArgumentException - if at least one user has no access rights to the project.
      Since:
      4.0.25
    • removeUser

      boolean removeUser(User user)
      Remove user from group
      Parameters:
      user - the user to remove
      Returns:
      user removed
      Since:
      2.3
    • removeUsers

      void removeUsers(User[] users)
      Remove the given users from this group.
      Parameters:
      users - to remove
      Since:
      4.0.25
    • isAdmin

      boolean isAdmin()
      Is this an admin group.
      Returns:
      true if this is an administrator group.
      Since:
      2.3
    • setAdmin

      void setAdmin(boolean admin)
      Sets or clears the admin flag of this group.
      Parameters:
      admin - admin flag.
      Since:
      4.0.43
    • isEveryone

      boolean isEveryone()
      Is this the everyone group
      Returns:
      the everyone value
      Since:
      2.3
    • isExternal

      boolean isExternal()
      Indicates whether this is an external group.
      Returns:
      true, if external.
      Since:
      4.0.17
    • isMember

      boolean isMember(User user)
      Verifies whether the given user to be a member of this group.
      Parameters:
      user - A user.
      Returns:
      true, if the user is a member.
      Since:
      2.3.18
    • getProjectID

      long getProjectID()
      Provides the project ID this group is defined for.
      Returns:
      The project ID.
      Since:
      4.0.17
    • getEmail

      @Nullable @Nullable String getEmail()
      Gets email address of the group.
      Returns:
      the eMail address
      Since:
      4.2.428
    • setEmail

      void setEmail(@Nullable @Nullable String email)
      Sets the email address of the group
      Parameters:
      email - the new eMail address
      Since:
      4.2.428