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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyMigrations
(io.quarkus.runtime.RuntimeValue<Migrations> migrationsRv, io.quarkus.runtime.RuntimeValue<Boolean> migrationsEnabledRv) Applies the migrations ifMigrationsProperties.enabled
is true.io.quarkus.runtime.RuntimeValue<Boolean>
isEnabled
(MigrationsProperties runtimeProperties) Records the enabled-flag.io.quarkus.runtime.RuntimeValue<MigrationsConfig>
recordConfig
(MigrationsBuildTimeProperties buildTimeProperties, MigrationsProperties runtimeProperties, StaticJavaBasedMigrationDiscoverer discoverer, ClasspathResourceScanner resourceScanner) Records the configurationio.quarkus.runtime.RuntimeValue<Migrations>
recordMigrations
(io.quarkus.runtime.RuntimeValue<MigrationsConfig> migrationsConfig, io.quarkus.runtime.RuntimeValue<org.neo4j.driver.Driver> driver) Records the migration itself.
-
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 propertiesbuildTimeProperties
- 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.- 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 configurationdriver
- 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 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
-