Class TapCapabilitiesDoc


  • public class TapCapabilitiesDoc
    extends java.lang.Object
    Encapsulates useful information found in the capabilities document describing a TAP service. The static method readCapabilities(java.net.URL) can construct an instance of this class by parsing a suitable XML document.
    Since:
    26 Sep 2018
    Author:
    Mark Taylor
    • Constructor Detail

      • TapCapabilitiesDoc

        public TapCapabilitiesDoc​(TapCapability tapCapability,
                                  StdCapabilityInterface[] intfs)
        Constructor.
        Parameters:
        tapCapability - describes TAPRegExt information
        intfs - enumerates all known capability+interface pairs
    • Method Detail

      • getTapCapability

        public TapCapability getTapCapability()
        Returns the object that describes the TAP services capabilities as defined by TAPRegExt.
        Returns:
        TAP-specific capability description, or null if none found
      • getInterfaces

        public StdCapabilityInterface[] getInterfaces()
        Returns a list of capability,interface pairs found associated with this capabilities document. Note this may include an entry associated with the TAPRegExt capability.
        Returns:
        array of zero or more capability/interface specifications
      • getCapabilitiesUrl

        public static java.net.URL getCapabilitiesUrl​(java.net.URL baseUrl)
        Provides the URL to use for the capabilities endpoint, given the TAP service base URL. This method basically just adds "/capabilities" on the end of the URL string, but it takes care of inserting a slash when required etc.
        Parameters:
        baseUrl - service URL
        Returns:
        capabilities endpoint URL
      • readCapabilities

        public static TapCapabilitiesDoc readCapabilities​(java.net.URL capsUrl)
                                                   throws java.io.IOException,
                                                          org.xml.sax.SAXException
        Reads a TAP capabilities document from a given URL and returns a TapCapabilitiesDoc object based on it. If it looks like there's no suitable document there, an exception is thrown.
        Parameters:
        capsUrl - location of capabilities document
        Returns:
        capabilities object, not null
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • getTapCapability

        public static TapCapability getTapCapability​(org.w3c.dom.Element capsEl)
                                              throws javax.xml.xpath.XPathExpressionException
        Extracts a TapCapability from the top-level capabilities element, in accordance with the TAPRegExt standard.
        Parameters:
        capsEl - capabilities element
        Throws:
        javax.xml.xpath.XPathExpressionException
      • getInterfaces

        public static StdCapabilityInterface[] getInterfaces​(org.w3c.dom.Element capsEl)
        Extracts a list of zero or more standard interfaces from the capabilities element.
        Parameters:
        capsEl - capabilities element
        Returns:
        capability/interface objects