Class 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 search
        coding - 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 registry
        capability - 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 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:
        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 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:
        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 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 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 class java.lang.Object