Class ALcdWMSLayer

java.lang.Object
com.luciad.wms.server.model.ALcdWMSLayer
Direct Known Subclasses:
TLcdWMSLayer

public abstract class ALcdWMSLayer extends Object
Represents a layer of a WMS.

This class is a direct representation of the layer concept introduced in the OGC WMS specification. A WMS layer is used to represent the data offered by a WMS. When a client performs a GetCapabilities request, the XML response will (amongst other content) contain a (hierarchical) list of layers that can be requested by the client. This list of layers is modeled via the ALcdWMSLayer domain object.

A WMS layer is identified by a unique key, represented by the name property. This property is used by the client to identify a layer in a request. It is however possible to hide the name towards the client (see isNameVisible()); in that case, the client cannot request the layer. A layer can contain data by itself (see getSourceName()), and/or it can group other layers (see getChildWMSLayer(int)). A layer should also have a title, intended as a human-readable name to describe the layer. To further describe the layer's content, a number of optional metadata properties are available, such as abstract, keywords etc. A layer can be parametrized via the WMS dimension concept, see getDimension(int). Common parameters are time and elevation, to allow clients to request the data respectively for a given time instant and altitude. A layer can also be given a number of styles which the client can request, see getWMSLayerStyle(int). To indicate whether a client can perform GetFeatureInfo requests on the layer, the queryable property is used.

