Package org.ivoa.dm.tapschema.utils
Class SchemaReader.Options
java.lang.Object
org.ivoa.dm.tapschema.utils.SchemaReader.Options
- Enclosing class:
- SchemaReader
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the catalog to harvest from the database.Gets the set of schema names to include in the harvest.String[]Gets the table types to include in the harvest.booleanChecks whether system schemas should be included in the harvest.setCatalog(String catalog) Sets the catalog to harvest from the database.setIncludeSchemas(Collection<String> includeSchemas) Sets the schema names to include in the harvest.setIncludeSystemSchemas(boolean includeSystemSchemas) Sets whether system schemas should be included in the harvest.setTableTypes(String... tableTypes) Sets the table types to include in the harvest.
-
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
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
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
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
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
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
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
Gets the catalog to harvest from the database.- Returns:
- the catalog name, or null for the default catalog.
-