Interface MigrationService


public interface MigrationService
Since:
5.13
  • Method Details

    • cancelExport

      @Nonnull 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 Optional.empty() if the export job doesn't exist
      Throws:
      IllegalStateException - if the job has been canceled already, or if it had ended
      See Also:
    • cancelImport

      @Nonnull 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 Optional.empty() if the import job doesn't exist
      Throws:
      IllegalStateException - if the job has been canceled already, or if it had ended
      See Also:
    • cancelMeshMigration

      @Nonnull Optional<Job> cancelMeshMigration(long jobId)
      Cancels the migration job. The currently migrating hierarchy will finish migrating and then the migration will be canceled.
      Parameters:
      jobId - the ID of the migration job
      Returns:
      import job or Optional.empty() if the migration job doesn't exist
      Throws:
      IllegalStateException - if the job has been canceled already, or if it had ended
      Since:
      8.0
      See Also:
    • getExportJob

      @Nonnull Optional<Job> getExportJob(long jobId)
      Retrieves the export job.
      Parameters:
      jobId - the ID of the export job
      Returns:
      export job
      See Also:
    • getImportJob

      @Nonnull Optional<Job> getImportJob(long jobId)
      Retrieves the import job.
      Parameters:
      jobId - the ID of the import job
      Returns:
      import job
      See Also:
    • getMeshMigrationJob

      @Nonnull Optional<Job> getMeshMigrationJob(long jobId)
      Retrieves the migration job.
      Parameters:
      jobId - the ID of the migration job
      Returns:
      migration job
      Since:
      8.0
      See Also:
    • previewExport

      @Nonnull Stream<Scope> previewExport(@Nonnull 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
    • previewMeshMigration

      @Nonnull Stream<Repository> previewMeshMigration(@Nonnull MeshMigrationRequest request)
      Resolves repositories to be migrated without triggering a migration.
      Parameters:
      request - a request object describing the repositories to be migrated
      Returns:
      the repositories to be migrated if a migration job with the given request were triggered
      Since:
      8.0
    • searchExportJobMessages

      @Nonnull Page<JobMessage> searchExportJobMessages(@Nonnull MigrationJobMessageSearchRequest request, @Nonnull PageRequest pageRequest)
      Finds all job messages matching the supplied request object for an export job.
      Parameters:
      request - the request
      pageRequest - the page request
      Returns:
      the page of matching job messages
      Throws:
      IllegalArgumentException - if the job ID on the request is not an export job ID
    • searchImportJobMessages

      @Nonnull Page<JobMessage> searchImportJobMessages(@Nonnull MigrationJobMessageSearchRequest request, @Nonnull PageRequest pageRequest)
      Finds all job messages matching the supplied request object for an import job.
      Parameters:
      request - the request
      pageRequest - the page request
      Returns:
      the page of matching job messages
      Throws:
      IllegalArgumentException - if the job ID on the request is not an import job ID
    • searchMeshMigrationJobMessages

      @Nonnull Page<JobMessage> searchMeshMigrationJobMessages(@Nonnull MigrationJobMessageSearchRequest request, @Nonnull PageRequest pageRequest)
      Finds all job messages matching the supplied request object for a migration job.
      Parameters:
      request - the request
      pageRequest - the page request
      Returns:
      the page of matching job messages
      Throws:
      IllegalArgumentException - if the job ID on the request is not a Mesh migration job ID
      Since:
      8.0
    • startExport

      @Nonnull Job startExport(@Nonnull 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:
    • startImport

      @Nonnull Job startImport(@Nonnull 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:
    • startMeshMigration

      @Nonnull Job startMeshMigration(@Nonnull MeshMigrationRequest request)
      Start a job that migrates the repository or repositories specified in the migration request to external Mesh nodes.
      Parameters:
      request - a request object specifying the repositories to migrate to Mesh
      Returns:
      the migration job, which contains an migration ID which could be used to retrieve the job status
      Throws:
      MaxConcurrentMigrationJobsException - if the maximum number of concurrent migration jobs are already running in this cluster
      Since:
      8.0
      See Also: