Class MigrationsRecorder
java.lang.Object
ac.simons.neo4j.migrations.quarkus.runtime.MigrationsRecorder
Records both initialization of the
migration config and the
migrations itself.- Since:
- 1.2.2
- Author:
- Michael J. Simons
-
Constructor Summary
ConstructorsConstructorDescriptionMigrationsRecorder(io.quarkus.runtime.RuntimeValue<MigrationsProperties> rtvruntimeProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyMigrations(io.quarkus.runtime.RuntimeValue<ac.simons.neo4j.migrations.core.Migrations> migrationsRv, io.quarkus.runtime.RuntimeValue<Boolean> migrationsEnabledRv) Applies the migrations ifMigrationsProperties.enabled()is true.io.quarkus.runtime.RuntimeValue<Boolean> Records the enabled-flag.io.quarkus.runtime.RuntimeValue<ac.simons.neo4j.migrations.core.MigrationsConfig> recordConfig(MigrationsBuildTimeProperties buildTimeProperties, StaticJavaBasedMigrationDiscoverer discoverer, ac.simons.neo4j.migrations.core.ClasspathResourceScanner resourceScanner) Records the configuration.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.
-
Constructor Details
-
MigrationsRecorder
public MigrationsRecorder(io.quarkus.runtime.RuntimeValue<MigrationsProperties> rtvruntimeProperties)
-
-
Method Details
-
recordConfig
public io.quarkus.runtime.RuntimeValue<ac.simons.neo4j.migrations.core.MigrationsConfig> recordConfig(MigrationsBuildTimeProperties buildTimeProperties, StaticJavaBasedMigrationDiscoverer discoverer, ac.simons.neo4j.migrations.core.ClasspathResourceScanner resourceScanner) Records the configuration.- Parameters:
buildTimeProperties- build-time propertiesdiscoverer- the (static) discovered configured during build timeresourceScanner- the (static) scanner configured during build time- Returns:
- a runtime value containing the configuration
-
isEnabled
Records the enabled-flag. The actual value of the property must be recorded here as well before use.- 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 configurationdriver- 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 ifMigrationsProperties.enabled()is true.- Parameters:
migrationsRv- the runtime value containing the migrations instancemigrationsEnabledRv- the runtime value containing the flag whether migrations are enabled or not
-