Interface ChangeRequestService


  • public interface ChangeRequestService
    Service 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 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 repository
        repositoryAlias - the repository alias
        sourceBranch - the branch where you want to get pulled
        targetBranch - the branch where you want impact your changes
        summary - the short summary of the change request
        description - 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 repository
        repositoryAlias - 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 repository
        repositoryAlias - the repository alias
        filter - 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 repository
        repositoryAlias - the repository alias
        statusList - 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 repository
        repositoryAlias - the repository alias
        statusList - change request status to filter the results
        filter - 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 repository
        repositoryAlias - the repository alias
        page - the desired page
        pageSize - the size of the page
        filter - 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 repository
        repositoryAlias - the repository alias
        page - the desired page
        pageSize - the size of the page
        statusList - change request status to filter the results
        filter - 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 repository
        repositoryAlias - the repository used as a filter
        changeRequestId - 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 repository
        repositoryAlias - 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 repository
        repositoryAlias - the origin repository
        sourceBranch - the source branch
        targetBranch - 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 repository
        repositoryAlias - the origin repository
        changeRequestId - 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 repository
        repositoryAlias - the origin repository
        associatedBranchName - 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 repository
        repositoryAlias - the origin repository
        associatedBranchName - branch name
        userIdentififer - user identifier
      • rejectChangeRequest

        void rejectChangeRequest​(String spaceName,
                                 String repositoryAlias,
                                 Long changeRequestId)
        Rejects the change request.
        Parameters:
        spaceName - the space containing the origin repository
        repositoryAlias - the repository used as a filter
        changeRequestId - 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 repository
        repositoryAlias - the repository used as a filter
        changeRequestId - 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 repository
        repositoryAlias - the repository used as a filter
        changeRequestId - 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 repository
        repositoryAlias - the repository used as a filter
        changeRequestId - 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 repository
        repositoryAlias - the repository used as a filter
        changeRequestId - 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 repository
        repositoryAlias - the repository used as a filter
        changeRequestId - the id of the change request
        updatedSummary - 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 repository
        repositoryAlias - the repository used as a filter
        changeRequestId - the id of the change request
        updatedDescription - 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 repository
        repositoryAlias - the repository used as a filter
        changeRequestId - the id of the change request
        page - the desired page
        pageSize - 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 repository
        repositoryAlias - the repository used as a filter
        changeRequestId - the id of the change request
        text - 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 repository
        repositoryAlias - the repository used as a filter
        changeRequestId - the id of the change request
        commentId - 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 repository
        repositoryAlias - the repository used as a filter
        changeRequestId - 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 repository
        repositoryAlias - the repository used as a filter
        changeRequestId - the id of the change request
        commitMessage - the comment of squash commit
        Returns:
        True if the squash operation succeeded, otherwise false.