Interface ChangeRequestService
-
public interface ChangeRequestServiceService that contains the basic mechanism to administrate change requests. Every change request depends on its repository. The change request id is unique in every repository, but it can be repeated across them.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddComment(String spaceName, String repositoryAlias, Long changeRequestId, String text)Adds a comment to the change request comment list.voidcloseChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId)Closes the change request.ChangeRequestCountSummarycountChangeRequests(String spaceName, String repositoryAlias)Retrieves the number of change requests that the user is able to visualize.ChangeRequestcreateChangeRequest(String spaceName, String repositoryAlias, String sourceBranch, String targetBranch, String summary, String description)Creates a change request and stores it into the tracking system.voiddeleteChangeRequests(String spaceName, String repositoryAlias, String associatedBranchName)Deletes all change requests associated with the given branch.voiddeleteChangeRequests(String spaceName, String repositoryAlias, String associatedBranchName, String userIdentifier)Deletes all change requests associated with the given branch.voiddeleteComment(String spaceName, String repositoryAlias, Long changeRequestId, Long commentId)Deletes a comment from the change request comment list.ChangeRequestgetChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId)Retrieves the change request with the given id.List<ChangeRequest>getChangeRequests(String spaceName, String repositoryAlias)Retrieves the list of change requests that the user is able to visualize.PaginatedChangeRequestListgetChangeRequests(String spaceName, String repositoryAlias, Integer page, Integer pageSize, String filter)Retrieves the list of change requests that the user is able to visualize.PaginatedChangeRequestListgetChangeRequests(String spaceName, String repositoryAlias, Integer page, Integer pageSize, List<ChangeRequestStatus> statusList, String filter)Retrieves the list of change requests that the user is able to visualize.List<ChangeRequest>getChangeRequests(String spaceName, String repositoryAlias, String filter)Retrieves the list of change requests that the user is able to visualize.List<ChangeRequest>getChangeRequests(String spaceName, String repositoryAlias, List<ChangeRequestStatus> statusList)Retrieves the list of change requests that the user is able to visualize.List<ChangeRequest>getChangeRequests(String spaceName, String repositoryAlias, List<ChangeRequestStatus> statusList, String filter)Retrieves the list of change requests that the user is able to visualize.PaginatedChangeRequestCommentListgetComments(String spaceName, String repositoryAlias, Long changeRequestId, Integer page, Integer pageSize)Obtains all the comments associated with a change request.List<ChangeRequestCommit>getCommits(String spaceName, String repositoryAlias, Long changeRequestId)Get commits from the change request.List<ChangeRequestDiff>getDiff(String spaceName, String repositoryAlias, Long changeRequestId)Obtains differences between branches involved in the given change request.List<ChangeRequestDiff>getDiff(String spaceName, String repositoryAlias, String sourceBranch, String targetBranch)Obtains differences between branches.BooleanmergeChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId)Merges the change request.voidrejectChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId)Rejects the change request.voidreopenChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId)Reopens the change request.BooleanrevertChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId)Reverts the change request.BooleansquashChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId, String commitMessage)Squash change request.voidupdateChangeRequestDescription(String spaceName, String repositoryAlias, Long changeRequestId, String updatedDescription)Updates the change request description.voidupdateChangeRequestSummary(String spaceName, String repositoryAlias, Long changeRequestId, String updatedSummary)Updates the change request summary.
-
-
-
Method Detail
-
createChangeRequest
ChangeRequest createChangeRequest(String spaceName, String repositoryAlias, String sourceBranch, String targetBranch, String summary, String description)
Creates a change request and stores it into the tracking system.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository aliassourceBranch- the branch where you want to get pulledtargetBranch- the branch where you want impact your changessummary- the short summary of the change requestdescription- the description of the change request- Returns:
- The object that represents the change request.
-
getChangeRequests
List<ChangeRequest> getChangeRequests(String spaceName, String repositoryAlias)
Retrieves the list of change requests that the user is able to visualize.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository alias- Returns:
- The list of change requests.
-
getChangeRequests
List<ChangeRequest> getChangeRequests(String spaceName, String repositoryAlias, String filter)
Retrieves the list of change requests that the user is able to visualize.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository aliasfilter- a string to filter the results- Returns:
- The list of change requests.
-
getChangeRequests
List<ChangeRequest> getChangeRequests(String spaceName, String repositoryAlias, List<ChangeRequestStatus> statusList)
Retrieves the list of change requests that the user is able to visualize.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository aliasstatusList- change request status to filter the results- Returns:
- The list of change requests.
-
getChangeRequests
List<ChangeRequest> getChangeRequests(String spaceName, String repositoryAlias, List<ChangeRequestStatus> statusList, String filter)
Retrieves the list of change requests that the user is able to visualize.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository aliasstatusList- change request status to filter the resultsfilter- a string to filter the results- Returns:
- The list of change requests.
-
getChangeRequests
PaginatedChangeRequestList getChangeRequests(String spaceName, String repositoryAlias, Integer page, Integer pageSize, String filter)
Retrieves the list of change requests that the user is able to visualize.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository aliaspage- the desired pagepageSize- the size of the pagefilter- a string to filter the results- Returns:
- The list of change requests.
-
getChangeRequests
PaginatedChangeRequestList getChangeRequests(String spaceName, String repositoryAlias, Integer page, Integer pageSize, List<ChangeRequestStatus> statusList, String filter)
Retrieves the list of change requests that the user is able to visualize.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository aliaspage- the desired pagepageSize- the size of the pagestatusList- change request status to filter the resultsfilter- a string to filter the results- Returns:
- The list of change requests.
-
getChangeRequest
ChangeRequest getChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId)
Retrieves the change request with the given id.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository used as a filterchangeRequestId- the id of the change request- Returns:
- The change request.
-
countChangeRequests
ChangeRequestCountSummary countChangeRequests(String spaceName, String repositoryAlias)
Retrieves the number of change requests that the user is able to visualize.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository alias- Returns:
- The number of change requests.
-
getDiff
List<ChangeRequestDiff> getDiff(String spaceName, String repositoryAlias, String sourceBranch, String targetBranch)
Obtains differences between branches.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the origin repositorysourceBranch- the source branchtargetBranch- the target branch- Returns:
- The list of differences between files.
-
getDiff
List<ChangeRequestDiff> getDiff(String spaceName, String repositoryAlias, Long changeRequestId)
Obtains differences between branches involved in the given change request.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the origin repositorychangeRequestId- the id of the change request- Returns:
- The list of differences between files.
-
deleteChangeRequests
void deleteChangeRequests(String spaceName, String repositoryAlias, String associatedBranchName)
Deletes all change requests associated with the given branch.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the origin repositoryassociatedBranchName- branch name
-
deleteChangeRequests
void deleteChangeRequests(String spaceName, String repositoryAlias, String associatedBranchName, String userIdentifier)
Deletes all change requests associated with the given branch.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the origin repositoryassociatedBranchName- branch nameuserIdentififer- user identifier
-
rejectChangeRequest
void rejectChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId)
Rejects the change request.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository used as a filterchangeRequestId- the id of the change request
-
mergeChangeRequest
Boolean mergeChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId)
Merges the change request.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository used as a filterchangeRequestId- the id of the change request- Returns:
- True if the merge operation succeeded, otherwise false.
-
revertChangeRequest
Boolean revertChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId)
Reverts the change request.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository used as a filterchangeRequestId- the id of the change request- Returns:
- True if the revert operation succeeded, otherwise false.
-
closeChangeRequest
void closeChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId)
Closes the change request.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository used as a filterchangeRequestId- the id of the change request
-
reopenChangeRequest
void reopenChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId)
Reopens the change request.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository used as a filterchangeRequestId- the id of the change request
-
updateChangeRequestSummary
void updateChangeRequestSummary(String spaceName, String repositoryAlias, Long changeRequestId, String updatedSummary)
Updates the change request summary.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository used as a filterchangeRequestId- the id of the change requestupdatedSummary- updated summary of the change request
-
updateChangeRequestDescription
void updateChangeRequestDescription(String spaceName, String repositoryAlias, Long changeRequestId, String updatedDescription)
Updates the change request description.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository used as a filterchangeRequestId- the id of the change requestupdatedDescription- updated description of the change request
-
getComments
PaginatedChangeRequestCommentList getComments(String spaceName, String repositoryAlias, Long changeRequestId, Integer page, Integer pageSize)
Obtains all the comments associated with a change request.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository used as a filterchangeRequestId- the id of the change requestpage- the desired pagepageSize- the size of the page- Returns:
- The list of comments
-
addComment
void addComment(String spaceName, String repositoryAlias, Long changeRequestId, String text)
Adds a comment to the change request comment list.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository used as a filterchangeRequestId- the id of the change requesttext- the comment text
-
deleteComment
void deleteComment(String spaceName, String repositoryAlias, Long changeRequestId, Long commentId)
Deletes a comment from the change request comment list.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository used as a filterchangeRequestId- the id of the change requestcommentId- the id of the comment
-
getCommits
List<ChangeRequestCommit> getCommits(String spaceName, String repositoryAlias, Long changeRequestId)
Get commits from the change request.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository used as a filterchangeRequestId- the id of the change request- Returns:
- The list of commits
-
squashChangeRequest
Boolean squashChangeRequest(String spaceName, String repositoryAlias, Long changeRequestId, String commitMessage)
Squash change request.- Parameters:
spaceName- the space containing the origin repositoryrepositoryAlias- the repository used as a filterchangeRequestId- the id of the change requestcommitMessage- the comment of squash commit- Returns:
- True if the squash operation succeeded, otherwise false.
-
-