Class SchemaReader.Options

java.lang.Object
org.ivoa.dm.tapschema.utils.SchemaReader.Options
Enclosing class:
SchemaReader

public static final class SchemaReader.Options extends Object
Options controlling metadata harvesting. This class gives some control over the schema that are harvested and the types of tables that are included. The options are designed to be fluent, so that they can be easily chained together. For example:
   new SchemaReader(connection).translate(new SchemaReader.Options()
     .setIncludeSystemSchemas(true)
     .setIncludeSchemas(Set.of("PUBLIC", "ASTRO"))
     .setTableTypes("TABLE", "VIEW"));
 
  • Constructor Details

    • Options

      public Options()
  • Method Details

    • isIncludeSystemSchemas

      public boolean isIncludeSystemSchemas()
      Checks whether system schemas should be included in the harvest.
      Returns:
      true if system schemas are to be included, false otherwise.
    • setCatalog

      public SchemaReader.Options setCatalog(String catalog)
      Sets the catalog to harvest from the database.
      Parameters:
      catalog - the catalog name, or null for the default catalog.
      Returns:
      this Options instance for method chaining.
    • getIncludeSchemas

      public Set<String> getIncludeSchemas()
      Gets the set of schema names to include in the harvest.
      Returns:
      an immutable set of schema names to include, or an empty set if all schemas should be considered.
    • setIncludeSchemas

      public SchemaReader.Options setIncludeSchemas(Collection<String> includeSchemas)
      Sets the schema names to include in the harvest. Null or blank schema names are filtered out. If null or empty collection is provided, all non-system schemas will be considered based on other filter settings.
      Parameters:
      includeSchemas - the collection of schema names to include, or null/empty to include all eligible schemas.
      Returns:
      this Options instance for method chaining.
    • getTableTypes

      public String[] getTableTypes()
      Gets the table types to include in the harvest.
      Returns:
      an array of table type names (e.g., "TABLE", "VIEW"), or null for all types.
    • setTableTypes

      public SchemaReader.Options setTableTypes(String... tableTypes)
      Sets the table types to include in the harvest. If null or empty, no table types will be filtered (all types included).
      Parameters:
      tableTypes - variable length array of table type names (e.g., "TABLE", "VIEW", "MATERIALIZED VIEW"), or null/empty to include all table types.
      Returns:
      this Options instance for method chaining.
    • setIncludeSystemSchemas

      public SchemaReader.Options setIncludeSystemSchemas(boolean includeSystemSchemas)
      Sets whether system schemas should be included in the harvest.
      Parameters:
      includeSystemSchemas - true to include system schemas, false to exclude them.
      Returns:
      this Options instance for method chaining.
    • getCatalog

      public String getCatalog()
      Gets the catalog to harvest from the database.
      Returns:
      the catalog name, or null for the default catalog.