Interface ReviewerGroupService


public interface ReviewerGroupService
Since:
7.13
  • Method Details

    • create

      @Nonnull ReviewerGroup create(@Nonnull ReviewerGroupCreateRequest request)
      Create a new reviewer group
      Parameters:
      request - describes the reviewer group to create
      Returns:
      the created reviewer group
      Throws:
      EmptyReviewerGroupException - when creating a group with no users
    • delete

      void delete(long reviewerGroupId)
      Delete a reviewer group with the given ID.
      Parameters:
      reviewerGroupId - the ID of the reviewer group to be deleted
      Throws:
      NoSuchReviewerGroupException - if the ID of the reviewer group to be deleted does not exist
    • findByName

      @Nonnull Page<ReviewerGroup> findByName(@Nonnull Scope scope, @Nonnull String name, @Nonnull PageRequest pageRequest)
      Find reviewer groups by name.

      Will also find all the reviewer groups which begin with the name or partial name provided within a given scope.

      Parameters:
      scope - the scope to retrieve the reviewer groups from
      name - the name or start of the name of a reviewer group
      pageRequest - the page of reviewer groups to be returned
      Returns:
      a page containing 0 or more reviewer groups that has the name provided or starts with the partial name provided.
    • findByScope

      @Nonnull Page<ReviewerGroup> findByScope(@Nonnull Scope scope, @Nonnull PageRequest pageRequest)
      Find the reviewer groups in a given scope
      Parameters:
      scope - the scope to retrieve the reviewer groups from
      pageRequest - the page of reviewer groups to be returned
      Returns:
      a page containing 0 or more reviewer groups
    • getById

      @Nonnull ReviewerGroup getById(long reviewerGroupId)
      Find a reviewer group with the given ID.

      If no reviewer group exists with the specific ID, an exception is thrown.

      Parameters:
      reviewerGroupId - the ID of the reviewer group to be retrieved
      Returns:
      the reviewer group with the specified ID
      Throws:
      NoSuchReviewerGroupException - if no reviewer group exists with the specific ID
    • getByName

      @Nonnull Optional<ReviewerGroup> getByName(@Nonnull Scope scope, @Nonnull String reviewerGroupName)
      Find a reviewer group with the given name.
      Parameters:
      scope - the scope of which the reviewer group belongs to
      reviewerGroupName - the name of the reviewer group to be retrieved
      Returns:
      the reviewer group with the exact name if one exists; empty otherwise
      Since:
      9.0
    • update

      @Nonnull ReviewerGroup update(@Nonnull ReviewerGroupUpdateRequest request)
      Updates a reviewer group.

      Only the name, description and users of the group can be updated. The name and users of a group can never be null, however the users list can be empty. A user who already exists in the group will not be added to prevent duplicates. The scope of a reviewer group cannot be changed after creation.

      Parameters:
      request - a request containing the attributes to update for the reviewer group
      Returns:
      the updated reviewer group
      Throws:
      NoSuchReviewerGroupException - if the ID of the reviewer group to be updated does not exist