Class ServiceMetadataUtils
java.lang.Object
org.opengeospatial.cite.wmts10.ets.core.util.ServiceMetadataUtils
Provides various utility methods for accessing service metadata.
- Author:
- Lyn Goltz (original), Jim Beatty (modified/fixed May/Jun/Jul-2017 for WMS and/or WMTS)
-
Method Summary
Modifier and TypeMethodDescriptionstatic Nodestatic Nodestatic NodeListgetNodeElements(XPath xPath, Node wmtsCapabilities, String xPathAbstract) static NodeListgetNodeElements(Node wmtsCapabilities, String xPathAbstract) static StringgetNodeText(XPath xPath, Node wmtsCapabilities, String xPathAbstract) static StringgetNodeText(Node wmtsCapabilities, String xPathAbstract) static Set<ProtocolBinding>getOperationBindings(Document wmtsMetadata, String opName) Determines which protocol bindings are supported for a given operation.static URIgetOperationEndpoint_KVP(Document wmtsMetadata, String opName, ProtocolBinding binding) Extracts a request KVP endpoint from a WMTS capabilities document.static URIgetOperationEndpoint_REST(Document wmtsMetadata, String opName, ProtocolBinding binding) Extracts a request REST endpoint from a WMTS capabilities document.static URIgetOperationEndpoint_SOAP(Document wmtsMetadata, String opName, ProtocolBinding binding) Extracts a request SOAP endpoint from a WMTS capabilities document.static BoundingBoxparseBoundingBox(Node bboxNode, boolean presumedWGS84) Parses the BoundingBox from the layer; either as the WGS84 Bbox, or one of the other listed onesstatic NodeListparseLayerChildElements(Document wmtsCapabilities, String layerName, String childElement) Parses the configured formats for the given operation.parseLayerInfo(Document wmtsCapabilities) Parses all named layers from the capabilities document.static NodeListparseLayers(XPath xPath, Document wmtsCapabilities) static NodeListparseLayers(Document wmtsCapabilities) static StringparseNodeElementName(XPath xPath, Node nodeElement) static StringparseNodeElementName(Node nodeElement)
-
Method Details
-
getOperationEndpoint_KVP
public static URI getOperationEndpoint_KVP(Document wmtsMetadata, String opName, ProtocolBinding binding) Extracts a request KVP endpoint from a WMTS capabilities document. If the request URI contains a query component it is removed (but not from the source document).- Parameters:
wmtsMetadata- the document node containing service metadata (OGC capabilities document).opName- the operation (request) namebinding- the message binding to use (ifnullany supported binding will be used)- Returns:
- the URI referring to a request endpoint,
nullif no matching endpoint is found
-
getOperationEndpoint_REST
public static URI getOperationEndpoint_REST(Document wmtsMetadata, String opName, ProtocolBinding binding) Extracts a request REST endpoint from a WMTS capabilities document. If the request URI contains a query component it is removed (but not from the source document).- Parameters:
wmtsMetadata- the document node containing service metadata (OGC capabilities document).opName- the operation (request) namebinding- the message binding to use (ifnullany supported binding will be used)- Returns:
- the URI referring to a request endpoint,
nullif no matching endpoint is found
-
getOperationEndpoint_SOAP
public static URI getOperationEndpoint_SOAP(Document wmtsMetadata, String opName, ProtocolBinding binding) Extracts a request SOAP endpoint from a WMTS capabilities document. If the request URI contains a query component it is removed (but not from the source document).- Parameters:
wmtsMetadata- the document node containing service metadata (OGC capabilities document).opName- the operation (request) namebinding- the message binding to use (ifnullany supported binding will be used)- Returns:
- the URI referring to a request endpoint,
nullif no matching endpoint is found
-
getOperationBindings
Determines which protocol bindings are supported for a given operation.- Parameters:
wmtsMetadata- the capabilities document (wmts:Capabilities), nevernullopName- the name of the WMTS operation- Returns:
- A Set of protocol bindings supported for the operation. May be empty but
never
null.
-
getNodeElements
public static NodeList getNodeElements(XPath xPath, Node wmtsCapabilities, String xPathAbstract) throws XPathExpressionException - Throws:
XPathExpressionException
-
getNodeElements
public static NodeList getNodeElements(Node wmtsCapabilities, String xPathAbstract) throws XPathExpressionException - Throws:
XPathExpressionException
-
getNode
public static Node getNode(XPath xPath, Node wmtsCapabilities, String xPathAbstract) throws XPathExpressionException - Throws:
XPathExpressionException
-
getNode
public static Node getNode(Node wmtsCapabilities, String xPathAbstract) throws XPathExpressionException - Throws:
XPathExpressionException
-
getNodeText
public static String getNodeText(XPath xPath, Node wmtsCapabilities, String xPathAbstract) throws XPathExpressionException - Throws:
XPathExpressionException
-
getNodeText
public static String getNodeText(Node wmtsCapabilities, String xPathAbstract) throws XPathExpressionException - Throws:
XPathExpressionException
-
parseLayerChildElements
public static NodeList parseLayerChildElements(Document wmtsCapabilities, String layerName, String childElement) Parses the configured formats for the given operation.- Parameters:
wmtsCapabilities- the capabilities document (wmts:Capabilities), nevernulllayerName- the name of the selected layerchildElement- the child element(s) of the layer- Returns:
- a list of the child elements by the operation, never
null
-
parseLayerInfo
Parses all named layers from the capabilities document.- Parameters:
wmtsCapabilities- the capabilities document (wmts:Capabilities), nevernull- Returns:
- a list of
LayerInfos supported by the WMTS, nevernull
-
parseLayers
-
parseLayers
-
parseNodeElementName
public static String parseNodeElementName(XPath xPath, Node nodeElement) throws XPathExpressionException - Throws:
XPathExpressionException
-
parseNodeElementName
- Throws:
XPathExpressionException
-
parseBoundingBox
Parses the BoundingBox from the layer; either as the WGS84 Bbox, or one of the other listed ones- Parameters:
bboxNode- node of the layer, nevernullwgs84 if parsing the WGS84 bounding boxpresumedWGS84- are we working in WGS84 bounding box or not- Returns:
- the
BoundingBox- crs is CRS:84 if wgs84 is true, otherwise parse from attribute
-