Package uk.ac.starlink.vo

## Class TapServices

- java.lang.Object
- - uk.ac.starlink.vo.TapServices

-     public class TapServices
      extends java.lang.Object

  Utility class for working with TapService instances.
  Since:
    18 Mar 2016
  Author:
    Mark Taylor

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static TapService` | `createDefaultTapService​(java.lang.String baseUrl)` | Creates a TAP 1.0 service given a base URL string.
    `static TapService` | `createDefaultTapService​(java.net.URL baseUrl)` | Creates a TAP 1.0 service given the base URL, with the endpoints in the default places.
    `static TapService` | `createTapService​(java.net.URL baseUrl, TapVersion tapVersion)` | Creates a TAP service given the base URL, with the endpoints in the default places and a specified TAP version.
    `static TapService[]` | `createTapServices​(java.net.URL baseUrl, TapCapabilitiesDoc capsDoc)` | Returns an array of TapService instances that are described by a supplied TAP capabilities document.
    `static TapService` | `getRegTapService()` | Returns a default service corresponding to a Relational Registry (RegTAP) service.

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

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

- - ### Method Detail

    - #### getRegTapService

          public static TapService getRegTapService()

      Returns a default service corresponding to a Relational Registry (RegTAP) service.

      The current implementation returns a hardcoded value, the main GAVO registry service. Perhaps it should be pluggable, but the GAVO RegTAP service is expected to be pretty reliable.

      Returns:
        default RegTAP service

    - #### createDefaultTapService

          public static TapService createDefaultTapService​(java.lang.String baseUrl)

      Creates a TAP 1.0 service given a base URL string. If the URL is bad, a warning is logged, and null is returned.
      Parameters:
        `baseUrl` - base TAP URL
      Returns:
        service with standard (v1.0) TAP endpoints

    - #### createDefaultTapService

          public static TapService createDefaultTapService​(java.net.URL baseUrl)

      Creates a TAP 1.0 service given the base URL, with the endpoints in the default places.
      Parameters:
        `baseUrl` - base TAP URL
      Returns:
        service using standard (v1.0) TAP endpoints
      Throws:
        `java.lang.IllegalArgumentException` - in case of a bad URL

    - #### createTapService

          public static TapService createTapService​(java.net.URL baseUrl,
                                                    TapVersion tapVersion)

      Creates a TAP service given the base URL, with the endpoints in the default places and a specified TAP version.

      This setup is more or less mandatory for TAP 1.0 services, but TAP 1.1 services may have more freedom to provide different sets of endpoints (capability/interface elements) for different purposes, for instance with different securityMethods.

      Parameters:
        `baseUrl` - base TAP URL
        `tapVersion` - TAP protocol version
      Returns:
        TAP service with standard endpoints

    - #### createTapServices

          public static TapService[] createTapServices​(java.net.URL baseUrl,
                                                       TapCapabilitiesDoc capsDoc)

      Returns an array of TapService instances that are described by a supplied TAP capabilities document. The returned list will have at least one entry, but may have more if multiple TAP interfaces or security method variants have been declared.
      Parameters:
        `baseUrl` - base URL for TAP service (source of capabilities doc)
        `capsDoc` - parsed capabilities document
      Returns:
        array containing one or more TAP services