Note that this WMS layer is not the same as a Luciad layer (e.g., in a GXY view). As mentioned above, the WMS layer is a metadata entity to define content offered by a WMS. When a client requests it, the WMS needs to decode a Luciad model (ILcdModel) and create a Luciad layer (ILcdLayer) to generate the resulting map.
See Also:
  • Constructor Details

    • ALcdWMSLayer

      public ALcdWMSLayer()
  • Method Details

    • getTitle

      public abstract String getTitle()
      Returns the title of this layer.
      Returns:
      the title of this layer.
    • getName

      public abstract String getName()
      Returns the name of this layer. This name has to be unique !
      Returns:
      the name of this layer.
    • isNameVisible

      public abstract boolean isNameVisible()
      Each layer has a key, but this might not be visible to the WMS user (if the implementor of the WMS service does not want the layer to be retrievable).
      Returns:
      true if the name is visible, else false .
    • getAbstract

      public abstract String getAbstract()
      Returns an abstract for this layer. Value may be null.
      Returns:
      an abstract for this layer.
    • getWGS84LonLatBounds

      public abstract ILcdBounds getWGS84LonLatBounds()
      Returns the bounding box of this layer in WGS84.
      Returns:
      a ILcdBounds containing the lon lat bounding box.
    • isQueryable

      public abstract boolean isQueryable()
      Returns if the layer has extra (meta) information available. If the queryable property has the value false client applications cannot make GetFeatureInfo requests on this WMS layer.
      Returns:
      true if the layer is queryable.
    • isOpaque

      public Boolean isOpaque()
      Returns whether the layer represents map data that is mostly or completely opaque. If false, the layer typically represents vector data that does not completely fills space.

      By default, null is returned.

      Returns:
      Boolean.TRUE if the layer represents map data that is mostly or completely opaque.
    • getParentWMSLayer

      public ALcdWMSLayer getParentWMSLayer()
      Returns the parent layer of this layer. If this layer has no parent, null is returned.
      Returns:
      The parent layer of this layer, or null otherwise.
    • getChildWMSLayerCount

      public abstract int getChildWMSLayerCount()
      Returns the number of sub-layers this layer is composed of.
      Returns:
      the number of sub-layers this layer is composed of.
    • getChildWMSLayer

      public abstract ALcdWMSLayer getChildWMSLayer(int aIndex) throws IndexOutOfBoundsException
      Returns the sub-layer at an index.
      Parameters:
      aIndex - the index of the sub-layer.
      Returns:
      the sub-layer at an index.
      Throws:
      IndexOutOfBoundsException - in case of an invalid index.
    • getSourceName

      public abstract String getSourceName()
      Returns the source name of the data for this layer. This is OPTIONAL: the value returned may be null.
      Returns:
      the source name of the data for this layer.
    • getWMSLayerStyleCount

      public abstract int getWMSLayerStyleCount()
      Returns the number of new styles this layer defines.
      Returns:
      the number of new styles this layer defines.
    • getWMSLayerStyle

      public abstract ALcdWMSLayerStyle getWMSLayerStyle(int aIndex) throws IndexOutOfBoundsException
      Returns one of the new styles defined by this layer (for the specific index).
      Parameters:
      aIndex - index of the new style to return.
      Returns:
      one of the new styles defined by this layer (for the specific index).
      Throws:
      IndexOutOfBoundsException - in case of an invalid index.
    • putProperty

      public abstract void putProperty(String aKey, Object aObject)
      Maps the specified key to the specified object.
      Parameters:
      aKey - the key to use for the property list.
      aObject - the value corresponding to the key.
    • getProperty

      public abstract Object getProperty(String aKey)
      Searches the property with the specified key. If not found null is returned.
      Parameters:
      aKey - the key to search for.
      Returns:
      the value of the property with the specified key, null if not found.
    • getProperty

      public abstract Object getProperty(String aKey, Object aDefaultValue)
      Searches the property with the specified key. If not found the default value is returned.
      Parameters:
      aKey - the key to search for.
      aDefaultValue - the default value to return if no property is found with the specified key.
      Returns:
      the value of the property with the specified key. The default specified value if not found.
    • getAuthorityURLCount

      public abstract int getAuthorityURLCount()
      Returns the number of ALcdWMSAuthorityURL objects specified within this ALcdWMSLayer.
      Returns:
      the number of ALcdWMSAuthorityURL objects specified within this ALcdWMSLayer.
    • getAuthorityURL

      public abstract ALcdWMSAuthorityURL getAuthorityURL(int aIndex) throws IndexOutOfBoundsException
      Returns the ALcdWMSAuthorityURL at a given index.
      Parameters:
      aIndex - the index of the ALcdWMSAuthorityURL.
      Returns:
      the ALcdWMSAuthorityURL at a given index.
      Throws:
      IndexOutOfBoundsException - if the index value is invalid.
    • getMetadataURLCount

      public int getMetadataURLCount()
      Returns the number of TLcdWMSURL objects representing MetadataURLs.

      By default, 0 is returned.

      Returns:
      the number of TLcdWMSURL objects representing MetadataURLs.
    • getMetadataURL

      public TLcdWMSURL getMetadataURL(int aIndex) throws IndexOutOfBoundsException
      Returns the TLcdWMSURL representing a MetadataURL at the given index.

      By default, no MetaDataURLs are available and an IndexOutOfBoundsException will be thrown.

      Parameters:
      aIndex - the index of the TLcdWMSURL representing a MetadataURL.
      Returns:
      the TLcdWMSURL representing a MetadataURL at the given index.
      Throws:
      IndexOutOfBoundsException - if the index value is invalid.
    • getDataURLCount

      public int getDataURLCount()
      Returns the number of TLcdWMSURL objects representing DataURLs.

      By default, 0 is returned.

      Returns:
      the number of TLcdWMSURL objects representing DataURLs.
    • getDataURL

      public TLcdWMSURL getDataURL(int aIndex) throws IndexOutOfBoundsException
      Returns the TLcdWMSURL representing a DataURL at the given index.

      By default, no DataURLs are available and an IndexOutOfBoundsException will be thrown.

      Parameters:
      aIndex - the index of the TLcdWMSURL representing a DataURL.
      Returns:
      the TLcdWMSURL representing a DataURL at the given index.
      Throws:
      IndexOutOfBoundsException - if the index value is invalid.
    • getFeatureListURLCount

      public int getFeatureListURLCount()
      Returns the number of TLcdWMSURL objects representing FeatureListURLs.

      By default, 0 is returned.

      Returns:
      the number of TLcdWMSURL objects representing FeatureListURLs.
    • getFeatureListURL

      public TLcdWMSURL getFeatureListURL(int aIndex) throws IndexOutOfBoundsException
      Returns the TLcdWMSURL representing a FeatureListURL at the given index.

      By default, no FeatureListURLs are available and an IndexOutOfBoundsException will be thrown.

      Parameters:
      aIndex - the index of the TLcdWMSURL representing a FeatureListURL.
      Returns:
      the TLcdWMSURL representing a FeatureListURL at the given index.
      Throws:
      IndexOutOfBoundsException - if the index value is invalid.
    • getIdentifierCount

      public abstract int getIdentifierCount()
      Returns the number of TLcdWMSIdentifier of this ALcdWMSLayer.
      Returns:
      the number of TLcdWMSIdentifier of this ALcdWMSLayer.
    • getIdentifier

      public abstract TLcdWMSIdentifier getIdentifier(int aIndex) throws IndexOutOfBoundsException
      Returns the TLcdWMSIdentifier at a given index.
      Parameters:
      aIndex - the index of the TLcdWMSIdentifier.
      Returns:
      the TLcdWMSIdentifier at a given index.
      Throws:
      IndexOutOfBoundsException - if the index value is invalid.
    • getCascadeCount

      public int getCascadeCount()
      Returns the number of times this layer has been retransmitted.

      By default, 0 is returned.

      Returns:
      the number of times this layer has been retransmitted.
    • getCoordinateReferenceSystemCount

      public abstract int getCoordinateReferenceSystemCount()
      Returns the number of extra coordinate reference systems in which this layer can be displayed.
      Returns:
      the number of extra coordinate reference systems in which this layer can be displayed.
    • getCoordinateReferenceSystem

      public abstract String getCoordinateReferenceSystem(int aIndex) throws IndexOutOfBoundsException
      Returns the extra coordinate reference system in which this layer can be displayed.
      Parameters:
      aIndex - the index of the extra coordinate reference system.
      Returns:
      the extra coordinate reference system in which this layer can be displayed.
      Throws:
      IndexOutOfBoundsException - if the index value is invalid.
    • getMinScaleDenominator

      public abstract double getMinScaleDenominator()
      Returns the min scale denominator range value. If there is no such minimum scale condition, the default value has to be 0.
      Returns:
      the min scale denominator range value.
    • getMaxScaleDenominator

      public abstract double getMaxScaleDenominator()
      Returns the max scale denominator range value. If there is no such maximum scale condition, the default value has to be Double.POSITIVE_INFINITY.
      Returns:
      the max scale denominator range value.
    • getKeywordCount

      public abstract int getKeywordCount()
      Returns the number of keywords.
      Returns:
      the number of keywords.
    • getKeyword

      public abstract String getKeyword(int aIndex) throws IndexOutOfBoundsException
      Returns the keyword at the given index.
      Parameters:
      aIndex - the index of the keyword to return.
      Returns:
      the keyword at the given index.
      Throws:
      IndexOutOfBoundsException - if invalid index.
    • getDimension

      public ALcdWMSDimension getDimension(int aIndex) throws IndexOutOfBoundsException
      Returns the dimensional parameter definition at the given index.

      By default, no dimensional parameters are available and an IndexOutOfBoundsException will be thrown.

      Parameters:
      aIndex - The index of the dimensional parameter to be retrieved.
      Returns:
      the dimensional parameter definition at the given index.
      Throws:
      IndexOutOfBoundsException - if invalid index.
    • getDimensionCount

      public int getDimensionCount()
      Returns the number of dimensional parameters associated with this layer (and child layers).

      By default, 0 is returned.

      Returns:
      the number of dimensional parameters associated with this layer (and child layers).
    • setParentLayer

      protected void setParentLayer(ALcdWMSLayer aParentLayer)
      Sets the given layer as parent layer of this layer. To remove the currently registered parent layer, null can be supplied.
      Parameters:
      aParentLayer - The parent layer of this layer, or null.
    • isNoSubsets

      public boolean isNoSubsets()
      Returns the value of the 'noSubsets' parameter of this layer. If 'noSubsets' is set, the server is not able to make a map of a geographic area other than this layer's bounding box.
      Returns:
      The value of the 'noSubsets' parameter. Defaults to false.
    • getFixedWidth

      public int getFixedWidth()
      Returns the fixed width of this layer. If this value is different from 0, the server can only produce maps with the given width for this layer.
      Returns:
      The fixed width of this layer if it is set, 0 otherwise.
    • getFixedHeight

      public int getFixedHeight()
      Returns the fixed height of this layer. If this value is different from 0, the server can only produce maps with the given height for this layer.
      Returns:
      The fixed height of this layer if it is set, 0 otherwise.
    • setExpiryDate

      public void setExpiryDate(long aDate)
      Sets an expiry date for this layer. The date is expressed by the number of milliseconds since January 1, 1970, 00:00:00 GMT. When set, the date is used to fill in the Expires HTTP header on GetMap and GetFeatureInfo responses.
      Parameters:
      aDate - an expiry date for this layer
      See Also:
    • getExpiryDate

      public Long getExpiryDate()
      Returns the expiry date of this layer. By default, null is returned.
      Returns:
      the expiry date associated of this layer
      See Also:
    • setModificationDate

      public void setModificationDate(Long aDate)
      Sets a modification date for this layer. The date is expressed by the number of milliseconds since January 1, 1970, 00:00:00 GMT. When set, the date is used to fill in the Last-Modified HTTP header on GetMap and GetFeatureInfo responses.
      Parameters:
      aDate - a modification date for this layer
      See Also:
    • getModificationDate

      public Long getModificationDate()
      Returns the modification date of this layer. By default, null is returned.
      Returns:
      the modification date associated with this layer.
      See Also:
    • getUpdateSequence

      public String getUpdateSequence()

      Returns the update sequence value associated with this capabilities object. This update sequence identifies the state of the layer, including all dependencies such as styles, layer factory implementation etc...

      The update sequence should comply with a number of conditions:

      • The sequence number should be different from all previous update sequences for this WMS layer (if the WMS layer has changed).
      • If the WMS layer is different (i.e. different data/style/...), the sequence number should be different as well. Failing to do so will cause malfunctions in combination with caching.
      • If the WMS layer doesn't change, the sequence number should also remain the same. Failing to do so lowers the effect of caching, and will result in worse performance.
      • The sequence number should be unique across sessions. Failing to do so may cause malfunctions in combination with caching. An easy mistake to make would for example be to use a counter that is reset when the server is restarted.

      By default, this method always returns "0". This means that the default implementation assumes that WMS layers never change. If WMS layers change, the update sequence should be modified using the setUpdateSequence(java.lang.String) method.

      One way to generate update sequences would be to use a (persistent) counter that gets incremented on every change. Another way would be to use System.currentTimeMillis() from a correct clock. It is also an option to return a String that is concatenated with update sequences from a number of underlying concepts, such as styles, layer factory versions, data, ...

      Note that it is not needed to take into account the update sequence of the data (see ILcdModelProvider.getModelUpdateSequence(java.lang.String, com.luciad.ogc.common.ALcdRequestContext)) when calling the setUpdateSequence(java.lang.String) method. Instead, any code that makes use of the layer update sequence returned by this method should also take into account the update sequence of the model. An example are GetMap request caches. A cache entry should be invalidated if the layer update sequence changes, or if the model update sequence changes.

      Returns:
      the update sequence value associated with this capabilities object, never null.
      Since:
      2017.0
    • setUpdateSequence

      public void setUpdateSequence(String aUpdateSequence)

      Sets the update sequence value associated with this capabilities object. See getUpdateSequence() for more information.

      Parameters:
      aUpdateSequence - the new update sequence.
      Since:
      2017.0
    • findWMSLayer

      public ALcdWMSLayer findWMSLayer(String aLayerName)
      Search for a layer in the hierarchy with the requested layer name.
      Parameters:
      aLayerName - the name of the layer searched for.
      Returns:
      The layer if found, null otherwise.
      Since:
      2017.1