Interface ReviewerGroupService
public interface ReviewerGroupService
- Since:
- 7.13
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(ReviewerGroupCreateRequest request) Create a new reviewer groupvoid
delete
(long reviewerGroupId) Delete a reviewer group with the given ID.findByName
(Scope scope, String name, PageRequest pageRequest) Find reviewer groups by name.findByScope
(Scope scope, PageRequest pageRequest) Find the reviewer groups in a given scopegetById
(long reviewerGroupId) Find a reviewer group with the given ID.Find a reviewer group with the given name.update
(ReviewerGroupUpdateRequest request) Updates a reviewer group.
-
Method Details
-
create
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 thereviewer 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
- thescope
to retrieve the reviewer groups fromname
- the name or start of the name of a reviewer grouppageRequest
- 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
Find the reviewer groups in a given scope- Parameters:
scope
- thescope
to retrieve the reviewer groups frompageRequest
- the page of reviewer groups to be returned- Returns:
- a page containing 0 or more
reviewer groups
-
getById
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
Find a reviewer group with the given name.- Parameters:
scope
- the scope of which the reviewer group belongs toreviewerGroupName
- 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
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. Thescope
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
-