Package com.coditory.sherlock.migrator
Class MigrationResult
- java.lang.Object
-
- com.coditory.sherlock.migrator.MigrationResult
-
public final class MigrationResult extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MigrationResult(boolean migrated)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isMigrated()
MigrationResult
onMigrationFinish(java.lang.Runnable action)
Executes the action when migration process finishes.MigrationResult
onMigrationRejection(java.lang.Runnable action)
Executes the action when migration lock was not acquired.
-
-
-
Method Detail
-
isMigrated
public boolean isMigrated()
-
onMigrationFinish
public MigrationResult onMigrationFinish(java.lang.Runnable action)
Executes the action when migration process finishes. The action is only executed by the migrator instance that started the migration process.- Parameters:
action
- the action to be executed after migration- Returns:
- migration result for chaining
-
onMigrationRejection
public MigrationResult onMigrationRejection(java.lang.Runnable action)
Executes the action when migration lock was not acquired.- Parameters:
action
- the action to be executed when migration lock was not acquired- Returns:
- migration result for chaining
-
-