Package uk.ac.starlink.vo

# Class Vosi11TapMetaReader

java.lang.Object
uk.ac.starlink.vo.Vosi11TapMetaReader

All Implemented Interfaces:
  `TapMetaReader`

public class Vosi11TapMetaReader extends Object implements TapMetaReader
TapMetaReader that works with the VOSI-1.1 scalable /tables endpoint. It should work correctly with VOSI 1.1 services and also with VOSI 1.0 services and services (like, at time of writing, TAPVizieR) that declare themselves as VOSI 1.0 but refuse to emit table details for the full tables list.

Services may return tables without column and foreign key metadata (table elements have no column children). If such a table is retrieved, the detailed metadata may be obtained from a child URL /tables/(table-name). The service may accept a `detail` parameter for the /tables URL, with possible values `min` or `max` (that is `/tables?detail=min` or `/tables?detail=max`) to give it a non-binding hint about whether detail is returned in child tables.

Since:
  16 Feb 2016
Author:
  Mark Taylor

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`Vosi11TapMetaReader.DetailMode`
Enumeration for detail-preference mode of table metadata queries.

## Constructor Summary

Constructors
Constructor
Description
`Vosi11TapMetaReader(URL tablesetUrl, MetaNameFixer fixer, uk.ac.starlink.util.ContentCoding coding, Vosi11TapMetaReader.DetailMode detailMode)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getMeans()`
Returns a textual indication of the method or protocol this reader uses to acquire TAP metadata.
`String`
`getSource()`
Returns a textual indication of where the metadata is coming from, typically a URL.
`ColumnMeta[]`
`readColumns(TableMeta table)`
Acquires metadata about columns in a given table from a TAP service.
`ForeignMeta[]`
`readForeignKeys(TableMeta table)`
Acquires metadata about foreign keys in a given table from a TAP service.
`SchemaMeta[]`
`readSchemas()`
Acquires metadata about schemas in a TAP service.
`TableMeta[]`
`readTables(SchemaMeta schema)`
Acquires metadata about tables in a given schema from a TAP service.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Vosi11TapMetaReader

public Vosi11TapMetaReader(URL tablesetUrl, MetaNameFixer fixer, uk.ac.starlink.util.ContentCoding coding, Vosi11TapMetaReader.DetailMode detailMode)
Constructor.

Parameters:
  `tablesetUrl` - URL of VOSI1.1-like TAP tableset service
  `fixer` - object that fixes up syntactically incorrect table/column names; if null no fixing is done; has no effect for compliant VODataService documents
  `coding` - configures HTTP content-coding
  `detailMode` - detail mode

## Method Details

### getMeans

public String getMeans()
Description copied from interface: `TapMetaReader`
Returns a textual indication of the method or protocol this reader uses to acquire TAP metadata.

Specified by:
  `getMeans` in interface `TapMetaReader`
Returns:
  short description of metadata acquisition method

### getSource

public String getSource()
Description copied from interface: `TapMetaReader`
Returns a textual indication of where the metadata is coming from, typically a URL.

Specified by:
  `getSource` in interface `TapMetaReader`
Returns:
  address of metadata

### readSchemas

public SchemaMeta[] readSchemas() throws IOException
Description copied from interface: `TapMetaReader`
Acquires metadata about schemas in a TAP service.

May be slow.

Specified by:
  `readSchemas` in interface `TapMetaReader`
Returns:
  schema metadata array
Throws:
  `IOException`

### readTables

public TableMeta[] readTables(SchemaMeta schema)
Description copied from interface: `TapMetaReader`
Acquires metadata about tables in a given schema from a TAP service.

May be slow. May throw UnsupportedOperationException if not needed.

Specified by:
  `readTables` in interface `TapMetaReader`
Parameters:
  `schema` - schema containing tables; not altered by call
Returns:
  table metadata array
Throws:
  `UnsupportedOperationException` - always

### readColumns

public ColumnMeta[] readColumns(TableMeta table) throws IOException
Description copied from interface: `TapMetaReader`
Acquires metadata about columns in a given table from a TAP service.

May be slow. May throw UnsupportedOperationException if not needed.

Specified by:
  `readColumns` in interface `TapMetaReader`
Parameters:
  `table` - table containing columns; not altered by call
Returns:
  column metadata array
Throws:
  `IOException`

### readForeignKeys

public ForeignMeta[] readForeignKeys(TableMeta table) throws IOException
Description copied from interface: `TapMetaReader`
Acquires metadata about foreign keys in a given table from a TAP service.

May be slow. May throw UnsupportedOperationException if not needed.

Specified by:
  `readForeignKeys` in interface `TapMetaReader`
Parameters:
  `table` - table containing columns; not altered by call
Returns:
  foreign key metadata array
Throws:
  `IOException`