public interface

MigrationService

com.atlassian.bitbucket.migration.MigrationService

Summary

Public Methods
@Nonnull Optional<Job> cancelExport(long jobId)
Cancels the export job.
@Nonnull Optional<Job> cancelImport(long jobId)
Cancels the import job.
@Nonnull Optional<Job> getExportJob(long jobId)
Retrieves the export job.
@Nonnull Optional<Job> getImportJob(long jobId)
Retrieves the import job.
@Nonnull Stream<Scope> previewExport(ExportRequest request)
Resolves export items without triggering an export.
@Nonnull Page<JobMessage> searchExportJobMessages(MigrationJobMessageSearchRequest request, PageRequest pageRequest)
Finds all job messages matching the supplied request object for an export job.
@Nonnull Page<JobMessage> searchImportJobMessages(MigrationJobMessageSearchRequest request, PageRequest pageRequest)
Finds all job messages matching the supplied request object for an import job.
@Nonnull Job startExport(ExportRequest request)
Export the repositories specified in the export request.
@Nonnull Job startImport(ImportRequest request)
Import the data contained in the archive specified in the import request.

Public Methods

@Nonnull public Optional<Job> cancelExport (long jobId)

Cancels the export job. This happens immediately and the resulting archive is not usable.

Parameters
jobId the ID of the export job
Returns
  • export job or empty() if the export job doesn't exist
Throws
IllegalStateException if the job has been canceled already, or if it had ended
See Also

@Nonnull public Optional<Job> cancelImport (long jobId)

Cancels the import job. The currently importing repository will finish importing and then the import will be canceled.

Parameters
jobId the ID of the import job
Returns
  • import job or empty() if the import job doesn't exist
Throws
IllegalStateException if the job has been canceled already, or if it had ended
See Also

@Nonnull public Optional<Job> getExportJob (long jobId)

Retrieves the export job.

Parameters
jobId the ID of the export job
Returns
  • export job
See Also

@Nonnull public Optional<Job> getImportJob (long jobId)

Retrieves the import job.

Parameters
jobId the ID of the import job
Returns
  • import job
See Also

@Nonnull public Stream<Scope> previewExport (ExportRequest request)

Resolves export items without triggering an export.

Parameters
request a request object describing the repositories to be exported
Returns
  • the items to be exported if an export job with the given request were triggered

@Nonnull public Page<JobMessage> searchExportJobMessages (MigrationJobMessageSearchRequest request, PageRequest pageRequest)

Finds all job messages matching the supplied request object for an export job.

Parameters
request the request
pageRequest the page request
Returns
Throws
IllegalArgumentException if the job ID on the request is not an export job ID

@Nonnull public Page<JobMessage> searchImportJobMessages (MigrationJobMessageSearchRequest request, PageRequest pageRequest)

Finds all job messages matching the supplied request object for an import job.

Parameters
request the request
pageRequest the page request
Returns
Throws
IllegalArgumentException if the job ID on the request is not an import job ID

@Nonnull public Job startExport (ExportRequest request)

Export the repositories specified in the export request.

Parameters
request a request object describing the repositories to be exported
Returns
  • the export job, the export job contains an export ID which could be used to retrieve the job status
Throws
MaxConcurrentMigrationJobsException if the maximum number of concurrent migration jobs are already running on this node
See Also

@Nonnull public Job startImport (ImportRequest request)

Import the data contained in the archive specified in the import request.

Parameters
request a request object specifying the archive to import
Returns
  • the import job, the import job contains an import ID which could be used to retrieve the job status
Throws
MaxConcurrentMigrationJobsException if the maximum number of concurrent migration jobs are already running on this node
See Also