Package uk.ac.starlink.vo

# Class ConeSearch

java.lang.Object
uk.ac.starlink.vo.ConeSearch

public class ConeSearch extends 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(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 Type
Method
Description
`URL`
`getSearchURL(double ra, double dec, double sr, int verb)`
Returns a cone search CGI URL for this service.
`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.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### ConeSearch

public ConeSearch(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 search
  `coding` - controls HTTP-level compression requests
Throws:
  `IllegalArgumentException` - if the service URL is unsuitable

### ConeSearch

public ConeSearch(String serviceUrl)
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

public ConeSearch(RegResource resource, RegCapabilityInterface capability)
Constructs a new ConeSearch from a CONE-type resource.

Parameters:
  `resource` - resource from registry
  `capability` - 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 degrees
  `dec` - J2000 declination in decimal degrees
  `sr` - search radius in decimal degrees
  `verb` - verbosity level - 1, 2 or 3 for increasing verbosity, other values give default
  `sink` - 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 degrees
  `dec` - J2000 declination in decimal degrees
  `sr` - search radius in decimal degrees
  `verb` - verbosity level - 1, 2 or 3 for increasing verbosity, other values give default
Returns:
  table
Throws:
  `IOException`

### getSearchURL

public 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 degrees
  `dec` - J2000 declination in decimal degrees
  `sr` - search radius in decimal degrees
  `verb` - 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 URL getServiceURL()
Returns the service URL for this service.

Returns:
  base URL for cone search queries

### toString

public String toString()

Overrides:
  `toString` in class `Object`