Interface GitExtendedCommandFactory

All Superinterfaces:
com.atlassian.bitbucket.scm.PluginExtendedCommandFactory

public interface GitExtendedCommandFactory extends com.atlassian.bitbucket.scm.PluginExtendedCommandFactory
Overrides methods from the standard PluginExtendedCommandFactory 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.

Since:
4.6
  • Method Summary

    Modifier and Type
    Method
    Description
    archive(com.atlassian.bitbucket.repository.Repository repository, com.atlassian.bitbucket.scm.ArchiveCommandParameters parameters, com.atlassian.bitbucket.io.TypeAwareOutputSupplier outputSupplier)
     
    GitCommand<com.atlassian.bitbucket.commit.Commit>
    editFile(com.atlassian.bitbucket.repository.Repository repository, com.atlassian.bitbucket.scm.EditFileCommandParameters parameters)
     
    fork(com.atlassian.bitbucket.repository.Repository repository, com.atlassian.bitbucket.scm.ForkCommandParameters parameters)
     
    lastModified(com.atlassian.bitbucket.repository.Repository repository, com.atlassian.bitbucket.scm.LastModifiedCommandParameters parameters, com.atlassian.bitbucket.commit.LastModifiedCallback callback)
     
    GitCommand<com.atlassian.bitbucket.repository.Branch>
    merge(com.atlassian.bitbucket.repository.Repository toRepository, com.atlassian.bitbucket.scm.MergeCommandParameters parameters)
     
    patch(com.atlassian.bitbucket.repository.Repository repository, com.atlassian.bitbucket.scm.PatchCommandParameters parameters, com.atlassian.bitbucket.io.TypeAwareOutputSupplier outputSupplier)
     
    push(com.atlassian.bitbucket.repository.Repository repository, com.atlassian.bitbucket.scm.PushCommandParameters parameters, com.atlassian.bitbucket.scm.PushCallback callback)
     
    GitCommand<com.atlassian.bitbucket.repository.Branch>
    rebase(com.atlassian.bitbucket.repository.Repository repository, GitRebaseCommandParameters parameters)
     
    GitCommand<com.atlassian.bitbucket.repository.Branch>
    revert(com.atlassian.bitbucket.repository.Repository repository, com.atlassian.bitbucket.scm.RevertCommandParameters parameters)
     
    signedObjects(com.atlassian.bitbucket.repository.Repository repository, com.atlassian.bitbucket.scm.signed.SignedObjectsParameters parameters, com.atlassian.bitbucket.scm.signed.SignedObjectCallback callback)
     
    updateDefaultBranch(com.atlassian.bitbucket.repository.Repository repository, com.atlassian.bitbucket.scm.UpdateDefaultBranchCommandParameters parameters)
     
  • Method Details

    • archive

      @Nonnull GitCommand<Void> archive(@Nonnull com.atlassian.bitbucket.repository.Repository repository, @Nonnull com.atlassian.bitbucket.scm.ArchiveCommandParameters parameters, @Nonnull com.atlassian.bitbucket.io.TypeAwareOutputSupplier outputSupplier)
      Specified by:
      archive in interface com.atlassian.bitbucket.scm.PluginExtendedCommandFactory
      Parameters:
      repository - the repository to stream the archive from
      parameters - parameters describing the commit to archive and the format to produce the archive in
      outputSupplier - a supplier which, when given the archive content type, will provide an output stream
      Returns:
      a command which can be used to stream an archive of a repository synchronously or asynchronously
      Since:
      5.1
    • editFile

      @Nonnull GitCommand<com.atlassian.bitbucket.commit.Commit> editFile(@Nonnull com.atlassian.bitbucket.repository.Repository repository, @Nonnull com.atlassian.bitbucket.scm.EditFileCommandParameters parameters)
      Specified by:
      editFile in interface com.atlassian.bitbucket.scm.PluginExtendedCommandFactory
    • fork

      @Nonnull GitCommand<Void> fork(@Nonnull com.atlassian.bitbucket.repository.Repository repository, @Nonnull com.atlassian.bitbucket.scm.ForkCommandParameters parameters)
      Specified by:
      fork in interface com.atlassian.bitbucket.scm.PluginExtendedCommandFactory
    • lastModified

      @Nonnull GitCommand<Void> lastModified(@Nonnull com.atlassian.bitbucket.repository.Repository repository, @Nonnull com.atlassian.bitbucket.scm.LastModifiedCommandParameters parameters, @Nonnull com.atlassian.bitbucket.commit.LastModifiedCallback callback)
      Specified by:
      lastModified in interface com.atlassian.bitbucket.scm.PluginExtendedCommandFactory
      Parameters:
      repository - the repository containing the starting commit
      parameters - parameters describing the path to stream modifications for, and the starting commit for the traversal
      callback - a callback to receive the latest commit for files in the specified path
      Returns:
      a command to stream the latest commit to modify each files in the specified path, or null if streaming last modifications is not supported
    • merge

      @Nonnull GitCommand<com.atlassian.bitbucket.repository.Branch> merge(@Nonnull com.atlassian.bitbucket.repository.Repository toRepository, @Nonnull com.atlassian.bitbucket.scm.MergeCommandParameters parameters)
      Specified by:
      merge in interface com.atlassian.bitbucket.scm.PluginExtendedCommandFactory
      Parameters:
      toRepository - the repository containing the target of the merge
      parameters - parameters describing the merge to perform
      Returns:
      a command to merge two branches
      See Also:
    • patch

      @Nonnull GitCommand<Void> patch(@Nonnull com.atlassian.bitbucket.repository.Repository repository, @Nonnull com.atlassian.bitbucket.scm.PatchCommandParameters parameters, @Nonnull com.atlassian.bitbucket.io.TypeAwareOutputSupplier outputSupplier)
      Specified by:
      patch in interface com.atlassian.bitbucket.scm.PluginExtendedCommandFactory
      Parameters:
      repository - the repository from which to stream the patch
      parameters - parameters describing the commits for which to generate the patch
      outputSupplier - a supplier which will provide an output stream
      Returns:
      a command which can be used to stream a patch of a diff synchronously or asynchronously
      Since:
      6.7
    • push

      @Nonnull GitCommand<Void> push(@Nonnull com.atlassian.bitbucket.repository.Repository repository, @Nonnull com.atlassian.bitbucket.scm.PushCommandParameters parameters, @Nonnull com.atlassian.bitbucket.scm.PushCallback callback)
      Specified by:
      push in interface com.atlassian.bitbucket.scm.PluginExtendedCommandFactory
      Parameters:
      repository - the repository to push
      parameters - parameters describing the target of the push, optional authentication and which refs should be included
      callback - a callback that will receive ref updates, ref failures and progress updates
      Returns:
      a command which, when executed, performs a push and sends progress and result details to the provided callback
      Since:
      7.11
    • rebase

      @Nonnull GitCommand<com.atlassian.bitbucket.repository.Branch> rebase(@Nonnull com.atlassian.bitbucket.repository.Repository repository, @Nonnull GitRebaseCommandParameters parameters)
      Parameters:
      repository - the repository containing the branch to rebase
      parameters - parameters describing the rebase to perform
      Returns:
      a command to rebase a branch
      Throws:
      com.atlassian.bitbucket.validation.ArgumentValidationException - if the upstream is not a full 40-character commit ID, or if an upstream repository was specified which does not belong to the same hierarchy as repository
      IllegalArgumentException - if the specified branch is not actually a branch
      Since:
      5.5
    • revert

      @Nonnull GitCommand<com.atlassian.bitbucket.repository.Branch> revert(@Nonnull com.atlassian.bitbucket.repository.Repository repository, @Nonnull com.atlassian.bitbucket.scm.RevertCommandParameters parameters)
      Specified by:
      revert in interface com.atlassian.bitbucket.scm.PluginExtendedCommandFactory
      Parameters:
      repository - the repository which contains the commit to be reverted
      parameters - describes the commit to be reverted
      Returns:
      a command which when executed reverts the commit and returns the Branch branch which contains the revert commit
      Since:
      8.13
    • signedObjects

      @Nonnull GitCommand<Void> signedObjects(@Nonnull com.atlassian.bitbucket.repository.Repository repository, @Nonnull com.atlassian.bitbucket.scm.signed.SignedObjectsParameters parameters, @Nonnull com.atlassian.bitbucket.scm.signed.SignedObjectCallback callback)
      Specified by:
      signedObjects in interface com.atlassian.bitbucket.scm.PluginExtendedCommandFactory
      Parameters:
      repository - the repository containing the requested objects
      parameters - describes the objects to retrieve
      callback - callback to receive the requested objects
      Returns:
      a command to retrieve signed objects
      Since:
      5.1
    • updateDefaultBranch

      @Nonnull GitCommand<Void> updateDefaultBranch(@Nonnull com.atlassian.bitbucket.repository.Repository repository, @Nonnull com.atlassian.bitbucket.scm.UpdateDefaultBranchCommandParameters parameters)
      Specified by:
      updateDefaultBranch in interface com.atlassian.bitbucket.scm.PluginExtendedCommandFactory
      Parameters:
      repository - the repository whose default branch should be updated
      parameters - parameters describing the new branch to set as the default
      Returns:
      a command to update the default branch, or null if updating the default branch is not supported