edu.harvard.cfa.vo.tapclient.tap
Class TapService

java.lang.Object
  extended by edu.harvard.cfa.vo.tapclient.tap.TapService
All Implemented Interfaces:
Vosi

public class TapService
extends java.lang.Object
implements Vosi

An object for accessing the service level functions of a VO TAP service. The functions include the VOSI availability, capabilites, and tables metadata as well as the TAP job list.

   // Create a TapService object.
   TapService service = new TapService(baseURL);

   // Retrieve the VOSI tables for the service.
   TableSet tableset = service.getTableSet();

   // Execute a metadata query at the TAP service synchronous endpoint.
   SyncJob syncJob = new SyncJob(tapService);
   syncJob.setParameter("FORMAT", "votable");
   syncJob.setParameter("LANG", "ADQL");
   syncJob.setParameter("QUERY", "SELECT * FROM master_source");

   // Handle results
   InputStream = syncJob.run();
   ...
 


Constructor Summary
TapService(java.lang.String baseURL)
          Constructs a TapService object associated with the service located at the baseURL.
 
Method Summary
 Availability getAvailability()
          Returns an Availability object that represents the VOSI availability of the service.
 java.lang.String getBaseURL()
          Gets the base URL of this object.
 Capabilities getCapabilities()
          Returns a list of Capability objects that represents the VOSI capabilities of the service.
 java.util.List<AsyncJob> getJobs()
          Returns a List of AsyncJob objects.
 TableSet getTableSet()
          Returns a list of Schema objects that represents the VOSI table set metadata of the service.
 TableSet getTableSetFromMetadata()
          Returns a TableSet object constructed from a metadata query that represents the TAP tableset metadata of the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TapService

public TapService(java.lang.String baseURL)
Constructs a TapService object associated with the service located at the baseURL.

Parameters:
baseURL - TAP service base URL, cannot be null.
Throws:
java.lang.NullPointerException - if baseURL is null.
Method Detail

getTableSetFromMetadata

public TableSet getTableSetFromMetadata()
                                 throws HttpException,
                                        ResponseFormatException,
                                        java.io.IOException
Returns a TableSet object constructed from a metadata query that represents the TAP tableset metadata of the service. A set of metadata queries are mader to the service every time the getTablesetFromMetadata method is called.

Returns:
the tableset constructed from TAP_SCHEMA metadata queries.
Throws:
HttpException - if the service responses to the VOSI Tables request with an unexpected HTTP status.
ResponseFormatException - if an error occurs parsing the service response into an VOSI Tables document.
java.io.IOException - if an error occurs creating an input stream.

getBaseURL

public java.lang.String getBaseURL()
Gets the base URL of this object.

Returns:
base URL of this TapService object.

getAvailability

public Availability getAvailability()
                             throws HttpException,
                                    ResponseFormatException,
                                    java.io.IOException
Returns an Availability object that represents the VOSI availability of the service. A new VOSI availability request is made to the service every time the getAvailability method is called.

Specified by:
getAvailability in interface Vosi
Returns:
the VOSI availability from the service.
Throws:
HttpException - if the service responses to the VOSI Availability request with an unexpected HTTP status.
ResponseFormatException - if an error occurs parsing the service response into an VOSI Availability document.
java.io.IOException - if an error occurs creating an input stream.

getCapabilities

public Capabilities getCapabilities()
                             throws HttpException,
                                    ResponseFormatException,
                                    java.io.IOException
Returns a list of Capability objects that represents the VOSI capabilities of the service. A new VOSI capabilities request is made to the service every time the getCapabilities method is called.

Specified by:
getCapabilities in interface Vosi
Returns:
a list of Capabilty objects representing the VOSI capabilities of the service.
Throws:
HttpException - if the service responses to the VOSI Capabilities request with an unexpected HTTP status.
ResponseFormatException - if an error occurs parsing the service response into an VOSI Capabilities document.
java.io.IOException - if an error occurs creating an input stream.

getTableSet

public TableSet getTableSet()
                     throws HttpException,
                            ResponseFormatException,
                            java.io.IOException
Returns a list of Schema objects that represents the VOSI table set metadata of the service. A new VOSI tables request is made to the service every time the getTableset method is called.

Specified by:
getTableSet in interface Vosi
Returns:
the VOSI tables from the service.
Throws:
HttpException - if the service responses to the VOSI Tables request with an unexpected HTTP status.
ResponseFormatException - if an error occurs parsing the service response into an VOSI Tables document.
java.io.IOException - if an error occurs creating an input stream.

getJobs

public java.util.List<AsyncJob> getJobs()
                                 throws HttpException,
                                        ResponseFormatException,
                                        java.io.IOException
Returns a List of AsyncJob objects.

Returns:
list of asynchronous jobs associated with this TAP service
Throws:
HttpException - if the service responses to the metadata query with an unexpected HTTP status. It should be noted that some services may respond to a job list request with an HTTP 403 Forbidden code which will manifest in an HttpException.
ResponseFormatException - if an error occurs parsing the service response into a metadata query result document.
java.io.IOException - if an error occurs creating an input stream.