Class MigrationsRecorder

java.lang.Object
ac.simons.neo4j.migrations.quarkus.runtime.MigrationsRecorder

public class MigrationsRecorder extends Object
Records both initialization of the migration config and the migrations itself.
Since:
1.2.2
Author:
Michael J. Simons
  • Constructor Details

    • MigrationsRecorder

      public MigrationsRecorder()
  • Method Details

    • recordConfig

      public io.quarkus.runtime.RuntimeValue<MigrationsConfig> recordConfig(MigrationsBuildTimeProperties buildTimeProperties, MigrationsProperties runtimeProperties, StaticJavaBasedMigrationDiscoverer discoverer, ClasspathResourceScanner resourceScanner)
      Records the configuration
      Parameters:
      runtimeProperties - runtime properties
      buildTimeProperties - build-time properties
      discoverer - the (static) discovered configured during build time
      resourceScanner - the (static) scanner configured during build time
      Returns:
      A runtime value containing the configuration
    • isEnabled

      public io.quarkus.runtime.RuntimeValue<Boolean> isEnabled(MigrationsProperties runtimeProperties)
      Records the enabled-flag. The actual value of the property must be recorded here as well before use.
      Parameters:
      runtimeProperties - runtime properties
      Returns:
      A runtime value containing the enabled-flag
    • recordMigrations

      public io.quarkus.runtime.RuntimeValue<Migrations> recordMigrations(io.quarkus.runtime.RuntimeValue<MigrationsConfig> migrationsConfig, io.quarkus.runtime.RuntimeValue<org.neo4j.driver.Driver> driver)
      Records the migration itself.
      Parameters:
      migrationsConfig - The runtime value for the configuration
      driver - The runtime value of a driver instance
      Returns:
      A runtime value containing the migrations
    • applyMigrations

      public void applyMigrations(io.quarkus.runtime.RuntimeValue<Migrations> migrationsRv, io.quarkus.runtime.RuntimeValue<Boolean> migrationsEnabledRv)
      Applies the migrations if MigrationsProperties.enabled is true.
      Parameters:
      migrationsRv - The runtime value containing the migrations instance
      migrationsEnabledRv - The runtime value containing the flag whether migrations are enabled or not