Package thredds.server.wms
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 aWmsCatalogueto 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. ThisWmsCatalogueprovides 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 thisWmsCatalogue. I would recommend a cache which is shared amongst allWmsCatalogues, passed in on object construction, and which performs the caching/retrieval in theFeatureCatalogue.getFeaturesForLayer(String, PlottingDomainParams)method. The cache keys will be a pair of the layerName and thePlottingDomainParams, and the cached values will beCollections ofDiscreteFeatures.
-
-
Constructor Summary
Constructors Constructor Description ThreddsWmsCatalogue(ucar.nc2.dataset.NetcdfDataset ncd, String tdsDatasetPath)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsGlobalCapabilities()Collection<uk.ac.rdg.resc.edal.dataset.Dataset>getAllDatasets()uk.ac.rdg.resc.edal.wms.util.ContactInfogetContactInfo()uk.ac.rdg.resc.edal.dataset.DatasetgetDatasetFromId(String layerName)StringgetDatasetTitle(String layerName)Get the title of the dataset.uk.ac.rdg.resc.edal.graphics.utils.FeatureCatalogue.FeaturesAndMemberNamegetFeaturesForLayer(String layerName, uk.ac.rdg.resc.edal.graphics.utils.PlottingDomainParams params)org.joda.time.DateTimegetLastUpdateTime()uk.ac.rdg.resc.edal.graphics.utils.EnhancedVariableMetadatagetLayerMetadata(uk.ac.rdg.resc.edal.metadata.VariableMetadata metadata)uk.ac.rdg.resc.edal.graphics.utils.LayerNameMappergetLayerNameMapper()uk.ac.rdg.resc.edal.wms.util.ServerInfogetServerInfo()uk.ac.rdg.resc.edal.graphics.utils.StyleCataloguegetStyleCatalogue()StringgetTdsDatasetPath()booleanisDisabled(String layerName)booleanisDownloadable(String layerName)booleanisQueryable(String layerName)static voidsetTdsServerInfo(TdsServerInfoBean info)static voidsetWmsConfig(WmsConfigBean config)
-
-
-
Constructor Detail
-
ThreddsWmsCatalogue
public ThreddsWmsCatalogue(ucar.nc2.dataset.NetcdfDataset ncd, String tdsDatasetPath) throws IOException, uk.ac.rdg.resc.edal.exceptions.EdalException- Throws:
IOExceptionuk.ac.rdg.resc.edal.exceptions.EdalException
-
-
Method Detail
-
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:
getFeaturesForLayerin interfaceuk.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:
getAllDatasetsin interfaceuk.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:
getDatasetFromIdin interfaceuk.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:
getDatasetTitlein interfaceuk.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:
isDisabledin interfaceuk.ac.rdg.resc.edal.wms.WmsCatalogue
-
isDownloadable
public boolean isDownloadable(String layerName)
- Specified by:
isDownloadablein interfaceuk.ac.rdg.resc.edal.wms.WmsCatalogue
-
isQueryable
public boolean isQueryable(String layerName)
- Specified by:
isQueryablein interfaceuk.ac.rdg.resc.edal.wms.WmsCatalogue
-
getLastUpdateTime
public org.joda.time.DateTime getLastUpdateTime()
- Specified by:
getLastUpdateTimein interfaceuk.ac.rdg.resc.edal.graphics.utils.DatasetCatalogue
-
getContactInfo
public uk.ac.rdg.resc.edal.wms.util.ContactInfo getContactInfo()
- Specified by:
getContactInfoin interfaceuk.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:
getServerInfoin interfaceuk.ac.rdg.resc.edal.wms.WmsCatalogue
-
getLayerNameMapper
public uk.ac.rdg.resc.edal.graphics.utils.LayerNameMapper getLayerNameMapper()
- Specified by:
getLayerNameMapperin interfaceuk.ac.rdg.resc.edal.wms.WmsCatalogue
-
getStyleCatalogue
public uk.ac.rdg.resc.edal.graphics.utils.StyleCatalogue getStyleCatalogue()
- Specified by:
getStyleCataloguein interfaceuk.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:
getLayerMetadatain interfaceuk.ac.rdg.resc.edal.graphics.utils.DatasetCatalogue- Throws:
uk.ac.rdg.resc.edal.graphics.exceptions.EdalLayerNotFoundException
-
-