Package uk.ac.starlink.vo
Class TapCapabilitiesDoc
java.lang.Object
uk.ac.starlink.vo.TapCapabilitiesDoc
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 Summary
ConstructorsConstructorDescriptionTapCapabilitiesDoc(TapCapability tapCapability, StdCapabilityInterface[] intfs) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic URLgetCapabilitiesUrl(URL baseUrl) Provides the URL to use for the capabilities endpoint, given the TAP service base URL.Returns a list of capability,interface pairs found associated with this capabilities document.static StdCapabilityInterface[]getInterfaces(Element capsEl) Extracts a list of zero or more standard interfaces from the capabilities element.Returns the object that describes the TAP services capabilities as defined by TAPRegExt.static TapCapabilitygetTapCapability(Element capsEl) Extracts a TapCapability from the top-level capabilities element, in accordance with the TAPRegExt standard.static TapCapabilitiesDocreadCapabilities(URL capsUrl) Reads a TAP capabilities document from a given URL and returns a TapCapabilitiesDoc object based on it.
-
Constructor Details
-
TapCapabilitiesDoc
Constructor.- Parameters:
tapCapability- describes TAPRegExt informationintfs- enumerates all known capability+interface pairs
-
-
Method Details
-
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
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
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
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:
IOExceptionSAXException
-
getTapCapability
Extracts a TapCapability from the top-level capabilities element, in accordance with the TAPRegExt standard.- Parameters:
capsEl- capabilities element- Throws:
XPathExpressionException
-
getInterfaces
Extracts a list of zero or more standard interfaces from the capabilities element.- Parameters:
capsEl- capabilities element- Returns:
- capability/interface objects
-