Class ThreddsWmsCatalogue

java.lang.Object
thredds.server.wms.ThreddsWmsCatalogue
All Implemented Interfaces:
uk.ac.rdg.resc.edal.graphics.utils.DatasetCatalogue, uk.ac.rdg.resc.edal.graphics.utils.FeatureCatalogue, uk.ac.rdg.resc.edal.wms.WmsCatalogue

public class ThreddsWmsCatalogue extends Object implements uk.ac.rdg.resc.edal.wms.WmsCatalogue
Example of an implementation of a WmsCatalogue to work with the TDS. This is a working example, but many of the specifics will need to be implemented differently based on how the THREDDS team decide to configure WMS layers. This WmsCatalogue provides access to a SINGLE dataset. As such, each different dataset requested will have a new instance of this class. NB - No caching is implemented in this WmsCatalogue. I would recommend a cache which is shared amongst all WmsCatalogues, passed in on object construction, and which performs the caching/retrieval in the FeatureCatalogue.getFeaturesForLayer(String, PlottingDomainParams) method. The cache keys will be a pair of the layerName and the PlottingDomainParams, and the cached values will be Collections of DiscreteFeatures.
  • Constructor Details

    • ThreddsWmsCatalogue

      public ThreddsWmsCatalogue(ucar.nc2.dataset.NetcdfDataset ncd, String tdsDatasetPath) throws IOException, uk.ac.rdg.resc.edal.exceptions.EdalException
      Throws:
      IOException
      uk.ac.rdg.resc.edal.exceptions.EdalException
  • Method Details

    • getTdsDatasetPath

      public String getTdsDatasetPath()
    • getFeaturesForLayer

      public uk.ac.rdg.resc.edal.graphics.utils.FeatureCatalogue.FeaturesAndMemberName getFeaturesForLayer(String layerName, uk.ac.rdg.resc.edal.graphics.utils.PlottingDomainParams params) throws uk.ac.rdg.resc.edal.exceptions.EdalException
      Specified by:
      getFeaturesForLayer in interface uk.ac.rdg.resc.edal.graphics.utils.FeatureCatalogue
      Throws:
      uk.ac.rdg.resc.edal.exceptions.EdalException
    • getAllDatasets

      public Collection<uk.ac.rdg.resc.edal.dataset.Dataset> getAllDatasets()
      Specified by:
      getAllDatasets in interface uk.ac.rdg.resc.edal.graphics.utils.DatasetCatalogue
    • allowsGlobalCapabilities

      public boolean allowsGlobalCapabilities()
    • getDatasetFromId

      public uk.ac.rdg.resc.edal.dataset.Dataset getDatasetFromId(String layerName)
      Specified by:
      getDatasetFromId in interface uk.ac.rdg.resc.edal.graphics.utils.DatasetCatalogue
    • getDatasetTitle

      public String getDatasetTitle(String layerName)
      Get the title of the dataset. If the title is null (i.e. not found), return the string value "Untitled Dataset" The title is found by the getTitle() method in NetcdfDataset, or by a global attribute "title" (not case-sensitive)
      Specified by:
      getDatasetTitle in interface uk.ac.rdg.resc.edal.wms.WmsCatalogue
      Parameters:
      layerName - name of the layer
      Returns:
      title of the dataset
    • isDisabled

      public boolean isDisabled(String layerName)
      Specified by:
      isDisabled in interface uk.ac.rdg.resc.edal.wms.WmsCatalogue
    • isDownloadable

      public boolean isDownloadable(String layerName)
      Specified by:
      isDownloadable in interface uk.ac.rdg.resc.edal.wms.WmsCatalogue
    • isQueryable

      public boolean isQueryable(String layerName)
      Specified by:
      isQueryable in interface uk.ac.rdg.resc.edal.wms.WmsCatalogue
    • getLastUpdateTime

      public org.joda.time.DateTime getLastUpdateTime()
      Specified by:
      getLastUpdateTime in interface uk.ac.rdg.resc.edal.graphics.utils.DatasetCatalogue
    • getContactInfo

      public uk.ac.rdg.resc.edal.wms.util.ContactInfo getContactInfo()
      Specified by:
      getContactInfo in interface uk.ac.rdg.resc.edal.wms.WmsCatalogue
    • setTdsServerInfo

      public static void setTdsServerInfo(TdsServerInfoBean info)
    • setWmsConfig

      public static void setWmsConfig(WmsConfigBean config)
    • getServerInfo

      public uk.ac.rdg.resc.edal.wms.util.ServerInfo getServerInfo()
      Specified by:
      getServerInfo in interface uk.ac.rdg.resc.edal.wms.WmsCatalogue
    • getLayerNameMapper

      public uk.ac.rdg.resc.edal.graphics.utils.LayerNameMapper getLayerNameMapper()
      Specified by:
      getLayerNameMapper in interface uk.ac.rdg.resc.edal.wms.WmsCatalogue
    • getStyleCatalogue

      public uk.ac.rdg.resc.edal.graphics.utils.StyleCatalogue getStyleCatalogue()
      Specified by:
      getStyleCatalogue in interface uk.ac.rdg.resc.edal.wms.WmsCatalogue
    • getLayerMetadata

      public uk.ac.rdg.resc.edal.graphics.utils.EnhancedVariableMetadata getLayerMetadata(uk.ac.rdg.resc.edal.metadata.VariableMetadata metadata) throws uk.ac.rdg.resc.edal.graphics.exceptions.EdalLayerNotFoundException
      Specified by:
      getLayerMetadata in interface uk.ac.rdg.resc.edal.graphics.utils.DatasetCatalogue
      Throws:
      uk.ac.rdg.resc.edal.graphics.exceptions.EdalLayerNotFoundException