Package uk.ac.starlink.topcat.interop

## Class TopcatServer

- java.lang.Object
- - uk.ac.starlink.topcat.interop.TopcatServer

-     public class TopcatServer
      extends java.lang.Object

  Provides HTTP server functionality for TOPCAT. This includes a web server for dynamically generated content and an XML-RPC server for use with SAMP. This class is a singleton.
  Since:
    29 Aug 2008
  Author:
    Mark Taylor

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.net.URL` | `addResource​(java.lang.String name, org.astrogrid.samp.httpd.ServerResource resource)` | Makes a resource available for retrieving from this internal HTTP server.
    `static TopcatServer` | `getInstance()` | Returns the sole instance of this class.
    `org.astrogrid.samp.client.ClientProfile` | `getProfile()` | Returns a SAMP client profile.
    `java.net.URL` | `getTopcatPackageUrl()` | Returns the URL corresponding to the classpath for the package uk.ac.starlink.topcat.
    `boolean` | `isFound​(java.net.URL url)` | Indicates whether this server can serve the resource with a given URL.
    `void` | `removeResource​(java.net.URL url)` | Removes a resource from this server.

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

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

- - ### Method Detail

    - #### getProfile

          public org.astrogrid.samp.client.ClientProfile getProfile()

      Returns a SAMP client profile.
      Returns:
        profile

    - #### addResource

          public java.net.URL addResource​(java.lang.String name,
                                          org.astrogrid.samp.httpd.ServerResource resource)

      Makes a resource available for retrieving from this internal HTTP server. A `name` may be supplied which will appear at the end of the URL, but this is just for cosmetic purposes. The URL at which the resource is available will provided as the return value.
      Parameters:
        `name` - filename identifying the resource
        `resource` - resource to make available
      Returns:
        URL at which `resource` can be found

    - #### removeResource

          public void removeResource​(java.net.URL url)

      Removes a resource from this server.
      Parameters:
        `url` - URL returned by a previous addResource call

    - #### getTopcatPackageUrl

          public java.net.URL getTopcatPackageUrl()

      Returns the URL corresponding to the classpath for the package uk.ac.starlink.topcat.
      Returns:
        documentation URL

    - #### isFound

          public boolean isFound​(java.net.URL url)

      Indicates whether this server can serve the resource with a given URL.
      Parameters:
        `url` - URL to enquire about
      Returns:
        true if a request for `url` will complete with non-error status

    - #### getInstance

          public static TopcatServer getInstance()
                                          throws java.io.IOException

      Returns the sole instance of this class.
      Returns:
        instance
      Throws:
        `java.io.IOException`

Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.