|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.vo.TapQuery
public class TapQuery
Represents a query to be made to a Table Access Protocol service. This class aggregates the information which needs to be sent to make such a query and provides methods to submit the query synchronously or asynchronously. It also contains some static methods to perform other TAP-related operations.
Constructor Summary | |
---|---|
TapQuery(URL serviceUrl,
String adql,
Map<String,String> extraParams)
Constructs a query with no uploaded tables. |
|
TapQuery(URL serviceUrl,
String adql,
Map<String,String> extraParams,
Map<String,StarTable> uploadMap,
long uploadLimit,
VOTableWriter vowriter)
Constructs a query with uploaded tables. |
Method Summary | |
---|---|
HttpURLConnection |
createSyncConnection()
Opens a URL connection for the result of synchronously executing this query. |
StarTable |
executeSync(StoragePolicy storage)
Executes this query synchronously and returns the resulting table. |
boolean |
executeSync(TableSink sink)
Executes this query synchronously and streams the resulting table to a table sink. |
static URLConnection |
followRedirects(URLConnection conn)
Takes a URLConnection and repeatedly follows 303 redirects until a non-303 status is achieved. |
String |
getAdql()
Returns the text of the ADQL query for this object. |
static StarTable |
getResult(UwsJob uwsJob,
StoragePolicy storage)
Reads and returns the table that resulted from a successful TAP query, represented by a given UWS job. |
URL |
getServiceUrl()
Returns the TAP service URL to which this query will be submitted. |
Map<String,HttpStreamParam> |
getStreamParams()
Returns the map of streamed parameters to be passed to the TAP service. |
Map<String,String> |
getStringParams()
Returns the map of string parameters to be passed to the TAP service. |
static InputStream |
getVOTableStream(URLConnection conn)
Gets an input stream from a URL connection that should contain a VOTable. |
static StarTable |
readResultVOTable(URLConnection conn,
StoragePolicy storage)
Reads a VOTable which may represent a successful result or an error. |
static SchemaMeta[] |
readTableMetadata(URL serviceUrl)
Reads table metadata from a TAP service. |
static TapCapability |
readTapCapability(URL serviceUrl)
Reads capability information from a TAP service. |
static boolean |
streamResultVOTable(URLConnection conn,
TableSink sink)
Streams a VOTable document which may represent a successful result or an error. |
UwsJob |
submitAsync()
Submits this query asynchronously and returns the corresponding UWS job. |
static StarTable |
waitForResult(UwsJob uwsJob,
StoragePolicy storage,
long pollMillis)
Blocks until the TAP query represented by a given UWS job has completed, then returns a table based on the result. |
static URL |
waitForResultUrl(UwsJob uwsJob,
long pollMillis)
Blocks until the TAP query represented by a given UWS job has completed, then returns the URL from which the successful result can be obtained. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TapQuery(URL serviceUrl, String adql, Map<String,String> extraParams)
serviceUrl
- base service URL for TAP service
(excluding "/[a]sync")adql
- text of ADQL queryextraParams
- key->value map for optional parameters;
if any of these match the names of standard
parameters (upper case) the standard values will
be overwritten, so use with care (may be null)public TapQuery(URL serviceUrl, String adql, Map<String,String> extraParams, Map<String,StarTable> uploadMap, long uploadLimit, VOTableWriter vowriter) throws IOException
serviceUrl
- base service URL for TAP service
(excluding "/[a]sync")adql
- text of ADQL queryextraParams
- key->value map for optional parameters;
if any of these match the names of standard
parameters (upper case) the standard values will
be overwritten, so use with care (may be null)uploadMap
- name->table map of tables to be uploaded to
the service for the query (may be null)uploadLimit
- maximum number of bytes that may be uploaded;
if negative, no limit is applied,
ignored if uploadMap
null or emptyvowriter
- serializer for producing content of uploaded tables;
ignored if uploadMap
null or empty,
if null a default value is used
IOException
- if upload tables exceed the upload limitMethod Detail |
---|
public String getAdql()
public URL getServiceUrl()
public Map<String,String> getStringParams()
public Map<String,HttpStreamParam> getStreamParams()
public StarTable executeSync(StoragePolicy storage) throws IOException
storage
- storage policy for caching table data
IOException
public boolean executeSync(TableSink sink) throws IOException, SAXException
sink
- table destination
IOException
SAXException
public HttpURLConnection createSyncConnection() throws IOException
IOException
public UwsJob submitAsync() throws IOException
IOException
public static URL waitForResultUrl(UwsJob uwsJob, long pollMillis) throws IOException, InterruptedException
uwsJob
- started UWS job representing an async TAP querypollMillis
- polling interval in milliseconds
IOException
InterruptedException
public static StarTable waitForResult(UwsJob uwsJob, StoragePolicy storage, long pollMillis) throws IOException, InterruptedException
uwsJob
- started UWS job representing an async TAP querystorage
- storage policy for caching table datapollMillis
- polling interval in milliseconds
IOException
InterruptedException
public static StarTable getResult(UwsJob uwsJob, StoragePolicy storage) throws IOException
uwsJob
- successfully completed UWS job representing
an async TAP querystorage
- storage policy for caching table data
IOException
public static SchemaMeta[] readTableMetadata(URL serviceUrl) throws IOException, SAXException
serviceUrl
- base TAP service URL
IOException
SAXException
public static TapCapability readTapCapability(URL serviceUrl) throws IOException, SAXException
serviceUrl
- base TAP service URL
IOException
SAXException
public static StarTable readResultVOTable(URLConnection conn, StoragePolicy storage) throws IOException
conn
- connection to table resourcestorage
- storage policy
IOException
public static boolean streamResultVOTable(URLConnection conn, TableSink sink) throws IOException, SAXException
conn
- connection to table resourcesink
- destination for table result of succesful query
IOException
SAXException
public static InputStream getVOTableStream(URLConnection conn) throws IOException
conn
- connection to result of TAP service call
IOException
public static URLConnection followRedirects(URLConnection conn) throws IOException
conn
- initial URL connection
hconn
)
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |