Package uk.ac.starlink.vo
Class ConeSearch
java.lang.Object
uk.ac.starlink.vo.ConeSearch
Encapsulates the mechanics of a standard cone search web service.
The cone search service definition is taken to be supplied by the
document at
http://us-vo.org/pubs/files/conesearch.html.
- Since:
- 16 Dec 2004
- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
ConstructorsConstructorDescriptionConeSearch
(String serviceUrl) Constructs a new ConeSearch from its service URL with default content-coding.ConeSearch
(String serviceUrl, uk.ac.starlink.util.ContentCoding coding) Constructs a new ConeSearch from its service URL with explicit content-coding.ConeSearch
(RegResource resource, RegCapabilityInterface capability) Constructs a new ConeSearch from a CONE-type resource. -
Method Summary
Modifier and TypeMethodDescriptiongetSearchURL
(double ra, double dec, double sr, int verb) Returns a cone search CGI URL for this service.Returns the service URL for this service.uk.ac.starlink.table.StarTable
performSearch
(double ra, double dec, double sr, int verb, uk.ac.starlink.table.StarTableFactory tfact) Synchronously executes a cone search request.void
performSearch
(double ra, double dec, double sr, int verb, uk.ac.starlink.table.TableSink sink) Asynchronously executes a cone search request, feeding the resulting table to a TableSink.toString()
-
Constructor Details
-
ConeSearch
Constructs a new ConeSearch from its service URL with explicit content-coding.- Parameters:
serviceUrl
- base URL for cone searchcoding
- controls HTTP-level compression requests- Throws:
IllegalArgumentException
- if the service URL is unsuitable
-
ConeSearch
Constructs a new ConeSearch from its service URL with default content-coding.- Parameters:
serviceUrl
- base URL for cone search- Throws:
IllegalArgumentException
- if the service URL is unsuitable
-
ConeSearch
Constructs a new ConeSearch from a CONE-type resource.- Parameters:
resource
- resource from registrycapability
- cone search capability interface- Throws:
IllegalArgumentException
- if the service URL is unsuitable
-
-
Method Details
-
performSearch
public void performSearch(double ra, double dec, double sr, int verb, uk.ac.starlink.table.TableSink sink) throws IOException Asynchronously executes a cone search request, feeding the resulting table to a TableSink. Note this will not correctly identify error conditions.- Parameters:
ra
- J2000 right ascension in decimal degreesdec
- J2000 declination in decimal degreessr
- search radius in decimal degreesverb
- verbosity level - 1, 2 or 3 for increasing verbosity, other values give defaultsink
- table destination- Throws:
IOException
-
performSearch
public uk.ac.starlink.table.StarTable performSearch(double ra, double dec, double sr, int verb, uk.ac.starlink.table.StarTableFactory tfact) throws IOException Synchronously executes a cone search request.- Parameters:
ra
- J2000 right ascension in decimal degreesdec
- J2000 declination in decimal degreessr
- search radius in decimal degreesverb
- verbosity level - 1, 2 or 3 for increasing verbosity, other values give default- Returns:
- table
- Throws:
IOException
-
getSearchURL
Returns a cone search CGI URL for this service.- Parameters:
ra
- J2000 right ascension in decimal degreesdec
- J2000 declination in decimal degreessr
- search radius in decimal degreesverb
- verbosity level - 1, 2 or 3 for increasing verbosity, other values give default- Returns:
- CGI url which will return the VOTable result of this query
-
getServiceURL
Returns the service URL for this service.- Returns:
- base URL for cone search queries
-
toString
-