uk.ac.starlink.ttools.taplint
Class VotLintTapRunner

java.lang.Object
  extended by uk.ac.starlink.ttools.taplint.TapRunner
      extended by 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
static ValueInfo OVERFLOW_INFO
          Result table parameter set if table was marked overflowed.
 
Constructor Summary
protected VotLintTapRunner(String name, boolean doChecks)
          Constructor.
 
Method Summary
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  StarTable executeQuery(Reporter reporter, TapQuery tq)
          Executes a TAP query, performing reporting as appropriate.
protected abstract  URLConnection getResultConnection(Reporter reporter, TapQuery tq)
          Execute a TAP query and return a URL connection giving its result.
 VOElement getResultsResourceElement(Reporter reporter, VODocument doc)
          Returns the RESOURCE element marked with type="results" from a given VODocument, or the best guess at it.
 boolean isOverflow(StarTable table)
          Indicates if the given table, which must have been retrieved from this object's readResultVOTable(uk.ac.starlink.ttools.taplint.Reporter, uk.ac.starlink.votable.VODocument) method, was marked as an overflow result.
 VODocument readResultDocument(Reporter reporter, InputStream baseIn)
          Reads a TAP result VODocument from an input stream, checking it and reporting messages as appropriate.
 InputStream readResultInputStream(Reporter reporter, TapQuery tq)
          Returns an input stream which should containing the result VOTable from a TAP query, performing checks and making reports as appropriate on the way.
 
Methods inherited from class uk.ac.starlink.ttools.taplint.TapRunner
attemptGetResultTable, getDescription, getResultTable, reportSummary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OVERFLOW_INFO

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

Constructor Detail

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 Detail

isOverflow

public boolean isOverflow(StarTable table)
Indicates if the given table, which must have been retrieved from this object's readResultVOTable(uk.ac.starlink.ttools.taplint.Reporter, uk.ac.starlink.votable.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,
                                                     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 StarTable executeQuery(Reporter reporter,
                                 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,
                                         TapQuery tq)
                                  throws IOException,
                                         SAXException
Returns an input stream which should containing 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 VODocument readResultDocument(Reporter reporter,
                                     InputStream baseIn)
                              throws IOException,
                                     SAXException
Reads a TAP result VODocument from an input stream, checking it and reporting messages as appropriate.

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

getResultsResourceElement

public VOElement getResultsResourceElement(Reporter reporter,
                                           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


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.