Interface GitPullRequestCommandFactory

All Superinterfaces:
com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory

public interface GitPullRequestCommandFactory extends com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory
Overrides methods from the standard PluginPullRequestCommandFactory interface and returns GitCommand instances instead of simple Command or AsyncCommand instances. This allows commands created by this factory to be used synchronously or asynchronously at the caller's discretion, rather than fixing execution to one approach or the other.

This interface does not add any commands to the standard interface. It only covariantly adjusts their return types.

  • Method Summary

    Modifier and Type
    Method
    Description
    bulkRescope(com.atlassian.bitbucket.scm.pull.BulkRescopeCommandParameters parameters)
     
    changes(com.atlassian.bitbucket.pull.PullRequest pullRequest, com.atlassian.bitbucket.scm.pull.PullRequestChangesCommandParameters parameters, com.atlassian.bitbucket.content.ChangeCallback callback)
     
    commits(com.atlassian.bitbucket.pull.PullRequest pullRequest, com.atlassian.bitbucket.scm.pull.PullRequestCommitsCommandParameters parameters, com.atlassian.bitbucket.commit.CommitCallback callback)
     
    delete(com.atlassian.bitbucket.pull.PullRequest pullRequest, com.atlassian.bitbucket.scm.pull.PullRequestDeleteCommandParameters parameters)
     
    delete(com.atlassian.bitbucket.repository.Repository repository, long pullRequestId, com.atlassian.bitbucket.scm.pull.PullRequestDeleteCommandParameters parameters)
     
    diff(com.atlassian.bitbucket.pull.PullRequest pullRequest, com.atlassian.bitbucket.scm.pull.PullRequestDiffCommandParameters parameters, com.atlassian.bitbucket.content.DiffContentCallback callback)
     
    GitCommand<com.atlassian.bitbucket.content.DiffStatsSummary>
    diffStatsSummary(com.atlassian.bitbucket.pull.PullRequest pullRequest, com.atlassian.bitbucket.scm.pull.PullRequestDiffStatsSummaryCommandParameters parameters)
     
    GitCommand<com.atlassian.bitbucket.scm.pull.PullRequestEffectiveDiff>
    effectiveDiff(com.atlassian.bitbucket.pull.PullRequest pullRequest)
     
    GitCommand<com.atlassian.bitbucket.repository.Branch>
    merge(com.atlassian.bitbucket.pull.PullRequest pullRequest, com.atlassian.bitbucket.scm.pull.PullRequestMergeCommandParameters parameters)
     
    GitCommand<com.atlassian.bitbucket.pull.PullRequestMergeResult>
    tryMerge(com.atlassian.bitbucket.pull.PullRequest pullRequest)
    Attempt to merge the pull request to determine what the expected result of actually merging it would be.
    updateRefs(com.atlassian.bitbucket.scm.pull.UpdatePullRequestRefsCommandParameters parameters)
     
  • Method Details

    • bulkRescope

      @Nonnull GitCommand<Void> bulkRescope(@Nonnull com.atlassian.bitbucket.scm.pull.BulkRescopeCommandParameters parameters)
      Specified by:
      bulkRescope in interface com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory
      Parameters:
      parameters - describes the repository and provides a context for the command to use to retrieve the rescopes and apply updates
      Returns:
      a command which can be used to calculate pull request rescopes synchronously or asynchronously
      Since:
      4.5
    • changes

      @Nonnull GitCommand<Void> changes(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest, @Nonnull com.atlassian.bitbucket.scm.pull.PullRequestChangesCommandParameters parameters, @Nonnull com.atlassian.bitbucket.content.ChangeCallback callback)
      Specified by:
      changes in interface com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory
      Parameters:
      pullRequest - the pull request to retrieve the change tree for
      parameters - parameters controlling which changes are returned
      callback - a callback to receive the changes
      Returns:
      a command which can retrieve changes synchronously or asynchronously
      Since:
      6.0
    • commits

      @Nonnull GitCommand<Void> commits(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest, @Nonnull com.atlassian.bitbucket.scm.pull.PullRequestCommitsCommandParameters parameters, @Nonnull com.atlassian.bitbucket.commit.CommitCallback callback)
      Specified by:
      commits in interface com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory
      Parameters:
      pullRequest - the pull request to retrieve commits for
      parameters - parameters controlling how commits are streamed
      callback - a callback to receive the commits
      Returns:
      a command which can retrieve commits synchronously or asynchronously
      Since:
      6.0
    • delete

      @Nonnull GitCommand<Void> delete(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest, @Nonnull com.atlassian.bitbucket.scm.pull.PullRequestDeleteCommandParameters parameters)
      Specified by:
      delete in interface com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory
      Parameters:
      pullRequest - the pull request to delete
      parameters - parameters providing context for the deleted pull request
      Returns:
      a command which, when executed, will delete the specified pull request, releasing any artifacts, such as refs or objects, that are associated with it
      Since:
      5.1
    • delete

      @Nonnull GitCommand<Void> delete(@Nonnull com.atlassian.bitbucket.repository.Repository repository, long pullRequestId, @Nonnull com.atlassian.bitbucket.scm.pull.PullRequestDeleteCommandParameters parameters)
      Specified by:
      delete in interface com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory
      Parameters:
      repository - the repository of the pull request to delete
      pullRequestId - the repository scoped ID of the pull request to delete
      parameters - parameters providing context for the deleted pull request
      Returns:
      a command which, when executed, will delete the specified pull request, releasing any artifacts, such as refs or objects, that are associated with it
      Since:
      9.0
    • diff

      @Nonnull GitCommand<Void> diff(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest, @Nonnull com.atlassian.bitbucket.scm.pull.PullRequestDiffCommandParameters parameters, @Nonnull com.atlassian.bitbucket.content.DiffContentCallback callback)
      Specified by:
      diff in interface com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory
      Parameters:
      pullRequest - the pull request to retrieve diffs for
      parameters - parameters controlling which diffs are returned, and how much
      callback - a callback to receive the diff output
      Returns:
      a command which can retrieve diffs synchronously or asynchronously
    • diffStatsSummary

      @Nonnull GitCommand<com.atlassian.bitbucket.content.DiffStatsSummary> diffStatsSummary(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest, @Nonnull com.atlassian.bitbucket.scm.pull.PullRequestDiffStatsSummaryCommandParameters parameters)
      Specified by:
      diffStatsSummary in interface com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory
      Parameters:
      pullRequest - the pull request to retrieve diff stats summary for
      parameters - parameters controlling which diffs are returned
      Returns:
      a command which can retrieve diff stats summary synchronously or asynchronously
      Since:
      9.1
    • effectiveDiff

      @Nonnull GitCommand<com.atlassian.bitbucket.scm.pull.PullRequestEffectiveDiff> effectiveDiff(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest)
      Specified by:
      effectiveDiff in interface com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory
      Parameters:
      pullRequest - the pull request to resolve the effective diff for
      Returns:
      a command which can resolve the effective diff for the pull request synchronously or asynchronously
    • merge

      @Nonnull GitCommand<com.atlassian.bitbucket.repository.Branch> merge(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest, @Nonnull com.atlassian.bitbucket.scm.pull.PullRequestMergeCommandParameters parameters)
      Specified by:
      merge in interface com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory
      Parameters:
      pullRequest - the pull request to merge
      parameters - parameters controlling how the pull request is merged
      Returns:
      a command which can be used to merge the pull request synchronously or asynchronously
    • tryMerge

      @Nonnull GitCommand<com.atlassian.bitbucket.pull.PullRequestMergeResult> tryMerge(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest)
      Attempt to merge the pull request to determine what the expected result of actually merging it would be.
      Specified by:
      tryMerge in interface com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory
      Parameters:
      pullRequest - the pull request to test for merge-ability
      Returns:
      the result of trying to merge the pull request
      Since:
      4.10
    • updateRefs

      @Nonnull GitCommand<Void> updateRefs(@Nonnull com.atlassian.bitbucket.scm.pull.UpdatePullRequestRefsCommandParameters parameters)
      Specified by:
      updateRefs in interface com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory
      Parameters:
      parameters - provides the pull requests for which the pull request refs should be brought into sync with the current pull request state
      Returns:
      a command which can be used to update the pull request refs synchronously or asynchronously
      Since:
      7.12