@Test public void testDatabaseConnector() throws Exception { final DatabaseConnector databaseConnector = new TestDatabaseConnector(); final PluginCommand helpCommand = databaseConnector.getHelpCommand(); assertThat(helpCommand, is(notNullValue())); assertThat(helpCommand.getName(), is("server:test-db")); assertThat( databaseConnector.getDatabaseServerType().getDatabaseSystemIdentifier(), is("test-db")); assertThat(databaseConnector.supportsUrl("jdbc:test-db:somevalue"), is(true)); assertThat(databaseConnector.supportsUrl("jdbc:newdb:somevalue"), is(false)); assertThat(databaseConnector.supportsUrl(null), is(false)); assertThat(databaseConnector.toString(), is("Database connector for test-db - Test Database")); }
protected DatabaseConnector( final DatabaseServerType dbServerType, final Predicate<String> supportsUrl, final BiConsumer<InformationSchemaViewsBuilder, Connection> informationSchemaViewsBuildProcess, final BiConsumer<SchemaRetrievalOptionsBuilder, Connection> schemaRetrievalOptionsBuildProcess, final Consumer<LimitOptionsBuilder> limitOptionsBuildProcess, final Supplier<DatabaseConnectionUrlBuilder> urlBuildProcess) { this.dbServerType = requireNonNull(dbServerType, "No database server type provided"); this.supportsUrl = requireNonNull(supportsUrl, "No predicate for URL support provided"); this.informationSchemaViewsBuildProcess = requireNonNull( informationSchemaViewsBuildProcess, "No information schema views build process provided"); this.schemaRetrievalOptionsBuildProcess = requireNonNull( schemaRetrievalOptionsBuildProcess, "No schema retrieval options build process provided"); this.limitOptionsBuildProcess = requireNonNull(limitOptionsBuildProcess, "No limit options build process provided"); this.urlBuildProcess = requireNonNull(urlBuildProcess, "No URL builder provided"); }
DatabaseConnector implements Options { protected DatabaseConnector( final DatabaseServerType dbServerType, final Predicate<String> supportsUrl, final BiConsumer<InformationSchemaViewsBuilder, Connection> informationSchemaViewsBuildProcess, final BiConsumer<SchemaRetrievalOptionsBuilder, Connection> schemaRetrievalOptionsBuildProcess, final Consumer<LimitOptionsBuilder> limitOptionsBuildProcess, final Supplier<DatabaseConnectionUrlBuilder> urlBuildProcess) { this.dbServerType = requireNonNull(dbServerType, "No database server type provided"); this.supportsUrl = requireNonNull(supportsUrl, "No predicate for URL support provided"); this.informationSchemaViewsBuildProcess = requireNonNull( informationSchemaViewsBuildProcess, "No information schema views build process provided"); this.schemaRetrievalOptionsBuildProcess = requireNonNull( schemaRetrievalOptionsBuildProcess, "No schema retrieval options build process provided"); this.limitOptionsBuildProcess = requireNonNull(limitOptionsBuildProcess, "No limit options build process provided"); this.urlBuildProcess = requireNonNull(urlBuildProcess, "No URL builder provided"); } }
DatabaseConnector implements Options { protected DatabaseConnector( final DatabaseServerType dbServerType, final Predicate<String> supportsUrl, final BiConsumer<InformationSchemaViewsBuilder, Connection> informationSchemaViewsBuildProcess, final BiConsumer<SchemaRetrievalOptionsBuilder, Connection> schemaRetrievalOptionsBuildProcess, final Consumer<LimitOptionsBuilder> limitOptionsBuildProcess, final Supplier<DatabaseConnectionUrlBuilder> urlBuildProcess) { this.dbServerType = requireNonNull(dbServerType, "No database server type provided"); this.supportsUrl = requireNonNull(supportsUrl, "No predicate for URL support provided"); this.informationSchemaViewsBuildProcess = requireNonNull( informationSchemaViewsBuildProcess, "No information schema views build process provided"); this.schemaRetrievalOptionsBuildProcess = requireNonNull( schemaRetrievalOptionsBuildProcess, "No schema retrieval options build process provided"); this.limitOptionsBuildProcess = requireNonNull(limitOptionsBuildProcess, "No limit options build process provided"); this.urlBuildProcess = requireNonNull(urlBuildProcess, "No URL builder provided"); } protected  DatabaseConnector(
      final DatabaseServerType dbServerType,
      final Predicate<String> supportsUrl,
      final BiConsumer<InformationSchemaViewsBuilder, Connection>
          informationSchemaViewsBuildProcess,
      final BiConsumer<SchemaRetrievalOptionsBuilder, Connection>
          schemaRetrievalOptionsBuildProcess,
      final Consumer<LimitOptionsBuilder> limitOptionsBuildProcess,
      final Supplier<DatabaseConnectionUrlBuilder> urlBuildProcess); }
