Package org.nuxeo.runtime.migration
Interface MigrationService.MigrationContext
- All Known Implementing Classes:
MigrationServiceImpl.MigrationContextImpl
- Enclosing interface:
- MigrationService
public static interface MigrationService.MigrationContext
Interface for a migration context, passed to the
MigrationService.Migrator.- Since:
- 9.3
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if shutdown has been requested.voidreportError(String message, int code) Notifies the migration context of an error.default voidreportProgress(String message, long num, long total) Deprecated, for removal: This API element is subject to removal in a future version.default voidreportProgress(String message, long num, long total, long skipCount) Notifies the migration context of the current progress.voidRequests a shutdown.
-
Method Details
-
reportProgress
Notifies the migration context of the current progress.- Parameters:
message- an informative message about what is being migratednum- the current number of things migratedtotal- the total number of things to migrate, or-1if unknownskipCount- the current number of things skipped
-
reportProgress
@Deprecated(since="2025.20", forRemoval=true) default void reportProgress(String message, long num, long total) Deprecated, for removal: This API element is subject to removal in a future version.since 2025.20, usereportProgress(String, long, long, long)instead -
reportError
Notifies the migration context of an error.- Parameters:
message- an informative message about what went wrongcode- the error code
-
requestShutdown
void requestShutdown()Requests a shutdown. Called internally by the migration service when the server shuts down. -
isShutdownRequested
boolean isShutdownRequested()Checks if shutdown has been requested.This should be checked periodically by the migrator, and when
truethe 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.
- Returns:
trueif migration should be stopped as soon as possible
-
reportProgress(String, long, long, long)instead