public class TapSchemaInterrogator
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static class |
TapSchemaInterrogator.MetaQuerier<T> |
Object that can read a certain type of TAP metadata object from
a table of a TAP_SCHEMA database table.
|
Modifier and Type | Field | Description |
---|---|---|
static TapSchemaInterrogator.MetaQuerier<ColumnMeta> |
COLUMN_QUERIER |
Acquires ColumnMeta objects from TAP_SCHEMA.columns.
|
static TapSchemaInterrogator.MetaQuerier<ForeignMeta> |
FKEY_QUERIER |
Acquires ForeignMeta objects from TAP_SCHEMA.keys.
|
static TapSchemaInterrogator.MetaQuerier<ForeignMeta.Link> |
LINK_QUERIER |
Acquires ForeignMeta.Link objects from TAP_SCHEMA.key_columns.
|
static TapSchemaInterrogator.MetaQuerier<SchemaMeta> |
SCHEMA_QUERIER |
Acquires SchemaMeta objects from TAP_SCHEMA.schemas.
|
static TapSchemaInterrogator.MetaQuerier<TableMeta> |
TABLE_QUERIER |
Acquires TableMeta objects from TAP_SCHEMA.tables.
|
Constructor | Description |
---|---|
TapSchemaInterrogator(EndpointSet endpointSet,
int maxrec,
uk.ac.starlink.util.ContentCoding coding) |
Constructs an interrogator with explicit configuration.
|
Modifier and Type | Method | Description |
---|---|---|
protected TapQuery |
createTapQuery(java.lang.String adql) |
Constructs a TAP query for a given ADQL string.
|
protected uk.ac.starlink.table.StarTable |
executeQuery(TapQuery tq) |
Performs an ADQL TAP query to this interrogator's service.
|
EndpointSet |
getEndpointSet() |
Returns the TAP endpoint locations used by this interrogator.
|
static void |
main(java.lang.String[] args) |
Prints out metadata content of a given TAP service.
|
void |
populateForeignKey(ForeignMeta fmeta,
java.util.Map<java.lang.String,java.util.List<ForeignMeta.Link>> lMap) |
Fills in link information for a ForeignMeta object.
|
void |
populateSchema(SchemaMeta smeta,
java.util.Map<java.lang.String,java.util.List<TableMeta>> tMap) |
Fills in table information for a SchemaMeta object.
|
void |
populateTable(TableMeta tmeta,
java.util.Map<java.lang.String,java.util.List<ForeignMeta>> fMap,
java.util.Map<java.lang.String,java.util.List<ColumnMeta>> cMap) |
Fills in foreign key and column information for a TableMeta object,
Any relevant entries are removed from the supplied maps.
|
SchemaMeta[] |
queryMetadata() |
This convenience method returns an array of fully filled in
SchemaMeta objects describing the tables available from the service.
|
<T> java.util.List<T> |
readList(TapSchemaInterrogator.MetaQuerier<T> mq,
java.lang.String moreAdql) |
Reads a list of metadata items using a given MetaQuerier object.
|
<T> java.util.Map<java.lang.String,java.util.List<T>> |
readMap(TapSchemaInterrogator.MetaQuerier<T> mq,
java.lang.String moreAdql) |
Reads a map of metadata items using a given MetaQuerier object.
|
SchemaMeta[] |
readSchemas(boolean populateSchemas,
boolean populateTables,
boolean addOrphanTables) |
Reads all schemas.
|
public static final TapSchemaInterrogator.MetaQuerier<ForeignMeta.Link> LINK_QUERIER
public static final TapSchemaInterrogator.MetaQuerier<ForeignMeta> FKEY_QUERIER
public static final TapSchemaInterrogator.MetaQuerier<ColumnMeta> COLUMN_QUERIER
public static final TapSchemaInterrogator.MetaQuerier<TableMeta> TABLE_QUERIER
public static final TapSchemaInterrogator.MetaQuerier<SchemaMeta> SCHEMA_QUERIER
public TapSchemaInterrogator(EndpointSet endpointSet, int maxrec, uk.ac.starlink.util.ContentCoding coding)
endpointSet
- TAP service locationsmaxrec
- maximum number of records to retrieve per querycoding
- configures HTTP compressionpublic EndpointSet getEndpointSet()
public SchemaMeta[] queryMetadata() throws java.io.IOException
java.io.IOException
public SchemaMeta[] readSchemas(boolean populateSchemas, boolean populateTables, boolean addOrphanTables) throws java.io.IOException
populateSchemas
- if true, schemas will contain non-null
table listspopulateTables
- if true, tables will contain non-null
column/key lists
(ignored if populateSchemas is false)addOrphanTables
- if true include tables whose schemas are not
explicitly declaredjava.io.IOException
public <T> java.util.Map<java.lang.String,java.util.List<T>> readMap(TapSchemaInterrogator.MetaQuerier<T> mq, java.lang.String moreAdql) throws java.io.IOException
The form of the basic SELECT statement generated by this
call is "SELECT <columns≫ FROM <table>".
If non-null the text of the moreAdql
parameter
is appended (after a space), so it may be used to qualify the
query further.
mq
- type-specific queriermoreAdql
- additional ADQL text to append after the
FROM clause (for example a WHERE clause);
may be nulljava.io.IOException
public <T> java.util.List<T> readList(TapSchemaInterrogator.MetaQuerier<T> mq, java.lang.String moreAdql) throws java.io.IOException
The form of the basic SELECT statement generated by this
call is "SELECT <columns≫ FROM <table>".
If non-null the text of the moreAdql
parameter
is appended (after a space), so it may be used to qualify the
query further.
mq
- type-specific queriermoreAdql
- additional ADQL text to append after the
FROM clause (for example a WHERE clause);
may be nulljava.io.IOException
public void populateForeignKey(ForeignMeta fmeta, java.util.Map<java.lang.String,java.util.List<ForeignMeta.Link>> lMap)
fmeta
- unpopulated foreign key itemlMap
- map acquired using LINK_QUERIER
public void populateTable(TableMeta tmeta, java.util.Map<java.lang.String,java.util.List<ForeignMeta>> fMap, java.util.Map<java.lang.String,java.util.List<ColumnMeta>> cMap)
tmeta
- unpopulated table metadata itemfMap
- map acquired using FKEY_QUERIER
cMap
- map acquired using COLUMN_QUERIER
public void populateSchema(SchemaMeta smeta, java.util.Map<java.lang.String,java.util.List<TableMeta>> tMap)
smeta
- unpopulated schema metadata itemtMap
- map acquired using TABLE_QUERIER
protected TapQuery createTapQuery(java.lang.String adql)
adql
- query textprotected uk.ac.starlink.table.StarTable executeQuery(TapQuery tq) throws java.io.IOException
tq
- tap queryjava.io.IOException
public static void main(java.lang.String[] args) throws java.io.IOException
args
- first element is TAP service URLjava.io.IOException
Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.