Interface VersionAgnosticMigrationScript<T,E extends VersionAgnosticMigrationEmbeddedStorageManager<?,?>>
-
- All Known Implementing Classes:
ReflectiveVersionMigrationScript
,SimpleMigrationScript
,SimpleTypedMigrationScript
public interface VersionAgnosticMigrationScript<T,E extends VersionAgnosticMigrationEmbeddedStorageManager<?,?>>
Interface for scripts to migrate / update datastores.One script is supposed to bring a datastore from a lower version to the target version. After the
migrate(Context)
method is called, the target version is reached.- Author:
- Johannes Rabauer
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<VersionAgnosticMigrationScript<?,?>>
COMPARATOR
Provides aComparator
that compares thegetTargetVersion()
of the given scripts
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MigrationVersion
getTargetVersion()
void
migrate(Context<T,E> context)
Execute logic to migrate the given datastore to a newer version of the store.
-
-
-
Field Detail
-
COMPARATOR
static final java.util.Comparator<VersionAgnosticMigrationScript<?,?>> COMPARATOR
Provides aComparator
that compares thegetTargetVersion()
of the given scripts
-
-
Method Detail
-
getTargetVersion
MigrationVersion getTargetVersion()
- Returns:
- the version of the datastore after this script is executed.
-
migrate
void migrate(Context<T,E> context)
Execute logic to migrate the given datastore to a newer version of the store. After executing thegetTargetVersion()
is reached.- Parameters:
context
- that holds necessary data for the migration
-
-