Package uk.ac.starlink.ttools.taplint
Class VotLintTapRunner
java.lang.Object
uk.ac.starlink.ttools.taplint.TapRunner
uk.ac.starlink.ttools.taplint.VotLintTapRunner
TapRunner implementation which uses the VotLint validation classes
to check the query's result VOTable.
- Since:
- 10 Jun 2011
- Author:
- Mark Taylor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic uk.ac.starlink.table.ValueInfoResult table parameter set if table was marked overflowed. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVotLintTapRunner(String name, boolean doChecks) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic VotLintTapRunnercreateAsyncRunner(long pollMillis, boolean doChecks) Returns a new instance which makes asynchronous queries.static VotLintTapRunnercreateGetSyncRunner(boolean doChecks) Returns a new instance which uses HTTP GET to make synchronous queries.static VotLintTapRunnercreatePostSyncRunner(boolean doChecks) Returns a new instance which uses HTTP POST to make synchronous queries.protected uk.ac.starlink.table.StarTableexecuteQuery(Reporter reporter, uk.ac.starlink.vo.TapQuery tq) Executes a TAP query, performing reporting as appropriate.protected abstract URLConnectiongetResultConnection(Reporter reporter, uk.ac.starlink.vo.TapQuery tq) Execute a TAP query and return a URL connection giving its result.uk.ac.starlink.votable.VOElementgetResultsResourceElement(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.booleanisOverflow(uk.ac.starlink.table.StarTable table) Indicates if the given table, which must have been retrieved from this object'sreadResultVOTable(uk.ac.starlink.ttools.taplint.Reporter, uk.ac.starlink.votable.VODocument)method, was marked as an overflow result.uk.ac.starlink.votable.VODocumentreadResultDocument(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.VODocumentreadResultDocument(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.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 uk.ac.starlink.ttools.taplint.TapRunner
attemptGetResultTable, getDescription, getResultTable, reportSummary
-
Field Details
-
OVERFLOW_INFO
public static uk.ac.starlink.table.ValueInfo OVERFLOW_INFOResult table parameter set if table was marked overflowed.
-
-
Constructor Details
-
VotLintTapRunner
Constructor.- Parameters:
name- name for this instancedoChecks- 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'sreadResultVOTable(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, uk.ac.starlink.vo.TapQuery tq) throws IOException Execute a TAP query and return a URL connection giving its result.- Parameters:
reporter- validation message destinationtq- 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:TapRunnerExecutes 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:
executeQueryin classTapRunner- Parameters:
reporter- validation message destinationtq- query to execute- Returns:
- result table
- Throws:
IOExceptionSAXException
-
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 destinationtq- query- Returns:
- result input stream
- Throws:
IOExceptionSAXException
-
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 destinationbaseIn- VOTable input stream- Returns:
- VOTable-aware DOM
- Throws:
IOExceptionSAXException
-
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 destinationbaseIn- VOTable input streamdoChecks- true to perform various checks on the result VOTable (including linting) and report them, false to be mostly silent and only report serious errorsminVotVersion- minimum required VOTable version; may be null if any will do- Returns:
- VOTable-aware DOM
- Throws:
IOExceptionSAXException
-
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 destinationdoc- TAP result DOM- Throws:
IOException
-
createPostSyncRunner
Returns a new instance which uses HTTP POST to make synchronous queries.- Parameters:
doChecks- true for detailed VOTable checking- Returns:
- new TapRunner
-
createGetSyncRunner
Returns a new instance which uses HTTP GET to make synchronous queries.- Parameters:
doChecks- true for detailed VOTable checking- Returns:
- new TapRunner
-
createAsyncRunner
Returns a new instance which makes asynchronous queries. This instance does not do exhaustive validation.- Parameters:
pollMillis- polling interval in millisecondsdoChecks- true for detailed VOTable checking- Returns:
- new TapRunner
-