edu.harvard.cfa.vo.tapclient.vosi
Class TableSet

java.lang.Object
  extended by edu.harvard.cfa.vo.tapclient.vosi.TableSet

public class TableSet
extends java.lang.Object

A set of tables that are part of a single resource.

 
  void showTableset(TableSet tableset) {

    edu.harvard.cfa.vo.tapclient.tap.TapService tapService = new edu.harvard.cfa.vo.tapclient.tap.TapService(baseURL);

    TableSet tableset = tapService.getTableSet();
    for (Schema schema: tableset.getSchemas()) {
        System.out.println(schema+"\t[Schema]");

        for (Table table: schema.getTables()) {
            System.out.println("\t"+table+"\t[Table]");

            for (Column column: table.getIndexedColumns()) {
                System.out.println("\t\t"+column+"\t[Indexed column]");
            }

            for (ForeignKey foreignKey: table.getForeignKeys()) {
                System.out.println("\t\t"+foreignKey+"\t[Foreign key]");
            } 
            System.out.println("");
        }
        System.out.println("");
    }
  }
 
 


Field Summary
protected  java.lang.String fullURL
           
protected  java.util.List<Schema> schemas
           
 
Constructor Summary
TableSet(java.lang.String fullURL)
          Constructs a TableSet object from the given service.
 
Method Summary
 void add(Schema newValue)
           
 java.util.List<Schema> getSchemas()
          Returns the schema list of the TAP service associate with this TableSet object.
 java.net.URL getTransformURL()
          Returns a URL pointing to the XSL transform to apply to the XML documents recieved from the service.
 void list(java.io.PrintStream output)
           
 void list(java.io.PrintStream output, java.lang.String indent)
           
 void setTransformURL(java.net.URL newValue)
          Set the XSL transform to apply to the XML documents recieved from the service.
 void update()
          Updates this TableSet object with the VOSI tables response from the TAP service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fullURL

protected java.lang.String fullURL

schemas

protected java.util.List<Schema> schemas
Constructor Detail

TableSet

public TableSet(java.lang.String fullURL)
Constructs a TableSet object from the given service.

Parameters:
fullURL - the full URL associated with this TableSet object
Method Detail

getSchemas

public java.util.List<Schema> getSchemas()
Returns the schema list of the TAP service associate with this TableSet object. The list returned is current as of the last call to update.

Returns:
a list of Schema objects.
See Also:
update(), Schema

add

public void add(Schema newValue)

update

public void update()
            throws HttpException,
                   ResponseFormatException,
                   java.io.IOException
Updates this TableSet object with the VOSI tables response from the TAP service. A request is made to the TAP service associated with this TableSet object.

Throws:
java.lang.Exception - if an error occurs connecting to the TAP service or parsing the response
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.

list

public void list(java.io.PrintStream output)

list

public void list(java.io.PrintStream output,
                 java.lang.String indent)

getTransformURL

public java.net.URL getTransformURL()
Returns a URL pointing to the XSL transform to apply to the XML documents recieved from the service.

Returns:
The URL of the transform to apply to XML documents recieved from the service. Null impliesthe identity transformation will be applied.

setTransformURL

public void setTransformURL(java.net.URL newValue)
Set the XSL transform to apply to the XML documents recieved from the service.

Parameters:
newValue - The URL of the transform to apply to XML documents recieved from the service. Null impliesthe identity transformation will be applied.