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<ac.simons.neo4j.migrations.core.MigrationsConfig> recordConfig(MigrationsBuildTimeProperties buildTimeProperties, MigrationsProperties runtimeProperties, StaticJavaBasedMigrationDiscoverer discoverer, ac.simons.neo4j.migrations.core.ClasspathResourceScanner resourceScanner)
      Records the configuration
      Parameters:
      buildTimeProperties - build-time properties
      runtimeProperties - runtime 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<ac.simons.neo4j.migrations.core.Migrations> recordMigrations(io.quarkus.runtime.RuntimeValue<ac.simons.neo4j.migrations.core.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<ac.simons.neo4j.migrations.core.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