Class DataMigration

java.lang.Object
org.sgrewritten.stargate.migration.DataMigration
Direct Known Subclasses:
DataMigration6, DataMigration7, DataMigration9

public abstract class DataMigration extends Object
A specification for a data migration

A data migration migrates data from the old format to the new one

  • Constructor Details

    • DataMigration

      public DataMigration()
  • Method Details

    • getUpdatedConfigValues

      public Map<String,Object> getUpdatedConfigValues(Map<String,Object> oldConfig)
      Gets an updated configuration given the old configuration
      Parameters:
      oldConfig -

      The old configuration to update

      Returns:

      The update configuration

    • run

      public abstract void run(@NotNull @NotNull SQLDatabaseAPI base, StargateAPI stargateAPI)
      Runs this configuration modifier

      This 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

      protected abstract TwoTuple<String,Object> getNewConfigPair(TwoTuple<String,Object> oldPair)
      Gets the new key-value pair corresponding to the old key-value pair

      This 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

      public abstract String getVersionFrom()
      Returns:

      The version this migrator is migrating from

    • getVersionTo

      public abstract String getVersionTo()
      Returns:

      The version this migrator is migrating to

    • willPopulateRegistry

      public boolean willPopulateRegistry()
      Returns:
      Whether the manager will add portals / networks to the registry