Class 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​(java.lang.String name, boolean doChecks)
      Constructor.
    • Field Detail

      • OVERFLOW_INFO

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

      • VotLintTapRunner

        protected VotLintTapRunner​(java.lang.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

      • getResultConnection

        protected abstract java.net.URLConnection getResultConnection​(Reporter reporter,
                                                                      uk.ac.starlink.vo.TapQuery tq)
                                                               throws java.io.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:
        java.io.IOException
      • executeQuery

        protected uk.ac.starlink.table.StarTable executeQuery​(Reporter reporter,
                                                              uk.ac.starlink.vo.TapQuery tq)
                                                       throws java.io.IOException,
                                                              org.xml.sax.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:
        java.io.IOException
        org.xml.sax.SAXException
      • readResultInputStream

        public java.io.InputStream readResultInputStream​(Reporter reporter,
                                                         uk.ac.starlink.vo.TapQuery tq)
                                                  throws java.io.IOException,
                                                         org.xml.sax.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:
        java.io.IOException
        org.xml.sax.SAXException
      • readResultDocument

        public uk.ac.starlink.votable.VODocument readResultDocument​(Reporter reporter,
                                                                    java.io.InputStream baseIn)
                                                             throws java.io.IOException,
                                                                    org.xml.sax.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:
        java.io.IOException
        org.xml.sax.SAXException
      • readResultDocument

        public static uk.ac.starlink.votable.VODocument readResultDocument​(Reporter reporter,
                                                                           java.io.InputStream baseIn,
                                                                           boolean doChecks,
                                                                           uk.ac.starlink.votable.VOTableVersion minVotVersion)
                                                                    throws java.io.IOException,
                                                                           org.xml.sax.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:
        java.io.IOException
        org.xml.sax.SAXException
      • getResultsResourceElement

        public uk.ac.starlink.votable.VOElement getResultsResourceElement​(Reporter reporter,
                                                                          uk.ac.starlink.votable.VODocument doc)
                                                                   throws java.io.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:
        java.io.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