Class MigrationServiceImpl.MigrationContextImpl

java.lang.Object
org.nuxeo.runtime.migration.MigrationServiceImpl.MigrationContextImpl
All Implemented Interfaces:
MigrationService.MigrationContext
Enclosing class:
MigrationServiceImpl

protected static class MigrationServiceImpl.MigrationContextImpl extends Object implements MigrationService.MigrationContext
Migration context implementation that reports progress in the key/value store and can be shutdown.
Since:
9.3
  • Field Details

  • Constructor Details

  • Method Details

    • reportProgress

      public void reportProgress(String message, long num, long total, long skipCount)
      Description copied from interface: MigrationService.MigrationContext
      Notifies the migration context of the current progress.
      Specified by:
      reportProgress in interface MigrationService.MigrationContext
      Parameters:
      message - an informative message about what is being migrated
      num - the current number of things migrated
      total - the total number of things to migrate, or -1 if unknown
      skipCount - the current number of things skipped
    • reportError

      public void reportError(String message, int code)
      Description copied from interface: MigrationService.MigrationContext
      Notifies the migration context of an error.
      Specified by:
      reportError in interface MigrationService.MigrationContext
      Parameters:
      message - an informative message about what went wrong
      code - the error code
    • requestShutdown

      public void requestShutdown()
      Description copied from interface: MigrationService.MigrationContext
      Requests a shutdown. Called internally by the migration service when the server shuts down.
      Specified by:
      requestShutdown in interface MigrationService.MigrationContext
    • isShutdownRequested

      public boolean isShutdownRequested()
      Description copied from interface: MigrationService.MigrationContext
      Checks if shutdown has been requested.

      This should be checked periodically by the migrator, and when true the migrator should return as soon as possible, even if its work is not complete.

      This is a "nice" version of thread interruption, which will follow a short while later, and should also be checked by the migrator.

      Specified by:
      isShutdownRequested in interface MigrationService.MigrationContext
      Returns:
      true if migration should be stopped as soon as possible