Package uk.ac.starlink.vo
Class ConeSearch
- java.lang.Object
-
- uk.ac.starlink.vo.ConeSearch
-
public class ConeSearch extends java.lang.Object
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
Constructors Constructor Description ConeSearch(java.lang.String serviceUrl)
Constructs a new ConeSearch from its service URL with default content-coding.ConeSearch(java.lang.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.URL
getSearchURL(double ra, double dec, double sr, int verb)
Returns a cone search CGI URL for this service.java.net.URL
getServiceURL()
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.java.lang.String
toString()
-
-
-
Constructor Detail
-
ConeSearch
public ConeSearch(java.lang.String serviceUrl, uk.ac.starlink.util.ContentCoding coding)
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:
java.lang.IllegalArgumentException
- if the service URL is unsuitable
-
ConeSearch
public ConeSearch(java.lang.String serviceUrl)
Constructs a new ConeSearch from its service URL with default content-coding.- Parameters:
serviceUrl
- base URL for cone search- Throws:
java.lang.IllegalArgumentException
- if the service URL is unsuitable
-
ConeSearch
public ConeSearch(RegResource resource, RegCapabilityInterface capability)
Constructs a new ConeSearch from a CONE-type resource.- Parameters:
resource
- resource from registrycapability
- cone search capability interface- Throws:
java.lang.IllegalArgumentException
- if the service URL is unsuitable
-
-
Method Detail
-
performSearch
public void performSearch(double ra, double dec, double sr, int verb, uk.ac.starlink.table.TableSink sink) throws java.io.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:
java.io.IOException
-
performSearch
public uk.ac.starlink.table.StarTable performSearch(double ra, double dec, double sr, int verb, uk.ac.starlink.table.StarTableFactory tfact) throws java.io.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:
java.io.IOException
-
getSearchURL
public java.net.URL getSearchURL(double ra, double dec, double sr, int verb)
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
public java.net.URL getServiceURL()
Returns the service URL for this service.- Returns:
- base URL for cone search queries
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-