# Class VotLintTapRunner

java.lang.Object
uk.ac.starlink.ttools.taplint.TapRunner
uk.ac.starlink.ttools.taplint.VotLintTapRunner

public abstract class VotLintTapRunner extends TapRunner
TapRunner implementation which uses the VotLint validation classes to check the query's result VOTable.

Since:
  10 Jun 2011
Author:
  Mark Taylor

## Field Summary

Fields
Modifier and Type
Field
Description
`static uk.ac.starlink.table.ValueInfo`
`OVERFLOW_INFO`
Result table parameter set if table was marked overflowed.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`VotLintTapRunner(String name, boolean doChecks)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`static VotLintTapRunner`
`createAsyncRunner(long pollMillis, boolean doChecks)`
Returns a new instance which makes asynchronous queries.
`static VotLintTapRunner`
`createGetSyncRunner(boolean doChecks)`
Returns a new instance which uses HTTP GET to make synchronous queries.
`static VotLintTapRunner`
`createPostSyncRunner(boolean doChecks)`
Returns a new instance which uses HTTP POST to make synchronous queries.
`protected uk.ac.starlink.table.StarTable`
`executeQuery(Reporter reporter, uk.ac.starlink.vo.TapQuery tq)`
Executes a TAP query, performing reporting as appropriate.
`protected abstract URLConnection`
`getResultConnection(Reporter reporter, uk.ac.starlink.vo.TapQuery tq)`
Execute a TAP query and return a URL connection giving its result.
`uk.ac.starlink.votable.VOElement`
`getResultsResourceElement(Reporter reporter, uk.ac.starlink.votable.VODocument doc)`
Returns the RESOURCE element marked with type="results" from a given VODocument, or the best guess at it.
`boolean`
`isOverflow(uk.ac.starlink.table.StarTable table)`
Indicates if the given table, which must have been retrieved from this object's `readResultVOTable(Reporter, VODocument)` method, was marked as an overflow result.
`uk.ac.starlink.votable.VODocument`
`readResultDocument(Reporter reporter, InputStream baseIn)`
Reads a TAP result VODocument from an input stream, checking it and reporting messages as required.
`static uk.ac.starlink.votable.VODocument`
`readResultDocument(Reporter reporter, InputStream baseIn, boolean doChecks, uk.ac.starlink.votable.VOTableVersion minVotVersion)`
Utility method to read a VODocument from an input stream, checking it and reporting messages as required.
`InputStream`
`readResultInputStream(Reporter reporter, uk.ac.starlink.vo.TapQuery tq)`
Returns an input stream which should contain the result VOTable from a TAP query, performing checks and making reports as appropriate on the way.

### Methods inherited from class TapRunner

`attemptGetResultTable, getDescription, getResultTable, reportSummary`

### Methods inherited from class Object

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

## Field Details

### OVERFLOW_INFO

public static uk.ac.starlink.table.ValueInfo OVERFLOW_INFO
Result table parameter set if table was marked overflowed.

## Constructor Details

### VotLintTapRunner

protected VotLintTapRunner(String name, boolean doChecks)
Constructor.

Parameters:
  `name` - name for this instance
  `doChecks` - true to perform various checks on the result VOTable (including linting) and report them, false to be mostly silent and only report serious errors

## Method Details

### isOverflow

public boolean isOverflow(uk.ac.starlink.table.StarTable table)
Indicates if the given table, which must have been retrieved from this object's `readResultVOTable(Reporter, VODocument)` method, was marked as an overflow result.

Parameters:
  `table` - TAP result table read by this object
Returns:
  true iff overflow

### getResultConnection

protected abstract URLConnection getResultConnection(Reporter reporter, uk.ac.starlink.vo.TapQuery tq) throws IOException
Execute a TAP query and return a URL connection giving its result.

Parameters:
  `reporter` - validation message destination
  `tq` - query
Returns:
  result data source
Throws:
  `IOException`

### executeQuery

protected uk.ac.starlink.table.StarTable executeQuery(Reporter reporter, uk.ac.starlink.vo.TapQuery tq) throws IOException, SAXException
Description copied from class: `TapRunner`
Executes a TAP query, performing reporting as appropriate. The result may be null, but will normally be either a table or an IOException will result.

Specified by:
  `executeQuery` in class `TapRunner`
Parameters:
  `reporter` - validation message destination
  `tq` - query to execute
Returns:
  result table
Throws:
  `IOException`
  `SAXException`

### readResultInputStream

public InputStream readResultInputStream(Reporter reporter, uk.ac.starlink.vo.TapQuery tq) throws IOException, SAXException
Returns an input stream which should contain the result VOTable from a TAP query, performing checks and making reports as appropriate on the way.

Parameters:
  `reporter` - validation message destination
  `tq` - query
Returns:
  result input stream
Throws:
  `IOException`
  `SAXException`

### readResultDocument

public uk.ac.starlink.votable.VODocument readResultDocument(Reporter reporter, InputStream baseIn) throws IOException, SAXException
Reads a TAP result VODocument from an input stream, checking it and reporting messages as required.

Parameters:
  `reporter` - validation message destination
  `baseIn` - VOTable input stream
Returns:
  VOTable-aware DOM
Throws:
  `IOException`
  `SAXException`

### readResultDocument

public static uk.ac.starlink.votable.VODocument readResultDocument(Reporter reporter, InputStream baseIn, boolean doChecks, uk.ac.starlink.votable.VOTableVersion minVotVersion) throws IOException, SAXException
Utility method to read a VODocument from an input stream, checking it and reporting messages as required.

Parameters:
  `reporter` - validation message destination
  `baseIn` - VOTable input stream
  `doChecks` - true to perform various checks on the result VOTable (including linting) and report them, false to be mostly silent and only report serious errors
  `minVotVersion` - minimum required VOTable version; may be null if any will do
Returns:
  VOTable-aware DOM
Throws:
  `IOException`
  `SAXException`

### getResultsResourceElement

public uk.ac.starlink.votable.VOElement getResultsResourceElement(Reporter reporter, uk.ac.starlink.votable.VODocument doc) throws IOException
Returns the RESOURCE element marked with type="results" from a given VODocument, or the best guess at it.

Parameters:
  `reporter` - validation message destination
  `doc` - TAP result DOM
Throws:
  `IOException`

### createPostSyncRunner

public static VotLintTapRunner createPostSyncRunner(boolean doChecks)
Returns a new instance which uses HTTP POST to make synchronous queries.

Parameters:
  `doChecks` - true for detailed VOTable checking
Returns:
  new TapRunner

### createGetSyncRunner

public static VotLintTapRunner createGetSyncRunner(boolean doChecks)
Returns a new instance which uses HTTP GET to make synchronous queries.

Parameters:
  `doChecks` - true for detailed VOTable checking
Returns:
  new TapRunner

### createAsyncRunner

public static VotLintTapRunner createAsyncRunner(long pollMillis, boolean doChecks)
Returns a new instance which makes asynchronous queries. This instance does not do exhaustive validation.

Parameters:
  `pollMillis` - polling interval in milliseconds
  `doChecks` - true for detailed VOTable checking
Returns:
  new TapRunner