Package thredds.featurecollection
Class InvDatasetFeatureCollection
- java.lang.Object
-
- thredds.featurecollection.InvDatasetFeatureCollection
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
InvDatasetFcFmrc,InvDatasetFcGrib,InvDatasetFcPoint
@ThreadSafe public abstract class InvDatasetFeatureCollection extends Object implements Closeable
Abstract superclass for Feature Collection Datasets. This is a InvCatalogRef subclass. So the reference is placed in the parent, but the catalog itself isnt constructed until the following call from DataRootHandler.makeDynamicCatalog(): match.dataRoot.featCollection.makeCatalog(match.remaining, path, baseURI);The DatasetFeatureCollection object is held in the DataRootManager's FeatureCollectionCache; it may get closed and recreated.
- Since:
- Mar 3, 2010
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classInvDatasetFeatureCollection.State
-
Field Summary
Fields Modifier and Type Field Description protected static AllowedServicesallowedServicesprotected thredds.featurecollection.FeatureCollectionConfigconfigprotected StringconfigPathprotected static StringcontextNameprotected thredds.inventory.MFileCollectionManagerdatasetCollectionprotected thredds.client.catalog.ServicedownloadServiceprotected thredds.featurecollection.FeatureCollectionTypefcTypeprotected static StringFILESprotected booleanfirstprotected static StringLATEST_DATASET_CATALOGprotected thredds.client.catalog.ServicelatestServiceprotected Objectlockprotected Stringnameprotected thredds.client.catalog.ServiceorgServiceprotected thredds.server.catalog.FeatureCollectionRefparentprotected InvDatasetFeatureCollection.Statestateprotected StringtopDirectoryprotected static booleanuseNetcdfJavaBuildersprotected static StringVARIABLESprotected thredds.client.catalog.ServicevirtualService
-
Constructor Summary
Constructors Modifier Constructor Description protectedInvDatasetFeatureCollection(thredds.server.catalog.FeatureCollectionRef parent, thredds.featurecollection.FeatureCollectionConfig config)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void_showStatus(Formatter f, boolean summaryOnly, String type)protected static StringbuildCatalogServiceHref(String path)protected InvDatasetFeatureCollection.StatecheckState()A request has come in, check that the state has been initialized.voidclose()static InvDatasetFeatureCollectionfactory(thredds.server.catalog.FeatureCollectionRef parent, thredds.featurecollection.FeatureCollectionConfig config)protected voidfirstInit()protected StringgetCatalogHref(String what)thredds.featurecollection.FeatureCollectionConfiggetConfig()StringgetConfigPath()thredds.inventory.MCollectiongetDatasetCollectionManager()FilegetFile(String remaining)ucar.nc2.ft2.coverage.CoverageCollectiongetGridCoverage(String matchPath)ucar.nc2.dt.grid.GridDatasetgetGridDataset(String matchPath)Get the associated Grid Dataset, if any.StringgetLatestFileName()org.slf4j.LoggergetLogger()StringgetName()ucar.nc2.dataset.NetcdfDatasetgetNetcdfDataset(String matchPath)Get the dataset named by the path.protected StringgetPath()ucar.nc2.ft.FeatureDatasetPointgetPointDataset(String matchPath)Get the associated Point Dataset, if any.ucar.nc2.ft2.simpgeometry.SimpleGeometryFeatureDatasetgetSimpleGeometryDataset(String matchPath)StringgetTopDirectoryLocation()abstract thredds.client.catalog.builder.CatalogBuildermakeCatalog(String match, String orgPath, URI catURI)Get one of the catalogs contained in this collection, called by DataRootHandler.makeDynamicCatalog()protected thredds.client.catalog.builder.CatalogBuildermakeCatalogFiles(URI catURI, InvDatasetFeatureCollection.State localState, List<String> filenames, boolean addLatest)protected thredds.client.catalog.builder.CatalogBuildermakeCatalogTop(URI catURI, InvDatasetFeatureCollection.State localState)Make the containing catalog of this feature collection "http://server:port/thredds/catalog/path/catalog.xml"protected voidmakeCollection()protected abstract thredds.client.catalog.builder.DatasetBuildermakeDatasetTop(URI catURI, InvDatasetFeatureCollection.State localState)protected voidmakeDefaultServices()protected StringmakeFullName(thredds.client.catalog.DatasetNode ds)thredds.client.catalog.builder.CatalogBuildermakeLatest(String matchPath, String reqPath, URI catURI)protected StringmakeMetadataLink(String datasetName, String metadata)protected thredds.client.catalog.ThreddsMetadata.UriResolvedmakeUriResolved(URI baseURI, String href)voidprocessEvent(thredds.inventory.CollectionUpdateEvent event)static voidsetAllowedServices(AllowedServices _allowedServices)static voidsetContextName(String c)voidshowStatus(Formatter f)StringshowStatusShort(String type)protected voidupdate(thredds.inventory.CollectionUpdateType force)Collection was changed, update internal objects.protected abstract voidupdateCollection(InvDatasetFeatureCollection.State localState, thredds.inventory.CollectionUpdateType force)
-
-
-
Field Detail
-
LATEST_DATASET_CATALOG
protected static final String LATEST_DATASET_CATALOG
- See Also:
- Constant Field Values
-
VARIABLES
protected static final String VARIABLES
- See Also:
- Constant Field Values
-
FILES
protected static final String FILES
- See Also:
- Constant Field Values
-
useNetcdfJavaBuilders
protected static final boolean useNetcdfJavaBuilders
- See Also:
- Constant Field Values
-
allowedServices
protected static AllowedServices allowedServices
-
contextName
protected static String contextName
-
parent
protected thredds.server.catalog.FeatureCollectionRef parent
-
orgService
protected thredds.client.catalog.Service orgService
-
virtualService
protected thredds.client.catalog.Service virtualService
-
latestService
protected thredds.client.catalog.Service latestService
-
downloadService
protected thredds.client.catalog.Service downloadService
-
name
protected final String name
-
configPath
protected final String configPath
-
fcType
protected final thredds.featurecollection.FeatureCollectionType fcType
-
config
protected final thredds.featurecollection.FeatureCollectionConfig config
-
topDirectory
protected String topDirectory
-
datasetCollection
protected thredds.inventory.MFileCollectionManager datasetCollection
-
state
protected InvDatasetFeatureCollection.State state
-
first
protected boolean first
-
lock
protected final Object lock
-
-
Method Detail
-
setContextName
public static void setContextName(String c)
-
setAllowedServices
public static void setAllowedServices(AllowedServices _allowedServices)
-
factory
public static InvDatasetFeatureCollection factory(thredds.server.catalog.FeatureCollectionRef parent, thredds.featurecollection.FeatureCollectionConfig config)
-
makeDefaultServices
protected void makeDefaultServices()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
makeCollection
protected void makeCollection()
-
processEvent
public void processEvent(thredds.inventory.CollectionUpdateEvent event)
-
showStatus
public void showStatus(Formatter f)
-
_showStatus
protected void _showStatus(Formatter f, boolean summaryOnly, String type) throws IOException
- Throws:
IOException
-
getPath
protected String getPath()
-
updateCollection
protected abstract void updateCollection(InvDatasetFeatureCollection.State localState, thredds.inventory.CollectionUpdateType force)
-
firstInit
protected void firstInit()
-
checkState
protected InvDatasetFeatureCollection.State checkState() throws IOException
A request has come in, check that the state has been initialized. this is called from the request thread.- Returns:
- a copy of the State
- Throws:
IOException
-
update
protected void update(thredds.inventory.CollectionUpdateType force) throws IOExceptionCollection was changed, update internal objects. called by CollectionUpdater, trigger via handleCollectionEvent, so in a quartz scheduler thread- Parameters:
force- update type- Throws:
IOException
-
getName
public String getName()
-
getConfigPath
public String getConfigPath()
-
getLatestFileName
public String getLatestFileName()
-
getTopDirectoryLocation
public String getTopDirectoryLocation()
-
getConfig
public thredds.featurecollection.FeatureCollectionConfig getConfig()
-
getDatasetCollectionManager
public thredds.inventory.MCollection getDatasetCollectionManager()
-
getLogger
public org.slf4j.Logger getLogger()
-
makeFullName
protected String makeFullName(thredds.client.catalog.DatasetNode ds)
-
makeCatalog
public abstract thredds.client.catalog.builder.CatalogBuilder makeCatalog(String match, String orgPath, URI catURI) throws IOException
Get one of the catalogs contained in this collection, called by DataRootHandler.makeDynamicCatalog()- Parameters:
match- match.remainingorgPath- the path for the request.catURI- the base URI for the catalog to be made, used to resolve relative URLs.- Returns:
- containing catalog
- Throws:
IOException
-
makeDatasetTop
protected abstract thredds.client.catalog.builder.DatasetBuilder makeDatasetTop(URI catURI, InvDatasetFeatureCollection.State localState) throws IOException
- Throws:
IOException
-
makeCatalogTop
protected thredds.client.catalog.builder.CatalogBuilder makeCatalogTop(URI catURI, InvDatasetFeatureCollection.State localState) throws IOException, URISyntaxException
Make the containing catalog of this feature collection "http://server:port/thredds/catalog/path/catalog.xml"- Parameters:
catURI- base URI of the requestlocalState- current state to use- Returns:
- the top FMRC catalog
- Throws:
IOException- on I/O errorURISyntaxException- if path is misformed
-
makeCatalogFiles
protected thredds.client.catalog.builder.CatalogBuilder makeCatalogFiles(URI catURI, InvDatasetFeatureCollection.State localState, List<String> filenames, boolean addLatest) throws IOException
- Throws:
IOException
-
makeUriResolved
protected thredds.client.catalog.ThreddsMetadata.UriResolved makeUriResolved(URI baseURI, String href)
-
makeLatest
public thredds.client.catalog.builder.CatalogBuilder makeLatest(String matchPath, String reqPath, URI catURI) throws IOException
- Throws:
IOException
-
getPointDataset
public ucar.nc2.ft.FeatureDatasetPoint getPointDataset(String matchPath) throws IOException
Get the associated Point Dataset, if any. called by DatasetHandler.openPointDataset()- Parameters:
matchPath- match.remaining- Returns:
- Grid Dataset, or null if n/a
- Throws:
IOException- on error
-
getGridDataset
public ucar.nc2.dt.grid.GridDataset getGridDataset(String matchPath) throws IOException
Get the associated Grid Dataset, if any. called by DatasetHandler.openGridDataset()- Parameters:
matchPath- match.remaining- Returns:
- Grid Dataset, or null if n/a
- Throws:
IOException- on error
-
getGridCoverage
public ucar.nc2.ft2.coverage.CoverageCollection getGridCoverage(String matchPath) throws IOException
- Throws:
IOException
-
getSimpleGeometryDataset
public ucar.nc2.ft2.simpgeometry.SimpleGeometryFeatureDataset getSimpleGeometryDataset(String matchPath) throws IOException
- Throws:
IOException
-
getNetcdfDataset
public ucar.nc2.dataset.NetcdfDataset getNetcdfDataset(String matchPath) throws IOException
Get the dataset named by the path. called by DatasetHandler.getNetcdfFile()- Parameters:
matchPath- remaining path from match- Returns:
- requested dataset
- Throws:
IOException- if read error
-
-