Class ConfigurationBuilder


  • public final class ConfigurationBuilder
    extends Object
    Fluent Configuration builder. It also validates configuration parameters.
    • Constructor Detail

      • ConfigurationBuilder

        public ConfigurationBuilder()
    • 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 a DataSource directly
        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​(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 a output.cypher in 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
      • build

        public Configuration build()
        Builds a Configuration instance after validating the specified parameters.
        Returns:
        Liquigraph configuration