Interface FactorValueMigratorService
-
- All Known Implementing Classes:
FactorValueMigratorServiceImpl
public interface FactorValueMigratorService
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
FactorValueMigratorService.Migration
static class
FactorValueMigratorService.MigrationFailedException
Keep track of the first failed migration when multiple migrations are performed in a single transaction.static class
FactorValueMigratorService.MigrationResult
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FactorValueMigratorService.MigrationResult
performMigration(FactorValueMigratorService.Migration migration, boolean noop)
Perform the given migration.Map<Long,List<FactorValueMigratorService.MigrationResult>>
performMigrationOfRemainingFactorValues(Set<Long> migratedFactorValueIds, boolean migrateNonTrivialCases, boolean noop)
Migrate all remaining factor values that have not been migrated yet.List<FactorValueMigratorService.MigrationResult>
performMigrationOfRemainingOldStyleCharacteristics(Long fvId, Set<Long> migratedOldStyleCharacteristicIds, boolean noop)
Migrate all the old-style characteristics of a given factor value to subject-only statements.List<FactorValueMigratorService.MigrationResult>
performMultipleMigrations(List<FactorValueMigratorService.Migration> migrations, boolean noop)
Perform multiple migrations in a single transaction.
-
-
-
Method Detail
-
performMigration
FactorValueMigratorService.MigrationResult performMigration(FactorValueMigratorService.Migration migration, boolean noop)
Perform the given migration.- Parameters:
migration
- a migration to performnoop
- if true, do not save the resulting statement- Returns:
- the created or updated statement
-
performMultipleMigrations
List<FactorValueMigratorService.MigrationResult> performMultipleMigrations(List<FactorValueMigratorService.Migration> migrations, boolean noop) throws FactorValueMigratorService.MigrationFailedException
Perform multiple migrations in a single transaction.- Parameters:
migrations
- a list of migrations to perform- Returns:
- a list of created or updated statements
- Throws:
FactorValueMigratorService.MigrationFailedException
- if any of the migrations fail, the first failed migration is stored in the exception wrapper
-
performMigrationOfRemainingOldStyleCharacteristics
List<FactorValueMigratorService.MigrationResult> performMigrationOfRemainingOldStyleCharacteristics(Long fvId, Set<Long> migratedOldStyleCharacteristicIds, boolean noop)
Migrate all the old-style characteristics of a given factor value to subject-only statements.The FV will be marked as troubled.
- Parameters:
fvId
- ID of the factor value to migratemigratedOldStyleCharacteristicIds
- a set of already migrated old-style characteristic IDs, if null theCharacteristic.isMigratedToStatement()
flag will be used to determine if a characteristic has already been migratednoop
- if true, do not save the resulting statements- Returns:
- list of created or updated statements from the given factor value
-
performMigrationOfRemainingFactorValues
Map<Long,List<FactorValueMigratorService.MigrationResult>> performMigrationOfRemainingFactorValues(Set<Long> migratedFactorValueIds, boolean migrateNonTrivialCases, boolean noop)
Migrate all remaining factor values that have not been migrated yet.All the FVs with zero or one characteristics will be migrated automatically unless migratedToSubjectOnly is set, in which case all the old-style characteristics will be migrated to subject-only statements.
- Parameters:
migratedFactorValueIds
- IDs of already migrated FVsmigrateNonTrivialCases
- allow migration to subject-only statements for FVs with more than one old-style characteristics; those FVs will be marked as troubled.noop
- if true, do not save the resulting statements- Returns:
- created of updated statements organized by factor value ID
-
-