public interface ProjectService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROJECT_KEY_PATTERN |
Modifier and Type | Method and Description |
---|---|
boolean |
addProjectAllowedReviewerGroup(java.lang.String projectKey,
java.lang.String groupName)
Adds group to list of project allowed reviewer groups
|
boolean |
addProjectAllowedReviewerUser(java.lang.String projectKey,
java.lang.String username)
Adds user to list of project allowed reviewer users
|
boolean |
addProjectDefaultReviewerGroup(java.lang.String projectKey,
java.lang.String groupName)
Adds group to list of project default reviewer groups
|
boolean |
addProjectDefaultReviewerUser(java.lang.String projectKey,
java.lang.String username)
Adds user to list of project default reviewer users
|
int |
countProjects(ProjectSearchCriteria projectSearchCriteria)
Returns the number of projects filtered by project search criteria
|
void |
create(ProjectData projectData)
Creates a new project
|
void |
delete(java.lang.String projectKey)
Deletes project with given key
Will fail if project contains reviews.
|
void |
delete(java.lang.String projectKey,
boolean deleteReviewsInProject)
Deletes project with given key including reviews if deleteProjectReviews is true.
|
boolean |
deleteProjectAllowedReviewerGroup(java.lang.String projectKey,
java.lang.String groupName)
Deletes group from list of project allowed reviewer groups
|
boolean |
deleteProjectAllowedReviewerUser(java.lang.String projectKey,
java.lang.String username)
Deletes user from list of project allowed reviewer users
|
boolean |
deleteProjectDefaultReviewerGroup(java.lang.String projectKey,
java.lang.String groupName)
Deletes group from list of project default reviewer groups
|
boolean |
deleteProjectDefaultReviewerUser(java.lang.String projectKey,
java.lang.String username)
Deletes user from list of project default reviewer users
|
boolean |
exist(java.lang.String projectKey)
Checks it project with given key exists.
|
java.util.List<ProjectData> |
getAllProjects()
Returns the details of all Crucible projects that the caller is entitled to access.
|
java.util.List<ProjectData> |
getAllProjects(boolean excludeAllowedReviewers)
Returns the details of all Crucible projects that the caller is entitled to access, optionally loading all
user data.
|
ProjectData |
getProject(java.lang.Integer id)
Deprecated.
|
ProjectData |
getProject(java.lang.String projectKey)
Get a project from its key -- this does not load the list of allowed reviewers
|
ProjectData |
getProject(java.lang.String projectKey,
boolean excludeAllowedReviewers)
Get the details of a project, optionally including the list of allowed reviewers, which is expensive to get.
|
Page<java.lang.String> |
getProjectAllowedReviewerGroups(java.lang.String projectKey,
PageRequest pageRequest)
Get paged list of project allowed users
|
java.lang.Iterable<java.lang.String> |
getProjectAllowedReviewerGroupsIterable(java.lang.String projectKey,
PageRequest pageRequest)
Returns a service-object as an Iterable used to iterate over project allowed reviewer groups
Note: this Iterator will make a number of calls to the project service lazily (on
Iterator.next() or Iterator.hasNext() ) until all pages are retrieved. |
Page<java.lang.String> |
getProjectAllowedReviewerUsers(java.lang.String projectKey,
PageRequest pageRequest)
Get paged list of project default allowed users
|
java.lang.Iterable<java.lang.String> |
getProjectAllowedReviewerUsersIterable(java.lang.String projectKey,
PageRequest firstPageRequest)
Returns a service-object as an Iterable used to iterate over project allowed reviewer users
Note: this Iterator will make a number of calls to the project service lazily (on
Iterator.next() or Iterator.hasNext() ) until all pages are retrieved. |
Page<java.lang.String> |
getProjectDefaultReviewerGroups(java.lang.String projectKey,
PageRequest pageRequest)
Get a paged list of project default reviewer groups
|
java.lang.Iterable<java.lang.String> |
getProjectDefaultReviewerGroupsIterable(java.lang.String projectKey,
PageRequest firstPageRequest)
Returns a service-object as an Iterable used to iterate over project default reviewer groups
Note: this Iterator will make a number of calls to the project service lazily (on
Iterator.next() or Iterator.hasNext() ) until all pages are retrieved. |
Page<java.lang.String> |
getProjectDefaultReviewerUsers(java.lang.String projectKey,
PageRequest pageRequest)
Get paged list of project default reviewer users
|
java.lang.Iterable<java.lang.String> |
getProjectDefaultReviewerUsersIterable(java.lang.String projectKey,
PageRequest firstPageRequest)
Returns a service-object as an Iterable used to iterate over project default reviewer users
Note: this Iterator will make a number of calls to the project service lazily (on
Iterator.next() or Iterator.hasNext() ) until all pages are retrieved. |
java.lang.Integer |
getProjectId(java.lang.String projectKey)
Get project ID from its key
|
boolean |
hasPermission(java.lang.String projectKey,
java.lang.String actionName)
Does the current user have this permission at a project level?
|
void |
moveAllReviews(java.lang.String sourceProjectKey,
java.lang.String destinationProjectKey)
Moves all reviews and snippets from project with sourceProjectKey to project with destinationProjectKey
|
Page<ProjectData> |
searchProjects(ProjectSearchCriteria projectSearchCriteria,
PageRequest pageRequest)
Returns a page of projects filtered by project search criteria
|
java.lang.Iterable<ProjectData> |
searchProjectsIterable(ProjectSearchCriteria projectSearchCriteria,
PageRequest firstPageRequest)
Returns a service-object as an Iterable used to iterate over projects
Note: this Iterator will make a number of calls to the project service lazily (on
Iterator.next() or Iterator.hasNext() ) until all pages are retrieved. |
void |
update(ProjectData projectData)
Updates an existing project
|
static final java.lang.String PROJECT_KEY_PATTERN
java.util.List<ProjectData> getAllProjects()
int countProjects(ProjectSearchCriteria projectSearchCriteria)
Page<ProjectData> searchProjects(ProjectSearchCriteria projectSearchCriteria, PageRequest pageRequest)
java.lang.Iterable<ProjectData> searchProjectsIterable(ProjectSearchCriteria projectSearchCriteria, PageRequest firstPageRequest)
Iterator.next()
or Iterator.hasNext()
) until all pages are retrieved.
firstPageRequest is used to get the first page, following page requests will be created from Page.getNextPageRequest()
void create(ProjectData projectData)
void update(ProjectData projectData)
void delete(java.lang.String projectKey)
void delete(java.lang.String projectKey, boolean deleteReviewsInProject)
deleteReviewsInProject
- if true deletes reviewsjava.util.List<ProjectData> getAllProjects(boolean excludeAllowedReviewers)
excludeAllowedReviewers
- if set to true, the allowedReviewers List<String> on each ProjectData will be null.
Setting this to false can be very expensive especially if you have many projects and are using an external
authentication service such as Crowd or Jira.java.lang.Integer getProjectId(java.lang.String projectKey)
ProjectData getProject(java.lang.String projectKey)
ProjectData getProject(java.lang.String projectKey, boolean excludeAllowedReviewers)
Page<java.lang.String> getProjectDefaultReviewerUsers(java.lang.String projectKey, PageRequest pageRequest)
java.lang.Iterable<java.lang.String> getProjectDefaultReviewerUsersIterable(java.lang.String projectKey, PageRequest firstPageRequest)
Iterator.next()
or Iterator.hasNext()
) until all pages are retrieved.
firstPageRequest is used to get the first page, following page requests will be created from Page.getNextPageRequest()
boolean addProjectDefaultReviewerUser(java.lang.String projectKey, java.lang.String username)
boolean deleteProjectDefaultReviewerUser(java.lang.String projectKey, java.lang.String username)
Page<java.lang.String> getProjectDefaultReviewerGroups(java.lang.String projectKey, PageRequest pageRequest)
java.lang.Iterable<java.lang.String> getProjectDefaultReviewerGroupsIterable(java.lang.String projectKey, PageRequest firstPageRequest)
Iterator.next()
or Iterator.hasNext()
) until all pages are retrieved.
firstPageRequest is used to get the first page, following page requests will be created from Page.getNextPageRequest()
boolean addProjectDefaultReviewerGroup(java.lang.String projectKey, java.lang.String groupName)
boolean deleteProjectDefaultReviewerGroup(java.lang.String projectKey, java.lang.String groupName)
Page<java.lang.String> getProjectAllowedReviewerUsers(java.lang.String projectKey, PageRequest pageRequest)
java.lang.Iterable<java.lang.String> getProjectAllowedReviewerUsersIterable(java.lang.String projectKey, PageRequest firstPageRequest)
Iterator.next()
or Iterator.hasNext()
) until all pages are retrieved.
firstPageRequest is used to get the first page, following page requests will be created from Page.getNextPageRequest()
boolean addProjectAllowedReviewerUser(java.lang.String projectKey, java.lang.String username)
boolean deleteProjectAllowedReviewerUser(java.lang.String projectKey, java.lang.String username)
Page<java.lang.String> getProjectAllowedReviewerGroups(java.lang.String projectKey, PageRequest pageRequest)
java.lang.Iterable<java.lang.String> getProjectAllowedReviewerGroupsIterable(java.lang.String projectKey, PageRequest pageRequest)
Iterator.next()
or Iterator.hasNext()
) until all pages are retrieved.
firstPageRequest is used to get the first page, following page requests will be created from Page.getNextPageRequest()
boolean addProjectAllowedReviewerGroup(java.lang.String projectKey, java.lang.String groupName)
boolean deleteProjectAllowedReviewerGroup(java.lang.String projectKey, java.lang.String groupName)
boolean exist(java.lang.String projectKey)
@Deprecated ProjectData getProject(java.lang.Integer id)
boolean hasPermission(java.lang.String projectKey, java.lang.String actionName)
void moveAllReviews(java.lang.String sourceProjectKey, java.lang.String destinationProjectKey) throws java.lang.IllegalArgumentException
sourceProjectKey
- key of the project to move all reviews and snippets fromdestinationProjectKey
- key of the project to move reviews and snippets to.java.lang.IllegalArgumentException
- if source or destination projects not found or if source and
destination keys are referencing the same project.