Class DataMigration
java.lang.Object
org.sgrewritten.stargate.migration.DataMigration
- Direct Known Subclasses:
DataMigration6
,DataMigration7
,DataMigration9
A specification for a data migration
A data migration migrates data from the old format to the new one
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract int
Gets the configuration version this modifier will update the configuration togetNewConfigPair
(TwoTuple<String, Object> oldPair) Gets the new key-value pair corresponding to the old key-value pairgetUpdatedConfigValues
(Map<String, Object> oldConfig) Gets an updated configuration given the old configurationabstract String
abstract String
abstract void
run
(@NotNull SQLDatabaseAPI base, StargateAPI stargateAPI) Runs this configuration modifierboolean
-
Constructor Details
-
DataMigration
public DataMigration()
-
-
Method Details
-
getUpdatedConfigValues
Gets an updated configuration given the old configuration- Parameters:
oldConfig
-The old configuration to update
- Returns:
The update configuration
-
run
Runs this configuration modifierThis may alter files such as portal and gate files to perform the appropriate changes necessary for compatibility. This does not modify the config file itself.
-
getConfigVersion
public abstract int getConfigVersion()Gets the configuration version this modifier will update the configuration to- Returns:
The configuration version of this modifier
-
getNewConfigPair
Gets the new key-value pair corresponding to the old key-value pairThis basically gets the updated config key and updates the value if necessary
- Parameters:
oldPair
-The old key-value pair
- Returns:
The new and updated key-value pair
-
getVersionFrom
- Returns:
The version this migrator is migrating from
-
getVersionTo
- Returns:
The version this migrator is migrating to
-
willPopulateRegistry
public boolean willPopulateRegistry()- Returns:
- Whether the manager will add portals / networks to the registry
-