Class ConfigurationBuilder
- java.lang.Object
-
- org.liquigraph.core.configuration.ConfigurationBuilder
-
public final class ConfigurationBuilder extends Object
FluentConfigurationbuilder. It also validates configuration parameters.
-
-
Constructor Summary
Constructors Constructor Description ConfigurationBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Configurationbuild()Builds aConfigurationinstance after validating the specified parameters.ConfigurationBuilderwithChangelogLoader(ChangelogLoader changelogLoader)SetsChangelogLoaderto use when reading Liquigraph changelogs.ConfigurationBuilderwithClassLoader(ClassLoader classLoader)Deprecated.Please usewithChangelogLoader(ChangelogLoader)with aClassLoaderChangelogLoader.ConfigurationBuilderwithDataSource(DataSource dataSource)Specifies the data source of the graph database instance.ConfigurationBuilderwithDryRunMode(Path outputDirectory)Sets Liquigraph to write changesets in aoutput.cypherin the specified outputDirectory.ConfigurationBuilderwithExecutionContexts(String... executionContexts)ConfigurationBuilderwithExecutionContexts(Collection<String> executionContexts)Specifies one or more execution contexts.ConfigurationBuilderwithMasterChangelogLocation(String masterChangelog)Specifies the location of the master changelog file.ConfigurationBuilderwithPassword(String password)Specifies the password allowed to connect to the remote graph database instance.ConfigurationBuilderwithRunMode()Sets Liquigraph to execute changesets against the configured graph database.ConfigurationBuilderwithUri(String uri)Specifies the JDBC connection URI of the graph database instance.ConfigurationBuilderwithUsername(String username)Specifies the username allowed to connect to the remote graph database instance.
-
-
-
Method Detail
-
withMasterChangelogLocation
public ConfigurationBuilder withMasterChangelogLocation(String masterChangelog)
Specifies the location of the master changelog file. Please note that this location should point to a readable Liquigraph changelog file.- Parameters:
masterChangelog- Liquigraph changelog- Returns:
- itself for chaining purposes
-
withUri
public ConfigurationBuilder withUri(String uri)
Specifies the JDBC connection URI of the graph database instance. Alternatively, you can set aDataSourcedirectly- Parameters:
uri- connection URI- Returns:
- itself for chaining purposes
-
withDataSource
public ConfigurationBuilder withDataSource(DataSource dataSource)
Specifies the data source of the graph database instance. Alternatively, you can set the URI- Parameters:
dataSource- data source- Returns:
- itself for chaining purposes
-
withUsername
public ConfigurationBuilder withUsername(String username)
Specifies the username allowed to connect to the remote graph database instance. Please be sure to provide a password, if you provide a username, too.- Parameters:
username- username- Returns:
- itself for chaining purposes
-
withPassword
public ConfigurationBuilder withPassword(String password)
Specifies the password allowed to connect to the remote graph database instance. Please be sure to provide a username, if you provide a password, too.- Parameters:
password- password- Returns:
- itself for chaining purposes
-
withExecutionContexts
public ConfigurationBuilder withExecutionContexts(String... executionContexts)
- Parameters:
executionContexts- 0 or more Liquigraph execution contexts to allow changeset filtering- Returns:
- itself for chaining purposes
- See Also:
withExecutionContexts(java.util.Collection)
-
withExecutionContexts
public ConfigurationBuilder withExecutionContexts(Collection<String> executionContexts)
Specifies one or more execution contexts.- Parameters:
executionContexts- non-nullable execution contexts- Returns:
- itself for chaining purposes
-
withRunMode
public ConfigurationBuilder withRunMode()
Sets Liquigraph to execute changesets against the configured graph database.- Returns:
- itself for chaining purposes
-
withDryRunMode
public ConfigurationBuilder withDryRunMode(Path outputDirectory)
Sets Liquigraph to write changesets in aoutput.cypherin the specified outputDirectory. Note that it won't write to the graph database.- Parameters:
outputDirectory- writable directory where the file is written- Returns:
- itself for chaining purposes
-
withClassLoader
@Deprecated public ConfigurationBuilder withClassLoader(ClassLoader classLoader)
Deprecated.Please usewithChangelogLoader(ChangelogLoader)with aClassLoaderChangelogLoader.Sets ClassLoader to use when reading Liquigraph changelogs. Default is
Thread.currentThread().getContextClassLoader(). Don't call this unless you REALLY know what you're doing.- Parameters:
classLoader- class loader- Returns:
- itself for chaining purposes
-
withChangelogLoader
public ConfigurationBuilder withChangelogLoader(ChangelogLoader changelogLoader)
SetsChangelogLoaderto use when reading Liquigraph changelogs. Default isClassLoaderChangelogLoader.currentThreadContextClassLoader(). Don't call this unless you REALLY know what you're doing.- Parameters:
changelogLoader- the changelog loader to use- Returns:
- itself for chaining purposes
-
build
public Configuration build()
Builds aConfigurationinstance after validating the specified parameters.- Returns:
- Liquigraph configuration
-
-