Class ServiceMetadataUtils

java.lang.Object
de.latlon.ets.wms13.core.util.ServiceMetadataUtils

public final class ServiceMetadataUtils extends Object
Provides various utility methods for accessing service metadata.
Author:
Lyn Goltz
  • Method Details

    • getOperationEndpoint

      public static URI getOperationEndpoint(Document wmsMetadata, String opName, ProtocolBinding binding)
      Extracts a request endpoint from a WMS capabilities document. If the request URI contains a query component it is removed (but not from the source document).
      Parameters:
      wmsMetadata - the document node containing service metadata (OGC capabilities document).
      opName - the operation (request) name
      binding - the message binding to use (if null any supported binding will be used)
      Returns:
      the URI referring to a request endpoint, null if no matching endpoint is found
    • getOperationBindings

      public static Set<ProtocolBinding> getOperationBindings(Document wmsMetadata, String opName)
      Determines which protocol bindings are supported for a given operation.
      Parameters:
      wmsMetadata - the capabilities document (wms:WMS_Capabilities), never null
      opName - the name of the WMS operation
      Returns:
      A Set of protocol bindings supported for the operation. May be empty but never null.
    • parseSupportedFormats

      public static List<String> parseSupportedFormats(Document wmsCapabilities, String opName)
      Parses the configured formats for the given operation.
      Parameters:
      wmsCapabilities - the capabilities document (wms:WMS_Capabilities), never null
      opName - the name of the WMS operation
      Returns:
      a list of the supported formats by the operation, never null
    • parseLayerInfo

      public static List<LayerInfo> parseLayerInfo(Document wmsCapabilities)
      Parses all named layers from the capabilities document.
      Parameters:
      wmsCapabilities - the capabilities document (wms:WMS_Capabilities), never null
      Returns:
      a list of LayerInfos supported by the WMS, never null
    • parseUpdateSequence

      public static String parseUpdateSequence(Document wmsCapabilities)
      Parses the updateSequence value from the capabilities document.
      Parameters:
      wmsCapabilities - the capabilities document (wms:WMS_Capabilities), never null
      Returns:
      the value of the ServiceMetadataUtils attribute, null if the attribute is missing or the value empty
    • parseGeographicBoundingBox

      public static BoundingBox parseGeographicBoundingBox(Node layerNode)
      Parses the EX_GeographicBoundingBox from the layer.
      Parameters:
      layerNode - node of the layer, never null
      Returns:
      the BoundingBox - crs is CRS:84, null if missing
    • parseAllLayerNodes

      public static NodeList parseAllLayerNodes(Document wmsCapabilities) throws XPathExpressionException
      Parses all Layer elements of a capabilities document.
      Parameters:
      wmsCapabilities - capabilities document, never null
      Returns:
      node list containing all layer elements of the capabilities document
      Throws:
      XPathExpressionException - if the expression cannot be evaluated
    • parseRequestableLayerNodes

      public static NodeList parseRequestableLayerNodes(Document wmsCapabilities) throws XPathExpressionException
      Parses all requestable Layer elements of a capabilities document. Requestable layers are identified by the existence of a Name sub element.
      Parameters:
      wmsCapabilities - capabilities document, never null
      Returns:
      node list containing all requestable layer elements of the capabilities document
      Throws:
      XPathExpressionException - if the expression cannot be evaluated
    • parseRequestableDimension

      static RequestableDimension parseRequestableDimension(String units, String value) throws ParseException
      Throws:
      ParseException
    • getSoapOperationEndpoint

      public static URI getSoapOperationEndpoint(Document wmsCapabilities, String operation)