DatabaseConnector implements Options { protected DatabaseConnector( final DatabaseServerType dbServerType, final Predicate<String> supportsUrl, final BiConsumer<InformationSchemaViewsBuilder, Connection> informationSchemaViewsBuildProcess, final BiConsumer<SchemaRetrievalOptionsBuilder, Connection> schemaRetrievalOptionsBuildProcess, final Consumer<LimitOptionsBuilder> limitOptionsBuildProcess, final Supplier<DatabaseConnectionUrlBuilder> urlBuildProcess) { this.dbServerType = requireNonNull(dbServerType, "No database server type provided"); this.supportsUrl = requireNonNull(supportsUrl, "No predicate for URL support provided"); this.informationSchemaViewsBuildProcess = requireNonNull( informationSchemaViewsBuildProcess, "No information schema views build process provided"); this.schemaRetrievalOptionsBuildProcess = requireNonNull( schemaRetrievalOptionsBuildProcess, "No schema retrieval options build process provided"); this.limitOptionsBuildProcess = requireNonNull(limitOptionsBuildProcess, "No limit options build process provided"); this.urlBuildProcess = requireNonNull(urlBuildProcess, "No URL builder provided"); } protected  DatabaseConnector(
      final DatabaseServerType dbServerType,
      final Predicate<String> supportsUrl,
      final BiConsumer<InformationSchemaViewsBuilder, Connection>
          informationSchemaViewsBuildProcess,
      final BiConsumer<SchemaRetrievalOptionsBuilder, Connection>
          schemaRetrievalOptionsBuildProcess,
      final Consumer<LimitOptionsBuilder> limitOptionsBuildProcess,
      final Supplier<DatabaseConnectionUrlBuilder> urlBuildProcess); final DatabaseServerType getDatabaseServerType(); PluginCommand getHelpCommand(); final SchemaRetrievalOptionsBuilder getSchemaRetrievalOptionsBuilder(
      final Connection connection); DatabaseConnectionSource newDatabaseConnectionSource(
      final DatabaseConnectionOptions connectionOptions); final SchemaCrawlerOptions setSchemaCrawlerOptionsDefaults(
      final SchemaCrawlerOptions schemaCrawlerOptions); final boolean supportsUrl(final String url); @Override String toString(); }
DatabaseConnector implements Options { protected DatabaseConnector( final DatabaseServerType dbServerType, final Predicate<String> supportsUrl, final BiConsumer<InformationSchemaViewsBuilder, Connection> informationSchemaViewsBuildProcess, final BiConsumer<SchemaRetrievalOptionsBuilder, Connection> schemaRetrievalOptionsBuildProcess, final Consumer<LimitOptionsBuilder> limitOptionsBuildProcess, final Supplier<DatabaseConnectionUrlBuilder> urlBuildProcess) { this.dbServerType = requireNonNull(dbServerType, "No database server type provided"); this.supportsUrl = requireNonNull(supportsUrl, "No predicate for URL support provided"); this.informationSchemaViewsBuildProcess = requireNonNull( informationSchemaViewsBuildProcess, "No information schema views build process provided"); this.schemaRetrievalOptionsBuildProcess = requireNonNull( schemaRetrievalOptionsBuildProcess, "No schema retrieval options build process provided"); this.limitOptionsBuildProcess = requireNonNull(limitOptionsBuildProcess, "No limit options build process provided"); this.urlBuildProcess = requireNonNull(urlBuildProcess, "No URL builder provided"); } protected  DatabaseConnector(
      final DatabaseServerType dbServerType,
      final Predicate<String> supportsUrl,
      final BiConsumer<InformationSchemaViewsBuilder, Connection>
          informationSchemaViewsBuildProcess,
      final BiConsumer<SchemaRetrievalOptionsBuilder, Connection>
          schemaRetrievalOptionsBuildProcess,
      final Consumer<LimitOptionsBuilder> limitOptionsBuildProcess,
      final Supplier<DatabaseConnectionUrlBuilder> urlBuildProcess); final DatabaseServerType getDatabaseServerType(); PluginCommand getHelpCommand(); final SchemaRetrievalOptionsBuilder getSchemaRetrievalOptionsBuilder(
      final Connection connection); DatabaseConnectionSource newDatabaseConnectionSource(
      final DatabaseConnectionOptions connectionOptions); final SchemaCrawlerOptions setSchemaCrawlerOptionsDefaults(
      final SchemaCrawlerOptions schemaCrawlerOptions); final boolean supportsUrl(final String url); @Override String toString(); static final DatabaseConnector UNKNOWN; }